summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2016-01-19 16:38:02 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-01-25 14:19:19 -0800
commit1a99a4a44b776b033643197ac1bfa953875e517d (patch)
treedd46a30cf04cc1d98812e6d1bdd5b58e2846ce87 /packages
parent5a3c86f96b9f317993fefe8f1f68c155b5651d45 (diff)
downloadframeworks_base-1a99a4a44b776b033643197ac1bfa953875e517d.zip
frameworks_base-1a99a4a44b776b033643197ac1bfa953875e517d.tar.gz
frameworks_base-1a99a4a44b776b033643197ac1bfa953875e517d.tar.bz2
SystemUI: handle when brightness slider is hidden
With this patch, the quick settings area should automatically expand and make room for the tile trashcan/instruction area when the user has the brightness slider hidden. Also adds a scrollview to the QS Settings page to allow the list to grow without impacting the height of the qs panel. Ref: CYNGNOS-1644 Change-Id: I03f552ec28a978c4cad1e7e7a52648ec3d311a07 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/layout/qs_settings.xml114
-rw-r--r--packages/SystemUI/res/layout/qs_tile_top.xml6
-rw-r--r--packages/SystemUI/res/values/cm_strings.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java38
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPage.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanelTopView.java124
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSSettings.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSViewPager.java31
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java1
10 files changed, 200 insertions, 143 deletions
diff --git a/packages/SystemUI/res/layout/qs_settings.xml b/packages/SystemUI/res/layout/qs_settings.xml
index dcf04a4..b7c8d60 100644
--- a/packages/SystemUI/res/layout/qs_settings.xml
+++ b/packages/SystemUI/res/layout/qs_settings.xml
@@ -18,67 +18,79 @@
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:id="@+id/quick_settings_settings_recursion_container"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="16dp"
+ android:layout_height="match_parent"
android:orientation="vertical">
- <TextView
+ <LinearLayout
android:layout_width="match_parent"
- android:layout_height="48dp"
- android:paddingLeft="16dp"
- android:paddingRight="16dp"
- android:gravity="center_vertical"
- android:textColor="@color/qs_title_text_color"
- android:text="@string/quick_settings_title_header"/>
-
- <!-- show weather -->
- <com.android.systemui.qs.QSBooleanSettingRow
- style="@style/SettingRow"
- android:key="status_bar_show_weather"
- android:title="@string/quick_settings_title_show_weather"
- systemui:defaultValue="1"
- systemui:table="cm_system"
- />
+ android:layout_height="match_parent"
+ android:orientation="vertical">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="48dp"
- android:paddingLeft="16dp"
- android:paddingRight="16dp"
- android:gravity="center_vertical"
- android:textColor="@color/qs_title_text_color"
- android:text="@string/quick_settings_title_tiles"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:gravity="center_vertical"
+ android:textColor="@color/qs_title_text_color"
+ android:text="@string/quick_settings_title_header"/>
- <!-- first row large -->
- <com.android.systemui.qs.QSBooleanSettingRow
- style="@style/SettingRow"
- android:title="@string/quick_settings_title_enlarge_first_row"
- android:key="sysui_qs_main_tiles"
- systemui:defaultValue="1"
- systemui:table="cm_secure" />
+ <!-- show weather -->
+ <com.android.systemui.qs.QSBooleanSettingRow
+ style="@style/SettingRow"
+ android:key="status_bar_show_weather"
+ android:title="@string/quick_settings_title_show_weather"
+ systemui:defaultValue="1"
+ systemui:table="cm_system"/>
- <com.android.systemui.qs.QSBooleanSettingRow
- style="@style/SettingRow"
- android:title="@string/quick_settings_title_advanced_location"
- android:key="qs_location_advanced"
- systemui:defaultValue="0"
- systemui:table="cm_secure" />
+ <!-- brightness slider -->
+ <com.android.systemui.qs.QSBooleanSettingRow
+ style="@style/SettingRow"
+ android:key="qs_show_brightness_slider"
+ android:title="@string/quick_settings_title_show_brightness_slider"
+ systemui:defaultValue="1"
+ systemui:table="cm_system"/>
- <LinearLayout
- android:id="@+id/reset_tiles"
- style="@style/SettingRow">
<TextView
- android:layout_width="0dp"
- android:layout_height="24dp"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
android:gravity="center_vertical"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:id="@+id/title"
- android:textColor="@color/qs_tile_reset_to_default_text_color"
- android:text="@string/quick_settings_tile_reset_to_default"
- android:contentDescription="@null"/>
+ android:textColor="@color/qs_title_text_color"
+ android:text="@string/quick_settings_title_tiles"/>
- </LinearLayout>
+ <!-- first row large -->
+ <com.android.systemui.qs.QSBooleanSettingRow
+ style="@style/SettingRow"
+ android:title="@string/quick_settings_title_enlarge_first_row"
+ android:key="sysui_qs_main_tiles"
+ systemui:defaultValue="1"
+ systemui:table="cm_secure"/>
+
+ <com.android.systemui.qs.QSBooleanSettingRow
+ style="@style/SettingRow"
+ android:title="@string/quick_settings_title_advanced_location"
+ android:key="qs_location_advanced"
+ systemui:defaultValue="0"
+ systemui:table="cm_secure"/>
+
+ <LinearLayout
+ android:id="@+id/reset_tiles"
+ style="@style/SettingRow">
+ <TextView
+ android:layout_width="0dp"
+ android:layout_height="24dp"
+ android:gravity="center_vertical"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:id="@+id/title"
+ android:textColor="@color/qs_tile_reset_to_default_text_color"
+ android:text="@string/quick_settings_tile_reset_to_default"
+ android:contentDescription="@null"/>
+ </LinearLayout>
+
+ </LinearLayout>
</com.android.systemui.qs.QSSettings>
diff --git a/packages/SystemUI/res/layout/qs_tile_top.xml b/packages/SystemUI/res/layout/qs_tile_top.xml
index 4413ec3..a302c73 100644
--- a/packages/SystemUI/res/layout/qs_tile_top.xml
+++ b/packages/SystemUI/res/layout/qs_tile_top.xml
@@ -29,7 +29,7 @@
<LinearLayout
android:id="@+id/delete_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="horizontal">
@@ -48,7 +48,7 @@
<LinearLayout
android:id="@+id/edit_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="horizontal">
@@ -73,7 +73,7 @@
<TextView
android:id="@+id/qs_toast"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_vertical"
diff --git a/packages/SystemUI/res/values/cm_strings.xml b/packages/SystemUI/res/values/cm_strings.xml
index 40aca087..86b87e4 100644
--- a/packages/SystemUI/res/values/cm_strings.xml
+++ b/packages/SystemUI/res/values/cm_strings.xml
@@ -89,6 +89,7 @@
<string name="quick_settings_title_header">Header</string>
<string name="quick_settings_title_tiles">Tiles</string>
<string name="quick_settings_title_show_weather">Show weather</string>
+ <string name="quick_settings_title_show_brightness_slider">Show brightness slider</string>
<string name="quick_settings_title_enlarge_first_row">Enlarge first row</string>
<!-- Screen pinning dialog description (for devices without navbar) -->
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
index 9f2a60e..397bd69 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
@@ -375,6 +375,7 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
r.tile.setListening(mListening);
}
mFooter.setListening(mListening);
+ mQsPanelTop.setListening(mListening);
if (mListening) {
refreshAllTiles();
}
@@ -728,13 +729,6 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
mHost.remove(spec);
}
- public void ensurePagerState() {
- if (!isShowingDetail()) {
- final boolean pagingEnabled = getVisibleTilePageCount() > 1 || mDragging || mEditing;
- mViewPager.setPagingEnabled(pagingEnabled);
- }
- }
-
public int getTilesPerPage(boolean firstPage) {
if ((!mFirstRowLarge && firstPage) || !firstPage) {
return QSTileHost.TILES_PER_PAGE + 1;
@@ -853,12 +847,10 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
if (!isShowingDetail() && !isClosingDetail()) {
mQsPanelTop.bringToFront();
}
-
- ensurePagerState();
}
protected int getRowTop(int row) {
- int baseHeight = mBrightnessView.getMeasuredHeight();
+ int baseHeight = mQsPanelTop.getMeasuredHeight();
if (row <= 0) return baseHeight;
return baseHeight + mLargeCellHeight - mDualTileUnderlap + (row - 1) * mCellHeight;
}
@@ -1727,22 +1719,6 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
}
}
- @Override
- protected void setGridContentVisibility(boolean visible) {
- int newVis = visible ? VISIBLE : INVISIBLE;
- for (int i = 0; i < mRecords.size(); i++) {
- TileRecord tileRecord = mRecords.get(i);
- if (tileRecord.tileView.getVisibility() != GONE) {
- tileRecord.tileView.setVisibility(newVis);
- }
- }
- mQsPanelTop.setVisibility(showBrightnessSlider() ? newVis : GONE);
- if (mGridContentVisible != visible) {
- MetricsLogger.visibility(mContext, MetricsLogger.QS_PANEL, newVis);
- }
- mGridContentVisible = visible;
- }
-
public void updateResources() {
final Resources res = mContext.getResources();
final int columns = Math.max(1, res.getInteger(R.integer.quick_settings_num_columns));
@@ -1773,6 +1749,12 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
return mCurrentlyAnimating.contains(t);
}
+ public void cleanup() {
+ if (mSettingsObserver != null) {
+ mSettingsObserver.unobserve();
+ }
+ }
+
public static class TilesListAdapter extends BaseExpandableListAdapter
implements QSTile.DetailAdapter {
@@ -2106,6 +2088,10 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
return mRecords.indexOf(mDraggingRecord) >= 0;
}
+ public boolean isOnSettingsPage() {
+ return mEditing && mViewPager.getCurrentItem() == 0;
+ }
+
public void goToSettingsPage() {
if (mEditing) {
mViewPager.setCurrentItem(0, true);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPage.java b/packages/SystemUI/src/com/android/systemui/qs/QSPage.java
index 57b559e..b06ad35 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPage.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPage.java
@@ -97,7 +97,7 @@ public class QSPage extends ViewGroup {
record.tileView.measure(exactly(cw), exactly(ch));
previousView = record.tileView.updateAccessibilityOrder(previousView);
}
- setMeasuredDimension(width, exactly(mGridHeight));
+ setMeasuredDimension(width, mGridHeight);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelTopView.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelTopView.java
index bfff5f2..900f87d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelTopView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelTopView.java
@@ -20,7 +20,11 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.Nullable;
+import android.app.ActivityManager;
+import android.content.ContentResolver;
import android.content.Context;
+import android.os.Handler;
+import android.os.UserHandle;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.AttributeSet;
import android.util.Log;
@@ -29,6 +33,8 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.systemui.R;
+import com.android.systemui.cm.UserContentObserver;
+import cyanogenmod.providers.CMSettings;
public class QSPanelTopView extends FrameLayout {
@@ -46,10 +52,14 @@ public class QSPanelTopView extends FrameLayout {
private boolean mDisplayingInstructions = false;
private boolean mDisplayingTrash = false;
private boolean mDisplayingToast = false;
+ public boolean mHasBrightnessSliderToDisplay = true;
private AnimatorSet mAnimator;
private ImageView mDropTargetIcon;
+ private SettingsObserver mSettingsObserver;
+ private boolean mListening;
+
public QSPanelTopView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
@@ -62,6 +72,7 @@ public class QSPanelTopView extends FrameLayout {
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
setFocusable(true);
+ mSettingsObserver = new SettingsObserver(new Handler());
}
@Override
@@ -100,13 +111,19 @@ public class QSPanelTopView extends FrameLayout {
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int width = MeasureSpec.getSize(widthMeasureSpec);
mBrightnessView.measure(QSDragPanel.exactly(width), MeasureSpec.UNSPECIFIED);
- int dh = mBrightnessView.getMeasuredHeight();
+ mEditTileInstructionView.measure(QSDragPanel.exactly(width), MeasureSpec.UNSPECIFIED);
+ mToastView.measure(QSDragPanel.exactly(width), MeasureSpec.UNSPECIFIED);
+
+ // if we are showing a brightness slider, always fit to that, otherwise only
+ // declare a height when editing.
+ int dh = mHasBrightnessSliderToDisplay ? mBrightnessView.getMeasuredHeight()
+ : mEditing ? mEditTileInstructionView.getMeasuredHeight() : 0;
mDropTarget.measure(QSDragPanel.exactly(width), QSDragPanel.atMost(dh));
mEditTileInstructionView.measure(QSDragPanel.exactly(width), QSDragPanel.atMost(dh));
mToastView.measure(QSDragPanel.exactly(width), QSDragPanel.atMost(dh));
- setMeasuredDimension(width, QSDragPanel.exactly(mBrightnessView.getMeasuredHeight()));
+ setMeasuredDimension(width, dh);
}
@Override
@@ -178,38 +195,36 @@ public class QSPanelTopView extends FrameLayout {
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- setLayerType(LAYER_TYPE_HARDWARE, null);
-
- mDropTarget.setLayerType(LAYER_TYPE_HARDWARE, null);
- mEditTileInstructionView.setLayerType(LAYER_TYPE_HARDWARE, null);
- mBrightnessView.setLayerType(LAYER_TYPE_HARDWARE, null);
- mToastView.setLayerType(LAYER_TYPE_HARDWARE, null);
-
- mDropTarget.setVisibility(View.VISIBLE);
- mEditTileInstructionView.setVisibility(View.VISIBLE);
- mBrightnessView.setVisibility(View.VISIBLE);
- mToastView.setVisibility(View.VISIBLE);
-
- if (showToast) {
- mToastView.bringToFront();
+ // if the view is already visible, keep it visible on animation start
+ // to animate it out, otherwise set it as invisible (to not affect view height)
+ mEditTileInstructionView.setVisibility(
+ getVisibilityForAnimation(mEditTileInstructionView, showInstructions));
+ mDropTarget.setVisibility(
+ getVisibilityForAnimation(mDropTarget, showTrash));
+ mToastView.setVisibility(
+ getVisibilityForAnimation(mToastView, showToast));
+ if (mHasBrightnessSliderToDisplay) {
+ mBrightnessView.setVisibility(
+ getVisibilityForAnimation(mBrightnessView, showBrightness));
}
}
@Override
public void onAnimationEnd(Animator animation) {
mToastView.setVisibility(showToast ? View.VISIBLE : View.GONE);
- mEditTileInstructionView.setVisibility(showInstructions ? View.VISIBLE : View.GONE);
+ mEditTileInstructionView.setVisibility(showInstructions
+ ? View.VISIBLE : View.GONE);
mDropTarget.setVisibility(showTrash ? View.VISIBLE : View.GONE);
- mBrightnessView.setVisibility(showBrightness ? View.VISIBLE : View.GONE);
+ if (mHasBrightnessSliderToDisplay) {
+ mBrightnessView.setVisibility(showBrightness ? View.VISIBLE : View.GONE);
+ }
- setLayerType(LAYER_TYPE_NONE, null);
+ mAnimator = null;
- mDropTarget.setLayerType(LAYER_TYPE_NONE, null);
- mEditTileInstructionView.setLayerType(LAYER_TYPE_NONE, null);
- mBrightnessView.setLayerType(LAYER_TYPE_NONE, null);
- mToastView.setLayerType(LAYER_TYPE_NONE, null);
+ requestLayout();
if (showToast) {
+ mToastView.bringToFront();
mToastView.postDelayed(new Runnable() {
@Override
public void run() {
@@ -230,12 +245,19 @@ public class QSPanelTopView extends FrameLayout {
}
};
+ private int getVisibilityForAnimation(View view, boolean show) {
+ if (show || view.getVisibility() != View.GONE) {
+ return View.VISIBLE;
+ }
+ return View.INVISIBLE;
+ }
+
private void animateToState() {
post(mAnimateRunnable);
}
+
private Animator animateView(View v, boolean show) {
- return ObjectAnimator.ofFloat(v, "translationY",
- show ? 0 : -mBrightnessView.getMeasuredHeight());
+ return ObjectAnimator.ofFloat(v, "translationY", show ? 0 : -getMeasuredHeight());
}
private Animator showBrightnessSlider(boolean show) {
@@ -253,4 +275,56 @@ public class QSPanelTopView extends FrameLayout {
private Animator showToast(boolean show) {
return animateView(mToastView, show);
}
+
+ public void setListening(boolean listening) {
+ if (mListening == listening) return;
+ mListening = listening;
+ if (mListening) {
+ mSettingsObserver.observe();
+ } else {
+ mSettingsObserver.unobserve();
+ }
+
+ }
+
+ class SettingsObserver extends UserContentObserver {
+ SettingsObserver(Handler handler) {
+ super(handler);
+ }
+
+ @Override
+ protected void observe() {
+ super.observe();
+
+ ContentResolver resolver = mContext.getContentResolver();
+ resolver.registerContentObserver(CMSettings.System.getUriFor(
+ CMSettings.System.QS_SHOW_BRIGHTNESS_SLIDER), false, this, UserHandle.USER_ALL);
+ update();
+ }
+
+ @Override
+ protected void unobserve() {
+ super.unobserve();
+
+ ContentResolver resolver = mContext.getContentResolver();
+ resolver.unregisterContentObserver(this);
+ }
+
+ @Override
+ public void update() {
+ ContentResolver resolver = mContext.getContentResolver();
+ int currentUserId = ActivityManager.getCurrentUser();
+ boolean showSlider = CMSettings.System.getIntForUser(resolver,
+ CMSettings.System.QS_SHOW_BRIGHTNESS_SLIDER, 1, currentUserId) == 1;
+ if (showSlider != mHasBrightnessSliderToDisplay) {
+ mHasBrightnessSliderToDisplay = showSlider;
+ if (mAnimator == null && mBrightnessView != null) {
+ // no animations, set the visibility manually
+ mBrightnessView.setVisibility(showSlider ? View.VISIBLE : View.GONE);
+ }
+ requestLayout();
+ animateToState();
+ }
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSSettings.java b/packages/SystemUI/src/com/android/systemui/qs/QSSettings.java
index d90c991..7766ca4 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSSettings.java
@@ -20,23 +20,25 @@ import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.util.AttributeSet;
+import android.util.Log;
+import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
+import android.widget.ScrollView;
+
import com.android.systemui.R;
import com.android.systemui.statusbar.phone.QSTileHost;
import com.android.systemui.statusbar.phone.SystemUIDialog;
-public class QSSettings extends LinearLayout {
+public class QSSettings extends ScrollView {
+
private QSTileHost mHost;
private boolean mAdapterEditingState;
- public QSSettings(Context context) {
- super(context);
- }
-
public QSSettings(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
+ setFillViewport(true);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSViewPager.java b/packages/SystemUI/src/com/android/systemui/qs/QSViewPager.java
index 01c48b1..3dc5d27 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSViewPager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSViewPager.java
@@ -14,7 +14,7 @@ public class QSViewPager extends ViewPager {
private static final String TAG = "QSViewPager";
protected static final float SCROLL_PERCENT = .10f;
- private boolean mPagingEnabled;
+
QSDragPanel mDragPanel;
public QSViewPager(Context context) {
@@ -34,7 +34,6 @@ public class QSViewPager extends ViewPager {
public boolean canScrollHorizontally(int direction) {
if (direction < 0
&& mDragPanel.isDragging()
- && mPagingEnabled
&& getCurrentItem() == 1) {
// can't scroll left while not editing, OR dragging on the first page
return false;
@@ -49,7 +48,7 @@ public class QSViewPager extends ViewPager {
View child = getChildAt(i);
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
int h = child.getMeasuredHeight();
- if (h > height) height = h;
+ if (h > height && !(child instanceof QSSettings)) height = h;
}
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
@@ -103,30 +102,4 @@ public class QSViewPager extends ViewPager {
Log.e(TAG, "can't start fake drag?");
}
}
-
- @Override
- public boolean onInterceptTouchEvent(MotionEvent event) {
- if (mPagingEnabled) {
- return super.onInterceptTouchEvent(event);
- }
- return false;
- }
-
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- if (mPagingEnabled) {
- return super.onTouchEvent(event);
- }
- return false;
- }
-
- public void setPagingEnabled(boolean enabled) {
- if (mPagingEnabled == enabled) return;
- mPagingEnabled = enabled;
- //Log.i(TAG, "setPagingEnabled() called with " + "enabled = [" + enabled + "]");
- if (getCurrentItem() > 0 && !mPagingEnabled) {
- //Log.w(TAG, "resetting to item 0 because paging is disabled.");
- setCurrentItem(0, true);
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index eedfe05..ce464b9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -63,7 +63,7 @@ import com.android.systemui.EventLogConstants;
import com.android.systemui.EventLogTags;
import com.android.systemui.R;
import com.android.systemui.qs.QSContainer;
-import com.android.systemui.qs.QSPanel;
+import com.android.systemui.qs.QSDragPanel;
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.ExpandableView;
import com.android.systemui.statusbar.FlingAnimationUtils;
@@ -119,7 +119,7 @@ public class NotificationPanelView extends PanelView implements
private KeyguardUserSwitcher mKeyguardUserSwitcher;
private KeyguardStatusBarView mKeyguardStatusBar;
private QSContainer mQsContainer;
- private QSPanel mQsPanel;
+ private QSDragPanel mQsPanel;
private KeyguardStatusView mKeyguardStatusView;
private ObservableScrollView mScrollView;
private TextView mClockView;
@@ -281,7 +281,7 @@ public class NotificationPanelView extends PanelView implements
mKeyguardStatusBar = (KeyguardStatusBarView) findViewById(R.id.keyguard_header);
mKeyguardStatusView = (KeyguardStatusView) findViewById(R.id.keyguard_status_view);
mQsContainer = (QSContainer) findViewById(R.id.quick_settings_container);
- mQsPanel = (QSPanel) findViewById(R.id.quick_settings_panel);
+ mQsPanel = (QSDragPanel) findViewById(R.id.quick_settings_panel);
mClockView = (TextView) findViewById(R.id.clock_view);
mScrollView = (ObservableScrollView) findViewById(R.id.scroll_view);
mScrollView.setFocusable(false);
@@ -628,6 +628,14 @@ public class NotificationPanelView extends PanelView implements
MetricsLogger.count(mContext, COUNTER_PANEL_OPEN_PEEK, 1);
return true;
}
+ if (mQsPanel.isOnSettingsPage() && isInQsArea(event.getX(), event.getY())
+ && mQsExpanded) {
+ mIntercepting = false;
+ // we explicitly do not intercept the touch event here to let the qs settings page
+ // scroll as necessary while not blocking horizontal swipes and allowing the panel
+ // to be collapsed when grabbed below the qs settings page as well.
+ return false;
+ }
if (!isFullyCollapsed() && onQsIntercept(event)) {
return true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 29dacb5..f86f615 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -3736,6 +3736,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mQSPanel.getHost().setCustomTileListenerService(null);
mQSPanel.setTiles(new ArrayList<QSTile<?>>());
+ mQSPanel.setListening(false);
makeStatusBarView();
repositionNavigationBar();