summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorAlexander Toresson <alexander.toresson@sonymobile.com>2015-12-14 16:10:04 +0100
committerDanesh M <daneshm90@gmail.com>2016-03-09 12:29:58 -0800
commitc5328681aa6cc2740d5a85b49e0674ab309b8aeb (patch)
tree94f1db1dfc6c21f1a1add957361befc4171429dd /packages/SystemUI/src
parent15b3922aaa44513127d4d0edcbc0080725daf4fd (diff)
downloadframeworks_base-c5328681aa6cc2740d5a85b49e0674ab309b8aeb.zip
frameworks_base-c5328681aa6cc2740d5a85b49e0674ab309b8aeb.tar.gz
frameworks_base-c5328681aa6cc2740d5a85b49e0674ab309b8aeb.tar.bz2
Fix volume expand arrow to be displayed correctly
Sometimes, the volume control expand arrow would be displayed incorrectly. When different apps use different volume controls and force different orientations, the position of the arrow (expand button) will not be updated correctly. When this happens the arrow cannot be pressed and the volume settings cannot be expanded. The underlying reason is that onLayoutChange only compares the old dimensions of a view with the new dimensions, which doesn't take into account that the last time onLayoutChange was run it may have been run for a different view (a different volume control), in which case the dimensions of the new view may not have changed, but the arrow needs to be repositioned anyway as it needs to be positioned in relation to another view. Fix this problem by storing the last stream (volume control) that the arrow was positioned in relation to, and checking if we're positioning in relation to the same stream the next time the position of the arrow is updated. Change-Id: Id23e7605d50857292e09c1909b3e27f01bdf5e22
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
index 7c3392e..27c6601 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
@@ -130,6 +130,7 @@ public class VolumeDialog {
private boolean mPendingStateChanged;
private boolean mPendingRecheckAll;
private long mCollapseTime;
+ private int mLastActiveStream;
public VolumeDialog(Context context, int windowType, VolumeDialogController controller,
ZenModeController zenModeController, Callback callback) {
@@ -275,10 +276,14 @@ public class VolumeDialog {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
- final boolean moved = oldLeft != left || oldTop != top;
+ final boolean moved = mLastActiveStream != mActiveStream ||
+ oldLeft != left || oldTop != top;
if (D.BUG) Log.d(TAG, "onLayoutChange moved=" + moved
+ " old=" + new Rect(oldLeft, oldTop, oldRight, oldBottom).toShortString()
- + " new=" + new Rect(left,top,right,bottom).toShortString());
+ + "," + mLastActiveStream
+ + " new=" + new Rect(left,top,right,bottom).toShortString()
+ + "," + mActiveStream);
+ mLastActiveStream = mActiveStream;
if (moved) {
for (int i = 0; i < mDialogContentView.getChildCount(); i++) {
final View c = mDialogContentView.getChildAt(i);