summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java26
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/SideLabelTileLayout.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/TileLayout.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizerController.java33
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java5
10 files changed, 5 insertions, 108 deletions
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java
index bcd28a6ab124..53f7e44bc25a 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTileView.java
@@ -50,6 +50,4 @@ public abstract class QSTileView extends LinearLayout {
public abstract void onStateChanged(State state);
public abstract int getDetailY();
-
- public void setShowLabels(boolean show) {}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index eaf212362320..fcb56a4ec75d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -71,7 +71,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
private int mMinRows = 1;
private int mMaxColumns = TileLayout.NO_MAX_COLUMNS;
- private boolean mShowLabels = true;
private final boolean mSideLabels;
public PagedTileLayout(Context context, AttributeSet attrs) {
@@ -91,16 +90,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
}
private int mLastMaxHeight = -1;
- @Override
- public void setShowLabels(boolean show) {
- mShowLabels = show;
- for (TileLayout p : mPages) {
- p.setShowLabels(show);
- }
- mDistributeTiles = true;
- requestLayout();
- }
-
public void saveInstanceState(Bundle outState) {
outState.putInt(CURRENT_PAGE, getCurrentItem());
}
@@ -239,7 +228,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
: R.layout.qs_paged_page, this, false);
page.setMinRows(mMinRows);
page.setMaxColumns(mMaxColumns);
- page.setShowLabels(mShowLabels);
return page;
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 05633071be86..7657dcead583 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -847,8 +847,6 @@ public class QSPanel extends LinearLayout implements Tunable {
default void setExpansion(float expansion) {}
int getNumVisibleTiles();
-
- default void setShowLabels(boolean show) {}
}
interface OnConfigurationChangedListener {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
index d60801ef2d03..eda1abb0997e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
@@ -124,7 +124,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
updateMediaDisappearParameters();
mTunerService.addTunable(mView, QS_SHOW_BRIGHTNESS);
- mTunerService.addTunable(mTunable, QS_REMOVE_LABELS);
mView.updateResources();
if (mView.isListening()) {
refreshAllTiles();
@@ -138,13 +137,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
}
@Override
- boolean switchTileLayout(boolean force) {
- boolean result = super.switchTileLayout(force);
- getTileLayout().setShowLabels(mShowLabels);
- return result;
- }
-
- @Override
protected QSTileRevealController createTileRevealController() {
return mQsTileRevealControllerFactory.create(
this, (PagedTileLayout) mView.createRegularTileLayout());
@@ -152,7 +144,6 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
@Override
protected void onViewDetached() {
- mTunerService.removeTunable(mTunable);
mTunerService.removeTunable(mView);
mView.removeOnConfigurationChangedListener(mOnConfigurationChangedListener);
if (mBrightnessMirrorController != null) {
@@ -318,22 +309,5 @@ public class QSPanelController extends QSPanelControllerBase<QSPanel> {
public boolean isExpanded() {
return mView.isExpanded();
}
-
- private TunerService.Tunable mTunable = new TunerService.Tunable() {
- @Override
- public void onTuningChanged(String key, String newValue) {
- if (QS_REMOVE_LABELS.equals(key)) {
- if (!mQSLabelFlag) return;
- boolean newShowLabels = newValue == null || "0".equals(newValue);
- if (mShowLabels == newShowLabels) return;
- mShowLabels = newShowLabels;
- for (TileRecord t : mRecords) {
- t.tileView.setShowLabels(mShowLabels);
- }
- getTileLayout().setShowLabels(mShowLabels);
- mView.requestLayout();
- }
- }
- };
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java
index f1174fbe7aef..8ab17432524d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java
@@ -198,7 +198,6 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr
final TileRecord r = new TileRecord();
r.tile = tile;
r.tileView = mHost.createTileView(tile, collapsedView);
- r.tileView.setShowLabels(mShowLabels);
mView.addTile(r);
mRecords.add(r);
mCachedSpecs = getTilesSpecs();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/SideLabelTileLayout.kt b/packages/SystemUI/src/com/android/systemui/qs/SideLabelTileLayout.kt
index 4de4a78e9e8a..c3cc3af10e83 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/SideLabelTileLayout.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/SideLabelTileLayout.kt
@@ -34,8 +34,6 @@ open class SideLabelTileLayout(
}
}
- override fun setShowLabels(show: Boolean) { }
-
override fun isFull(): Boolean {
return mRecords.size >= maxTiles()
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java
index 14cbf980df23..c1ce4a577dda 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java
@@ -36,7 +36,6 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
private int mCellMarginTop;
protected boolean mListening;
protected int mMaxAllowedRows = 3;
- private boolean mShowLabels = true;
// Prototyping with less rows
private final boolean mLessRows;
@@ -57,12 +56,6 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
}
@Override
- public void setShowLabels(boolean show) {
- mShowLabels = show;
- updateResources();
- }
-
- @Override
public int getOffsetTop(TileRecord tile) {
return getTop();
}
@@ -128,12 +121,9 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
mMaxCellHeight = mContext.getResources().getDimensionPixelSize(R.dimen.qs_tile_height);
mCellMarginHorizontal = res.getDimensionPixelSize(R.dimen.qs_tile_margin_horizontal);
mCellMarginVertical= res.getDimensionPixelSize(R.dimen.qs_tile_margin_vertical);
- if (!mShowLabels && mCellMarginVertical == 0) {
- mCellMarginVertical = mCellMarginHorizontal;
- }
mCellMarginTop = res.getDimensionPixelSize(R.dimen.qs_tile_margin_top);
mMaxAllowedRows = Math.max(1, getResources().getInteger(R.integer.quick_settings_max_rows));
- if (mLessRows && mShowLabels) mMaxAllowedRows = Math.max(mMinRows, mMaxAllowedRows - 1);
+ if (mLessRows) mMaxAllowedRows = Math.max(mMinRows, mMaxAllowedRows - 1);
if (updateColumns()) {
requestLayout();
return true;
@@ -194,9 +184,8 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
+ mCellMarginVertical;
final int previousRows = mRows;
mRows = availableHeight / (getCellHeight() + mCellMarginVertical);
- final int minRows = mShowLabels ? mMinRows : mMinRows + 1;
- if (mRows < minRows) {
- mRows = minRows;
+ if (mRows < mMinRows) {
+ mRows = mMinRows;
} else if (mRows >= mMaxAllowedRows) {
mRows = mMaxAllowedRows;
}
@@ -216,7 +205,7 @@ public class TileLayout extends ViewGroup implements QSTileLayout {
}
protected int getCellHeight() {
- return mShowLabels ? mMaxCellHeight : mMaxCellHeight / 2;
+ return mMaxCellHeight;
}
protected void layoutTileRecords(int numRecords) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
index 9fe949b15933..dce081f21581 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
@@ -25,7 +25,6 @@ import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.Menu;
-import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toolbar;
@@ -48,7 +47,6 @@ import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
public class QSCustomizer extends LinearLayout {
static final int MENU_RESET = Menu.FIRST;
- static final int MENU_REMOVE_LABELS = Menu.FIRST + 1;
static final String EXTRA_QS_CUSTOMIZING = "qs_customizing";
private final QSDetailClipper mClipper;
@@ -77,10 +75,6 @@ public class QSCustomizer extends LinearLayout {
toolbar.getMenu().add(Menu.NONE, MENU_RESET, 0,
mContext.getString(com.android.internal.R.string.reset));
- // Prototype menu item
- toolbar.getMenu()
- .add(Menu.NONE, MENU_REMOVE_LABELS, Menu.NONE, R.string.qs_remove_labels)
- .setCheckable(true);
toolbar.setTitle(R.string.qs_edit);
mRecyclerView = findViewById(android.R.id.list);
mTransparentView = findViewById(R.id.customizer_transparent_view);
@@ -89,11 +83,6 @@ public class QSCustomizer extends LinearLayout {
mRecyclerView.setItemAnimator(animator);
}
- MenuItem getRemoveItem() {
- return ((Toolbar) findViewById(com.android.internal.R.id.action_bar))
- .getMenu().findItem(MENU_REMOVE_LABELS);
- }
-
void updateResources() {
LayoutParams lp = (LayoutParams) mTransparentView.getLayoutParams();
lp.height = mContext.getResources().getDimensionPixelSize(
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizerController.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizerController.java
index d4bab2197249..f56a2bbefaf7 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizerController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizerController.java
@@ -17,9 +17,7 @@
package com.android.systemui.qs.customize;
import static com.android.systemui.qs.customize.QSCustomizer.EXTRA_QS_CUSTOMIZING;
-import static com.android.systemui.qs.customize.QSCustomizer.MENU_REMOVE_LABELS;
import static com.android.systemui.qs.customize.QSCustomizer.MENU_RESET;
-import static com.android.systemui.qs.dagger.QSFlagsModule.QS_LABELS_FLAG;
import android.content.res.Configuration;
import android.os.Bundle;
@@ -38,7 +36,6 @@ import com.android.systemui.keyguard.ScreenLifecycle;
import com.android.systemui.plugins.qs.QSTile;
import com.android.systemui.qs.QSEditEvent;
import com.android.systemui.qs.QSFragment;
-import com.android.systemui.qs.QSPanelController;
import com.android.systemui.qs.QSTileHost;
import com.android.systemui.qs.dagger.QSScope;
import com.android.systemui.statusbar.phone.LightBarController;
@@ -46,14 +43,12 @@ import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.statusbar.policy.KeyguardStateController;
-import com.android.systemui.tuner.TunerService;
import com.android.systemui.util.ViewController;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
-import javax.inject.Named;
/** {@link ViewController} for {@link QSCustomizer}. */
@QSScope
@@ -67,8 +62,6 @@ public class QSCustomizerController extends ViewController<QSCustomizer> {
private final ConfigurationController mConfigurationController;
private final UiEventLogger mUiEventLogger;
private final Toolbar mToolbar;
- private final TunerService mTunerService;
- private final boolean mQsLabelsFlag;
private final OnMenuItemClickListener mOnMenuItemClickListener = new OnMenuItemClickListener() {
@Override
@@ -76,11 +69,6 @@ public class QSCustomizerController extends ViewController<QSCustomizer> {
if (item.getItemId() == MENU_RESET) {
mUiEventLogger.log(QSEditEvent.QS_EDIT_RESET);
reset();
- } else if (item.getItemId() == MENU_REMOVE_LABELS) {
- item.setChecked(!item.isChecked());
- mTunerService.setValue(
- QSPanelController.QS_REMOVE_LABELS, item.isChecked() ? "1" : "0");
- return false;
}
return false;
}
@@ -111,20 +99,11 @@ public class QSCustomizerController extends ViewController<QSCustomizer> {
}
};
- private final TunerService.Tunable mTunable = new TunerService.Tunable() {
- @Override
- public void onTuningChanged(String key, String newValue) {
- mToolbar.getMenu().findItem(MENU_REMOVE_LABELS)
- .setChecked(newValue != null && !("0".equals(newValue)));
- }
- };
-
@Inject
protected QSCustomizerController(QSCustomizer view, TileQueryHelper tileQueryHelper,
QSTileHost qsTileHost, TileAdapter tileAdapter, ScreenLifecycle screenLifecycle,
KeyguardStateController keyguardStateController, LightBarController lightBarController,
- ConfigurationController configurationController, UiEventLogger uiEventLogger,
- TunerService tunerService, @Named(QS_LABELS_FLAG) boolean qsLabelsFlag) {
+ ConfigurationController configurationController, UiEventLogger uiEventLogger) {
super(view);
mTileQueryHelper = tileQueryHelper;
mQsTileHost = qsTileHost;
@@ -136,21 +115,12 @@ public class QSCustomizerController extends ViewController<QSCustomizer> {
mUiEventLogger = uiEventLogger;
mToolbar = mView.findViewById(com.android.internal.R.id.action_bar);
- mQsLabelsFlag = qsLabelsFlag;
-
- mTunerService = tunerService;
}
- @Override
- protected void onInit() {
- super.onInit();
- mView.getRemoveItem().setVisible(mQsLabelsFlag);
- }
@Override
protected void onViewAttached() {
mView.updateNavBackDrop(getResources().getConfiguration(), mLightBarController);
- mTunerService.addTunable(mTunable, QSPanelController.QS_REMOVE_LABELS);
mConfigurationController.addCallback(mConfigurationListener);
@@ -181,7 +151,6 @@ public class QSCustomizerController extends ViewController<QSCustomizer> {
@Override
protected void onViewDetached() {
- mTunerService.removeTunable(mTunable);
mTileQueryHelper.setListener(null);
mToolbar.setOnMenuItemClickListener(null);
mConfigurationController.removeCallback(mConfigurationListener);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java
index 424aafac1f7a..207b25d001b9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java
@@ -174,9 +174,4 @@ public class QSTileView extends QSTileBaseView {
mLabelContainer.setClickable(false);
mLabelContainer.setLongClickable(false);
}
-
- @Override
- public void setShowLabels(boolean show) {
- mHandler.post(() -> mLabelContainer.setVisibility(show ? VISIBLE : GONE));
- }
}