All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.com.android.systemui.qs.QuickTileLayout Maven / Gradle / Ivy

Go to download

A library jar that provides APIs for Applications written for the Google Android Platform.

There is a newer version: 15-robolectric-12650502
Show newest version
package com.android.systemui.qs;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class QuickTileLayout extends LinearLayout {

    public QuickTileLayout(Context context) {
        this(context, null);
    }

    public QuickTileLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        setGravity(Gravity.CENTER);
    }

    @Override
    public void addView(View child, int index, ViewGroup.LayoutParams params) {
        // Make everything square at the height of this view.
        params = new LayoutParams(params.height, params.height);
        ((LinearLayout.LayoutParams) params).weight = 1;
        super.addView(child, index, params);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy