Merge "Bring out your toggles" into nyc-dev

This commit is contained in:
Jason Monk
2016-06-17 17:22:01 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 11 deletions

View File

@@ -112,6 +112,11 @@ public class QuickQSPanel extends QSPanel {
} }
} }
@Override
protected void onTileClick(QSTile<?> tile) {
tile.secondaryClick();
}
@Override @Override
public void onTuningChanged(String key, String newValue) { public void onTuningChanged(String key, String newValue) {
// No tunings for you. // No tunings for you.
@@ -130,7 +135,7 @@ public class QuickQSPanel extends QSPanel {
break; break;
} }
} }
super.setTiles(quickTiles, false); super.setTiles(quickTiles, true);
} }
private final Tunable mNumTiles = new Tunable() { private final Tunable mNumTiles = new Tunable() {

View File

@@ -94,14 +94,6 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
} }
} }
@Override
protected void handleSecondaryClick() {
boolean dataEnabled = mDataController.isMobileDataSupported()
&& mDataController.isMobileDataEnabled();
MetricsLogger.action(mContext, MetricsEvent.QS_CELLULAR_TOGGLE, !dataEnabled);
mDataController.setMobileDataEnabled(!dataEnabled);
}
@Override @Override
public CharSequence getTileLabel() { public CharSequence getTileLabel() {
return mContext.getString(R.string.quick_settings_cellular_detail_title); return mContext.getString(R.string.quick_settings_cellular_detail_title);
@@ -152,8 +144,8 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
} }
state.contentDescription = state.contentDescription + "," + r.getString( state.contentDescription = state.contentDescription + "," + r.getString(
R.string.accessibility_quick_settings_open_settings, getTileLabel()); R.string.accessibility_quick_settings_open_settings, getTileLabel());
state.expandedAccessibilityClassName = Button.class.getName(); state.minimalAccessibilityClassName = state.expandedAccessibilityClassName
state.minimalAccessibilityClassName = Switch.class.getName(); = Button.class.getName();
state.value = mDataController.isMobileDataSupported() state.value = mDataController.isMobileDataSupported()
&& mDataController.isMobileDataEnabled(); && mDataController.isMobileDataEnabled();
} }