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

Commit 2ad01d99 authored by Amin Shaikh's avatar Amin Shaikh Committed by android-build-merger
Browse files

Merge "QS edit mode fixes." into pi-dev am: c6de4240

am: ca84bcae

Change-Id: I2b1412cf3bded51ce6b326d79ad786c392fd7cc7
parents 69603e48 ca84bcae
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ public class QSContainerImpl extends FrameLayout {
        setMargins(mQSFooter);
        setMargins(mQSPanel);
        setMargins(mHeader);
        setMargins(mQSCustomizer);
    }

    private void setMargins(View view) {
+10 −19
Original line number Diff line number Diff line
@@ -15,42 +15,33 @@
package com.android.systemui.qs.customize;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.android.systemui.R;

import com.android.systemui.plugins.qs.QSIconView;
import com.android.systemui.plugins.qs.QSTile;
import com.android.systemui.qs.tileimpl.QSTileView;
import java.util.Objects;

public class CustomizeTileView extends QSTileView {
    private boolean mShowAppLabel;

    private TextView mAppLabel;
    private int mLabelMinLines;
    public CustomizeTileView(Context context, QSIconView icon) {
        super(context, icon);
    }

    @Override
    protected void createLabel() {
        super.createLabel();
        mLabelMinLines = mLabel.getMinLines();
        mAppLabel = findViewById(R.id.app_label);
        mAppLabel.setAlpha(.6f);
    }

    public void setShowAppLabel(boolean showAppLabel) {
        mAppLabel.setVisibility(showAppLabel ? View.VISIBLE : View.GONE);
        mShowAppLabel = showAppLabel;
        mSecondLine.setVisibility(showAppLabel ? View.VISIBLE : View.GONE);
        mLabel.setSingleLine(showAppLabel);
    }

    public void setAppLabel(CharSequence label) {
        if (!Objects.equals(label, mAppLabel.getText())) {
            mAppLabel.setText(label);
        }
    @Override
    protected void handleStateChanged(QSTile.State state) {
        super.handleStateChanged(state);
        mSecondLine.setVisibility(mShowAppLabel ? View.VISIBLE : View.GONE);
    }

    public TextView getAppLabel() {
        return mAppLabel;
        return mSecondLine;
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -274,7 +274,6 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
                    R.string.accessibility_qs_edit_tile_label, position + 1, info.state.label);
        }
        holder.mTileView.onStateChanged(info.state);
        holder.mTileView.setAppLabel(info.appLabel);
        holder.mTileView.setShowAppLabel(position > mEditIndex && !info.isSystem);

        if (mAccessibilityManager.isTouchExplorationEnabled()) {
+3 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.service.quicksettings.TileService;
import android.text.TextUtils;
import android.widget.Button;

import com.android.systemui.Dependency;
@@ -169,7 +170,8 @@ public class TileQueryHelper {
        info.state.expandedAccessibilityClassName =
                Button.class.getName();
        info.spec = spec;
        info.appLabel = appLabel;
        info.state.secondaryLabel = (isSystem || TextUtils.equals(state.label, appLabel))
                ? null : appLabel;
        info.isSystem = isSystem;
        mTiles.add(info);
        mSpecs.add(spec);
@@ -186,7 +188,6 @@ public class TileQueryHelper {

    public static class TileInfo {
        public String spec;
        public CharSequence appLabel;
        public QSTile.State state;
        public boolean isSystem;
    }
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ public class QSTileView extends QSTileBaseView {
    private static final boolean DUAL_TARGET_ALLOWED = false;
    private View mDivider;
    protected TextView mLabel;
    private TextView mSecondLine;
    protected TextView mSecondLine;
    private ImageView mPadLock;
    private int mState;
    private ViewGroup mLabelContainer;