Merge "QS edit mode fixes." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c6de4240d5
@@ -140,7 +140,6 @@ public class QSContainerImpl extends FrameLayout {
|
||||
setMargins(mQSFooter);
|
||||
setMargins(mQSPanel);
|
||||
setMargins(mHeader);
|
||||
setMargins(mQSCustomizer);
|
||||
}
|
||||
|
||||
private void setMargins(View view) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user