Merge "Remove QS details prototype code" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
16715e7f85
@@ -61,22 +61,6 @@ public final class SystemUiDeviceConfigFlags {
|
|||||||
public static final String SCREENSHOT_NOTIFICATION_SMART_ACTIONS_TIMEOUT_MS =
|
public static final String SCREENSHOT_NOTIFICATION_SMART_ACTIONS_TIMEOUT_MS =
|
||||||
"screenshot_notification_smart_actions_timeout_ms";
|
"screenshot_notification_smart_actions_timeout_ms";
|
||||||
|
|
||||||
// Flags related to controls
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (boolean) Whether to have split behavior when opening QS
|
|
||||||
*/
|
|
||||||
public static final String QS_SPLIT_ENABLED = "qs_split_enabled";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (int) Open settings panels for WiFi and BT tiles
|
|
||||||
* 0 - default behavior, link to settings
|
|
||||||
* 1 - open panel on long press, click remains the same
|
|
||||||
* 2 - open panel on click, long press remains the same
|
|
||||||
* 3 - use details on long press
|
|
||||||
*/
|
|
||||||
public static final String QS_USE_SETTINGS_PANELS = "qs_use_settings_panels";
|
|
||||||
|
|
||||||
// Flags related to Smart Suggestions - these are read in SmartReplyConstants.
|
// Flags related to Smart Suggestions - these are read in SmartReplyConstants.
|
||||||
|
|
||||||
/** (boolean) Whether to enable smart suggestions in notifications. */
|
/** (boolean) Whether to enable smart suggestions in notifications. */
|
||||||
|
|||||||
@@ -66,14 +66,6 @@ public interface QSTile {
|
|||||||
|
|
||||||
void destroy();
|
void destroy();
|
||||||
|
|
||||||
/**
|
|
||||||
* return true if the tile supports detail views, and not
|
|
||||||
* only boolean states
|
|
||||||
*/
|
|
||||||
default boolean supportsDetailView() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
CharSequence getTileLabel();
|
CharSequence getTileLabel();
|
||||||
|
|
||||||
State getState();
|
State getState();
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2019 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- use 'dp' instead of 'sp' as we do not want the text to increase
|
|
||||||
if the user scales the font size -->
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|center_horizontal"
|
|
||||||
android:text="..."
|
|
||||||
android:textSize="16dp"
|
|
||||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:paddingBottom="@dimen/qs_tile_detail_padding"
|
|
||||||
android:clickable="false"
|
|
||||||
android:focusable="false" />
|
|
||||||
|
|
||||||
@@ -502,7 +502,6 @@
|
|||||||
<dimen name="qs_page_indicator_width">16dp</dimen>
|
<dimen name="qs_page_indicator_width">16dp</dimen>
|
||||||
<dimen name="qs_page_indicator_height">8dp</dimen>
|
<dimen name="qs_page_indicator_height">8dp</dimen>
|
||||||
<dimen name="qs_tile_icon_size">24dp</dimen>
|
<dimen name="qs_tile_icon_size">24dp</dimen>
|
||||||
<dimen name="qs_tile_detail_padding">3dp</dimen>
|
|
||||||
<dimen name="qs_tile_text_size">12sp</dimen>
|
<dimen name="qs_tile_text_size">12sp</dimen>
|
||||||
<dimen name="qs_tile_divider_height">1dp</dimen>
|
<dimen name="qs_tile_divider_height">1dp</dimen>
|
||||||
<dimen name="qs_panel_padding">16dp</dimen>
|
<dimen name="qs_panel_padding">16dp</dimen>
|
||||||
|
|||||||
@@ -33,11 +33,6 @@
|
|||||||
<!-- Maximum number of bubbles we allow in overflow before we dismiss the oldest one. -->
|
<!-- Maximum number of bubbles we allow in overflow before we dismiss the oldest one. -->
|
||||||
<integer name="bubbles_max_overflow">16</integer>
|
<integer name="bubbles_max_overflow">16</integer>
|
||||||
|
|
||||||
<!-- Ratio of "left" end of status bar that will swipe to QQS. -->
|
|
||||||
<integer name="qqs_split_fraction">3</integer>
|
|
||||||
<!-- Ratio of "right" end of status bar that will swipe to QS. -->
|
|
||||||
<integer name="qs_split_fraction">2</integer>
|
|
||||||
|
|
||||||
<integer name="magnification_default_scale">2</integer>
|
<integer name="magnification_default_scale">2</integer>
|
||||||
|
|
||||||
<!-- The position of the volume dialog on the screen.
|
<!-- The position of the volume dialog on the screen.
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import com.android.systemui.Dependency;
|
|||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
import com.android.systemui.plugins.ActivityStarter;
|
|
||||||
import com.android.systemui.media.MediaHierarchyManager;
|
import com.android.systemui.media.MediaHierarchyManager;
|
||||||
import com.android.systemui.media.MediaHost;
|
import com.android.systemui.media.MediaHost;
|
||||||
import com.android.systemui.plugins.qs.QSTile;
|
import com.android.systemui.plugins.qs.QSTile;
|
||||||
@@ -227,6 +226,11 @@ public class QuickQSPanel extends QSPanel {
|
|||||||
mFullPanel = fullPanel;
|
mFullPanel = fullPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean shouldShowDetail() {
|
||||||
|
return !mExpanded;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawTile(TileRecord r, State state) {
|
protected void drawTile(TileRecord r, State state) {
|
||||||
if (state instanceof SignalState) {
|
if (state instanceof SignalState) {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ import android.text.TextUtils;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.PathParser;
|
import android.util.PathParser;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
@@ -44,7 +43,6 @@ import android.view.accessibility.AccessibilityNodeInfo;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.android.settingslib.Utils;
|
import com.android.settingslib.Utils;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
@@ -70,7 +68,6 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
|||||||
private float mStrokeWidthInactive;
|
private float mStrokeWidthInactive;
|
||||||
|
|
||||||
private final ImageView mBg;
|
private final ImageView mBg;
|
||||||
private final TextView mDetailText;
|
|
||||||
private final int mColorActive;
|
private final int mColorActive;
|
||||||
private final int mColorInactive;
|
private final int mColorInactive;
|
||||||
private final int mColorDisabled;
|
private final int mColorDisabled;
|
||||||
@@ -112,12 +109,6 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
|||||||
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
|
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
Gravity.CENTER);
|
Gravity.CENTER);
|
||||||
mIconFrame.addView(mIcon, params);
|
mIconFrame.addView(mIcon, params);
|
||||||
|
|
||||||
// "..." afforadance below icon
|
|
||||||
mDetailText = (TextView) LayoutInflater.from(context).inflate(R.layout.qs_tile_detail_text,
|
|
||||||
mIconFrame, false);
|
|
||||||
mIconFrame.addView(mDetailText);
|
|
||||||
|
|
||||||
mIconFrame.setClipChildren(false);
|
mIconFrame.setClipChildren(false);
|
||||||
mIconFrame.setClipToPadding(false);
|
mIconFrame.setClipToPadding(false);
|
||||||
|
|
||||||
@@ -173,10 +164,6 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
|||||||
tile.longClick();
|
tile.longClick();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (tile.supportsDetailView()) {
|
|
||||||
mDetailText.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(OnClickListener click, OnClickListener secondaryClick,
|
public void init(OnClickListener click, OnClickListener secondaryClick,
|
||||||
@@ -254,8 +241,6 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
|||||||
mCircleColor = circleColor;
|
mCircleColor = circleColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
mDetailText.setTextColor(QSTileImpl.getColorForState(getContext(), state.state));
|
|
||||||
|
|
||||||
mShowRippleEffect = state.showRippleEffect;
|
mShowRippleEffect = state.showRippleEffect;
|
||||||
setClickable(state.state != Tile.STATE_UNAVAILABLE);
|
setClickable(state.state != Tile.STATE_UNAVAILABLE);
|
||||||
setLongClickable(state.handlesLongClick);
|
setLongClickable(state.handlesLongClick);
|
||||||
@@ -400,4 +385,4 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,8 +68,6 @@ import com.android.systemui.qs.QSEvent;
|
|||||||
import com.android.systemui.qs.QSHost;
|
import com.android.systemui.qs.QSHost;
|
||||||
import com.android.systemui.qs.QuickStatusBarHeader;
|
import com.android.systemui.qs.QuickStatusBarHeader;
|
||||||
import com.android.systemui.qs.logging.QSLogger;
|
import com.android.systemui.qs.logging.QSLogger;
|
||||||
import com.android.systemui.qs.tiles.QSSettingsControllerKt;
|
|
||||||
import com.android.systemui.qs.tiles.QSSettingsPanel;
|
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@@ -152,19 +150,12 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
|
|||||||
*/
|
*/
|
||||||
abstract public int getMetricsCategory();
|
abstract public int getMetricsCategory();
|
||||||
|
|
||||||
/**
|
|
||||||
* Experimental option on whether to use settings panels. Only loaded on creation, so the tile
|
|
||||||
* needs to be removed and added for this to take effect.
|
|
||||||
*/
|
|
||||||
protected final QSSettingsPanel mQSSettingsPanelOption;
|
|
||||||
|
|
||||||
protected QSTileImpl(QSHost host) {
|
protected QSTileImpl(QSHost host) {
|
||||||
mHost = host;
|
mHost = host;
|
||||||
mContext = host.getContext();
|
mContext = host.getContext();
|
||||||
mInstanceId = host.getNewInstanceId();
|
mInstanceId = host.getNewInstanceId();
|
||||||
mState = newTileState();
|
mState = newTileState();
|
||||||
mTmpState = newTileState();
|
mTmpState = newTileState();
|
||||||
mQSSettingsPanelOption = QSSettingsControllerKt.getQSSettingsPanelOption();
|
|
||||||
mQSLogger = host.getQSLogger();
|
mQSLogger = host.getQSLogger();
|
||||||
mUiEventLogger = host.getUiEventLogger();
|
mUiEventLogger = host.getUiEventLogger();
|
||||||
}
|
}
|
||||||
@@ -366,10 +357,6 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
|
|||||||
* {@link QSTileImpl#getLongClickIntent}
|
* {@link QSTileImpl#getLongClickIntent}
|
||||||
*/
|
*/
|
||||||
protected void handleLongClick() {
|
protected void handleLongClick() {
|
||||||
if (mQSSettingsPanelOption == QSSettingsPanel.USE_DETAIL) {
|
|
||||||
showDetail(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Dependency.get(ActivityStarter.class).postStartActivityDismissingKeyguard(
|
Dependency.get(ActivityStarter.class).postStartActivityDismissingKeyguard(
|
||||||
getLongClickIntent(), 0);
|
getLongClickIntent(), 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2019 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.qs.tiles
|
|
||||||
|
|
||||||
import android.provider.DeviceConfig
|
|
||||||
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags
|
|
||||||
|
|
||||||
enum class QSSettingsPanel {
|
|
||||||
DEFAULT,
|
|
||||||
OPEN_LONG_PRESS,
|
|
||||||
OPEN_CLICK,
|
|
||||||
USE_DETAIL
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getQSSettingsPanelOption(): QSSettingsPanel =
|
|
||||||
when (DeviceConfig.getInt(DeviceConfig.NAMESPACE_SYSTEMUI,
|
|
||||||
SystemUiDeviceConfigFlags.QS_USE_SETTINGS_PANELS, 0)) {
|
|
||||||
1 -> QSSettingsPanel.OPEN_LONG_PRESS
|
|
||||||
2 -> QSSettingsPanel.OPEN_CLICK
|
|
||||||
3 -> QSSettingsPanel.USE_DETAIL
|
|
||||||
else -> QSSettingsPanel.DEFAULT
|
|
||||||
}
|
|
||||||
@@ -56,7 +56,6 @@ import javax.inject.Inject;
|
|||||||
/** Quick settings tile: Wifi **/
|
/** Quick settings tile: Wifi **/
|
||||||
public class WifiTile extends QSTileImpl<SignalState> {
|
public class WifiTile extends QSTileImpl<SignalState> {
|
||||||
private static final Intent WIFI_SETTINGS = new Intent(Settings.ACTION_WIFI_SETTINGS);
|
private static final Intent WIFI_SETTINGS = new Intent(Settings.ACTION_WIFI_SETTINGS);
|
||||||
private static final Intent WIFI_PANEL = new Intent(Settings.Panel.ACTION_WIFI);
|
|
||||||
|
|
||||||
protected final NetworkController mController;
|
protected final NetworkController mController;
|
||||||
private final AccessPointController mWifiController;
|
private final AccessPointController mWifiController;
|
||||||
@@ -109,21 +108,11 @@ public class WifiTile extends QSTileImpl<SignalState> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Intent getLongClickIntent() {
|
public Intent getLongClickIntent() {
|
||||||
if (mQSSettingsPanelOption == QSSettingsPanel.OPEN_LONG_PRESS) return WIFI_PANEL;
|
return WIFI_SETTINGS;
|
||||||
else return WIFI_SETTINGS;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsDetailView() {
|
|
||||||
return getDetailAdapter() != null && mQSSettingsPanelOption == QSSettingsPanel.OPEN_CLICK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleClick() {
|
protected void handleClick() {
|
||||||
if (mQSSettingsPanelOption == QSSettingsPanel.OPEN_CLICK) {
|
|
||||||
mActivityStarter.postStartActivityDismissingKeyguard(WIFI_PANEL, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Secondary clicks are header clicks, just toggle.
|
// Secondary clicks are header clicks, just toggle.
|
||||||
mState.copyTo(mStateBeforeClick);
|
mState.copyTo(mStateBeforeClick);
|
||||||
boolean wifiEnabled = mState.value;
|
boolean wifiEnabled = mState.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user