Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7917546d authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Some header layout cleanup and alignment"

parents 6cb3ee83 c133d26b
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -35,18 +35,22 @@
    <com.android.systemui.qs.QuickQSPanel
        android:id="@+id/quick_qs_panel"
        android:background="#0000"
        android:layout_width="142dp"
        android:layout_width="144dp"
        android:layout_height="match_parent"
        android:layout_alignParentEnd="true" />
        android:layout_alignParentEnd="true"
        android:layout_marginEnd="12dp" />

    <LinearLayout
        android:id="@+id/expanded_group"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:gravity="center"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="horizontal"
        android:layout_alignParentEnd="true">
        android:layout_alignParentEnd="true"
        android:layout_marginEnd="10dp">

        <com.android.systemui.statusbar.AlphaOptimizedFrameLayout
            android:id="@+id/settings_button_container"
            android:layout_width="48dp"
@@ -74,7 +78,8 @@

        <ImageView
            android:layout_width="48dp"
            android:layout_height="match_parent"
            android:layout_height="48dp"
            android:padding="12dp"
            android:src="@drawable/ic_expand_less"
            android:tint="@android:color/white" />
    </LinearLayout>
+2 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@
    <dimen name="qs_new_tile_height">100dp</dimen>
    <dimen name="qs_quick_actions_height">88dp</dimen>
    <dimen name="qs_quick_actions_padding">25dp</dimen>
    <dimen name="qs_quick_tile_size">48dp</dimen>
    <dimen name="qs_quick_tile_padding">12dp</dimen>
    <dimen name="qs_page_indicator_size">12dp</dimen>
    <dimen name="qs_tile_icon_size">24dp</dimen>
    <dimen name="qs_tile_text_size">12sp</dimen>
+78 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import com.android.systemui.qs.QSTile;
import com.android.systemui.qs.QSTileBaseView;

public class QSQuickTileView extends QSTileBaseView {

    private final int mPadding;
    private final ImageView mIcon;

    public QSQuickTileView(Context context) {
        super(context);
        mPadding = context.getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_padding);
        mIcon = createIcon();
        addView(mIcon);
    }

    protected ImageView createIcon() {
        final ImageView icon = new ImageView(mContext);
        icon.setId(android.R.id.icon);
        icon.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        return icon;
    }

    @Override
    public void init(OnClickListener click, OnClickListener clickSecondary,
                     OnLongClickListener longClick) {
        setClickable(true);
        setOnClickListener(click);
    }

    @Override
    protected void handleStateChanged(QSTile.State state) {
        mIcon.setImageDrawable(state.icon.getDrawable(getContext()));
        setContentDescription(state.contentDescription);
    }

    @Override
    public boolean setType(int type) {
        return false;
    }

    @Override
    public View updateAccessibilityOrder(View previousView) {
        return this;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        mIcon.measure(exactly(getMeasuredWidth() - 2 * mPadding),
                exactly(getMeasuredHeight() - 2 * mPadding));
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        layout(mIcon, mPadding, mPadding);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -566,7 +566,7 @@ public class QSPanel extends FrameLayout implements Tunable {

    public static final class TileRecord extends Record {
        public QSTile<?> tile;
        public QSTileView tileView;
        public QSTileBaseView tileView;
        public int row;
        public int col;
        public boolean scanState;
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public abstract class QSTile<TState extends State> implements Listenable {
        return mHost;
    }

    public QSTileView createTileView(Context context) {
    public QSTileBaseView createTileView(Context context) {
        return new QSTileView(context);
    }

Loading