diff options
author | Roman Birg <roman@cyngn.com> | 2015-07-17 15:18:28 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-03-25 15:36:36 -0700 |
commit | e73c4b9d650164f567bc0880283703991f34af82 (patch) | |
tree | 282580dcc504e923cbb81a4d75e03661d774095a /packages/SystemUI/src/com/android/systemui/ExpandHelper.java | |
parent | 9788452a7f1351c7499551e65ab40cf59d887513 (diff) | |
download | frameworks_base-e73c4b9d650164f567bc0880283703991f34af82.zip frameworks_base-e73c4b9d650164f567bc0880283703991f34af82.tar.gz frameworks_base-e73c4b9d650164f567bc0880283703991f34af82.tar.bz2 |
SystemUI: attach a queue to media player notifications
Extend media player notificatoins to attach a queue below them, set via
the MediaController.setQueue() API, when available.
Long pressing on the notificaiton will reveal an option to disable the
queue.
The queue is currently hardcoded to be limited to 3 items.
Ticket: CYNGNOS-217
Change-Id: I3b8503cb47af2d36f031d06aefc1bfbe7ed80010
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/ExpandHelper.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/ExpandHelper.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java index 1dca149..5911916 100644 --- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java +++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java @@ -36,6 +36,7 @@ import android.view.ViewConfiguration; import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.FlingAnimationUtils; +import com.android.systemui.statusbar.MediaExpandableNotificationRow; import com.android.systemui.statusbar.policy.ScrollAdapter; public class ExpandHelper implements Gefingerpoken { @@ -96,7 +97,7 @@ public class ExpandHelper implements Gefingerpoken { private float mCurrentHeight; private int mSmallSize; - private int mLargeSize; + private int mLargeSize, mInitialLargeSize; private float mMaximumStretch; private boolean mOnlyMovements; @@ -161,6 +162,7 @@ public class ExpandHelper implements Gefingerpoken { mSmallSize = small; mMaximumStretch = mSmallSize * STRETCH_INTERVAL; mLargeSize = large; + mInitialLargeSize = large; mContext = context; mCallback = callback; mScaler = new ViewScaler(); @@ -511,7 +513,14 @@ public class ExpandHelper implements Gefingerpoken { mCurrentHeight = mOldHeight; if (mCallback.canChildBeExpanded(v)) { if (DEBUG) Log.d(TAG, "working on an expandable child"); - mNaturalHeight = mScaler.getNaturalHeight(mLargeSize); + if (v instanceof MediaExpandableNotificationRow) { + final int maxHeight = ((MediaExpandableNotificationRow) v).getMaxContentHeight(); + mLargeSize = maxHeight; + mNaturalHeight = maxHeight; + } else { + mLargeSize = mInitialLargeSize; + mNaturalHeight = mScaler.getNaturalHeight(mLargeSize); + } } else { if (DEBUG) Log.d(TAG, "working on a non-expandable child"); mNaturalHeight = mOldHeight; |