Loading packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -18,4 +18,5 @@ <resources> <item type="id" name="expandable_tag" /> <item type="id" name="user_expanded_tag" /> <item type="id" name="user_lock_tag" /> </resources> packages/SystemUI/src/com/android/systemui/ExpandHelper.java +14 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { View getChildAtRawPosition(float x, float y); View getChildAtPosition(float x, float y); boolean canChildBeExpanded(View v); boolean setUserExpandedChild(View v, boolean userxpanded); boolean setUserExpandedChild(View v, boolean userExpanded); boolean setUserLockedChild(View v, boolean userLocked); } private static final String TAG = "ExpandHelper"; Loading Loading @@ -433,7 +434,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { final int y = (int) ev.getY(); View underPointer = findView(x, y); if (isFinished && underPointer != null && underPointer != mCurrView) { setGlow(0f); finishScale(false); initScale(underPointer); mInitialTouchY = ev.getY(); mHasPopped = false; Loading @@ -458,6 +459,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { private boolean initScale(View v) { if (v != null) { if (DEBUG) Slog.d(TAG, "scale begins on view: " + v); mCallback.setUserLockedChild(v, true); setView(v); setGlow(GLOW_BASE); mScaler.setView(v); Loading @@ -479,21 +481,26 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } private void finishScale(boolean force) { float currentHeight = mScaler.getHeight(); float targetHeight = mSmallSize; float h = mScaler.getHeight(); final boolean wasClosed = (mOldHeight == mSmallSize); if (wasClosed) { h = (force || h > mSmallSize) ? mNaturalHeight : mSmallSize; targetHeight = (force || currentHeight > mSmallSize) ? mNaturalHeight : mSmallSize; } else { h = (force || h < mNaturalHeight) ? mSmallSize : mNaturalHeight; targetHeight = (force || currentHeight < mNaturalHeight) ? mSmallSize : mNaturalHeight; } if (mScaleAnimation.isRunning()) { mScaleAnimation.cancel(); } mScaleAnimation.setFloatValues(h); mScaleAnimation.setupStartValues(); mScaleAnimation.start(); setGlow(0f); mCallback.setUserExpandedChild(mCurrView, h == mNaturalHeight); if (targetHeight != currentHeight) { mScaleAnimation.setFloatValues(targetHeight); mScaleAnimation.setupStartValues(); mScaleAnimation.start(); } mCallback.setUserLockedChild(mCurrView, false); if (DEBUG) Slog.d(TAG, "scale was finished on view: " + mCurrView); } Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +12 −8 Original line number Diff line number Diff line Loading @@ -780,6 +780,7 @@ public abstract class BaseStatusBar extends SystemUI implements int N = mNotificationData.size(); for (int i = 0; i < N; i++) { NotificationData.Entry entry = mNotificationData.get(i); if (!entry.userLocked()) { if (i == (N-1)) { if (DEBUG) Slog.d(TAG, "expanding top notification at " + i); expandView(entry, true); Loading @@ -791,6 +792,9 @@ public abstract class BaseStatusBar extends SystemUI implements if (DEBUG) Slog.d(TAG, "ignoring user-modified notification at " + i); } } } else { if (DEBUG) Slog.d(TAG, "ignoring notification being held by user at " + i); } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +26 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,18 @@ public class NotificationData { public boolean setUserExpanded(boolean userExpanded) { return NotificationData.setUserExpanded(row, userExpanded); } /** * Return whether the entry is being touched by the user. */ public boolean userLocked() { return NotificationData.getUserLocked(row); } /** * Set the flag indicating that this is being touched by the user. */ public boolean setUserLocked(boolean userLocked) { return NotificationData.setUserLocked(row, userLocked); } } private final ArrayList<Entry> mEntries = new ArrayList<Entry>(); private final Comparator<Entry> mEntryCmp = new Comparator<Entry>() { Loading Loading @@ -197,4 +209,18 @@ public class NotificationData { public static boolean setUserExpanded(View row, boolean userExpanded) { return writeBooleanTag(row, R.id.user_expanded_tag, userExpanded); } /** * Return whether the entry is being touched by the user. */ public static boolean getUserLocked(View row) { return readBooleanTag(row, R.id.user_lock_tag); } /** * Set whether the entry is being touched by the user. */ public static boolean setUserLocked(View row, boolean userLocked) { return writeBooleanTag(row, R.id.user_lock_tag, userLocked); } } packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java +4 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,10 @@ public class NotificationRowLayout return NotificationData.setUserExpanded(v, userExpanded); } public boolean setUserLockedChild(View v, boolean userLocked) { return NotificationData.setUserLocked(v, userLocked); } public void onChildDismissed(View v) { final View veto = v.findViewById(R.id.veto); if (veto != null && veto.getVisibility() != View.GONE && mRemoveViews) { Loading Loading
packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -18,4 +18,5 @@ <resources> <item type="id" name="expandable_tag" /> <item type="id" name="user_expanded_tag" /> <item type="id" name="user_lock_tag" /> </resources>
packages/SystemUI/src/com/android/systemui/ExpandHelper.java +14 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,8 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { View getChildAtRawPosition(float x, float y); View getChildAtPosition(float x, float y); boolean canChildBeExpanded(View v); boolean setUserExpandedChild(View v, boolean userxpanded); boolean setUserExpandedChild(View v, boolean userExpanded); boolean setUserLockedChild(View v, boolean userLocked); } private static final String TAG = "ExpandHelper"; Loading Loading @@ -433,7 +434,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { final int y = (int) ev.getY(); View underPointer = findView(x, y); if (isFinished && underPointer != null && underPointer != mCurrView) { setGlow(0f); finishScale(false); initScale(underPointer); mInitialTouchY = ev.getY(); mHasPopped = false; Loading @@ -458,6 +459,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { private boolean initScale(View v) { if (v != null) { if (DEBUG) Slog.d(TAG, "scale begins on view: " + v); mCallback.setUserLockedChild(v, true); setView(v); setGlow(GLOW_BASE); mScaler.setView(v); Loading @@ -479,21 +481,26 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener { } private void finishScale(boolean force) { float currentHeight = mScaler.getHeight(); float targetHeight = mSmallSize; float h = mScaler.getHeight(); final boolean wasClosed = (mOldHeight == mSmallSize); if (wasClosed) { h = (force || h > mSmallSize) ? mNaturalHeight : mSmallSize; targetHeight = (force || currentHeight > mSmallSize) ? mNaturalHeight : mSmallSize; } else { h = (force || h < mNaturalHeight) ? mSmallSize : mNaturalHeight; targetHeight = (force || currentHeight < mNaturalHeight) ? mSmallSize : mNaturalHeight; } if (mScaleAnimation.isRunning()) { mScaleAnimation.cancel(); } mScaleAnimation.setFloatValues(h); mScaleAnimation.setupStartValues(); mScaleAnimation.start(); setGlow(0f); mCallback.setUserExpandedChild(mCurrView, h == mNaturalHeight); if (targetHeight != currentHeight) { mScaleAnimation.setFloatValues(targetHeight); mScaleAnimation.setupStartValues(); mScaleAnimation.start(); } mCallback.setUserLockedChild(mCurrView, false); if (DEBUG) Slog.d(TAG, "scale was finished on view: " + mCurrView); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +12 −8 Original line number Diff line number Diff line Loading @@ -780,6 +780,7 @@ public abstract class BaseStatusBar extends SystemUI implements int N = mNotificationData.size(); for (int i = 0; i < N; i++) { NotificationData.Entry entry = mNotificationData.get(i); if (!entry.userLocked()) { if (i == (N-1)) { if (DEBUG) Slog.d(TAG, "expanding top notification at " + i); expandView(entry, true); Loading @@ -791,6 +792,9 @@ public abstract class BaseStatusBar extends SystemUI implements if (DEBUG) Slog.d(TAG, "ignoring user-modified notification at " + i); } } } else { if (DEBUG) Slog.d(TAG, "ignoring notification being held by user at " + i); } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +26 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,18 @@ public class NotificationData { public boolean setUserExpanded(boolean userExpanded) { return NotificationData.setUserExpanded(row, userExpanded); } /** * Return whether the entry is being touched by the user. */ public boolean userLocked() { return NotificationData.getUserLocked(row); } /** * Set the flag indicating that this is being touched by the user. */ public boolean setUserLocked(boolean userLocked) { return NotificationData.setUserLocked(row, userLocked); } } private final ArrayList<Entry> mEntries = new ArrayList<Entry>(); private final Comparator<Entry> mEntryCmp = new Comparator<Entry>() { Loading Loading @@ -197,4 +209,18 @@ public class NotificationData { public static boolean setUserExpanded(View row, boolean userExpanded) { return writeBooleanTag(row, R.id.user_expanded_tag, userExpanded); } /** * Return whether the entry is being touched by the user. */ public static boolean getUserLocked(View row) { return readBooleanTag(row, R.id.user_lock_tag); } /** * Set whether the entry is being touched by the user. */ public static boolean setUserLocked(View row, boolean userLocked) { return writeBooleanTag(row, R.id.user_lock_tag, userLocked); } }
packages/SystemUI/src/com/android/systemui/statusbar/policy/NotificationRowLayout.java +4 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,10 @@ public class NotificationRowLayout return NotificationData.setUserExpanded(v, userExpanded); } public boolean setUserLockedChild(View v, boolean userLocked) { return NotificationData.setUserLocked(v, userLocked); } public void onChildDismissed(View v) { final View veto = v.findViewById(R.id.veto); if (veto != null && veto.getVisibility() != View.GONE && mRemoveViews) { Loading