Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +19 −6 Original line number Original line Diff line number Diff line Loading @@ -959,7 +959,7 @@ public abstract class BaseStatusBar extends SystemUI implements }, false /* afterKeyguardGone */); }, false /* afterKeyguardGone */); } } private void bindGuts(ExpandableNotificationRow row) { private void bindGuts(final ExpandableNotificationRow row) { row.inflateGuts(); row.inflateGuts(); final StatusBarNotification sbn = row.getStatusBarNotification(); final StatusBarNotification sbn = row.getStatusBarNotification(); PackageManager pmUser = getPackageManagerForUser(mContext, sbn.getUser().getIdentifier()); PackageManager pmUser = getPackageManagerForUser(mContext, sbn.getUser().getIdentifier()); Loading Loading @@ -1003,7 +1003,17 @@ public abstract class BaseStatusBar extends SystemUI implements @Override @Override public void onClick(View v) { public void onClick(View v) { guts.saveImportance(sbn); guts.saveImportance(sbn); dismissPopups(); int[] rowLocation = new int[2]; int[] doneLocation = new int[2]; row.getLocationOnScreen(rowLocation); v.getLocationOnScreen(doneLocation); final int centerX = v.getWidth() / 2; final int centerY = v.getHeight() / 2; final int x = doneLocation[0] - rowLocation[0] + centerX; final int y = doneLocation[1] - rowLocation[1] + centerY; dismissPopups(x, y); } } }); }); Loading Loading @@ -1049,7 +1059,7 @@ public abstract class BaseStatusBar extends SystemUI implements // Post to ensure the the guts are properly laid out. // Post to ensure the the guts are properly laid out. guts.post(new Runnable() { guts.post(new Runnable() { public void run() { public void run() { dismissPopups(); dismissPopups(-1 /* x */, -1 /* y */, false /* resetGear */); guts.setVisibility(View.VISIBLE); guts.setVisibility(View.VISIBLE); final double horz = Math.max(guts.getWidth() - x, x); final double horz = Math.max(guts.getWidth() - x, x); final double vert = Math.max(guts.getHeight() - y, y); final double vert = Math.max(guts.getHeight() - y, y); Loading Loading @@ -1083,10 +1093,14 @@ public abstract class BaseStatusBar extends SystemUI implements } } public void dismissPopups() { public void dismissPopups() { dismissPopups(-1, -1); dismissPopups(-1 /* x */, -1 /* y */, true /* resetGear */); } } private void dismissPopups(int x, int y) { private void dismissPopups(int x, int y) { dismissPopups(x, y, true /* resetGear */); } public void dismissPopups(int x, int y, boolean resetGear) { if (mNotificationGutsExposed != null) { if (mNotificationGutsExposed != null) { final NotificationGuts v = mNotificationGutsExposed; final NotificationGuts v = mNotificationGutsExposed; mNotificationGutsExposed = null; mNotificationGutsExposed = null; Loading Loading @@ -1114,8 +1128,7 @@ public abstract class BaseStatusBar extends SystemUI implements v.setExposed(false); v.setExposed(false); mStackScroller.onHeightChanged(null, true /* needsAnimation */); mStackScroller.onHeightChanged(null, true /* needsAnimation */); } } if (resetGear && mNotificationGearDisplayed != null) { if (mNotificationGearDisplayed != null) { mNotificationGearDisplayed.resetTranslation(); mNotificationGearDisplayed.resetTranslation(); mNotificationGearDisplayed = null; mNotificationGearDisplayed = null; } } Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -656,7 +656,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mGuts = (NotificationGuts) inflated; mGuts = (NotificationGuts) inflated; mGuts.setClipTopAmount(getClipTopAmount()); mGuts.setClipTopAmount(getClipTopAmount()); mGuts.setActualHeight(getActualHeight()); mGuts.setActualHeight(getActualHeight()); mTranslateableViews.add(mGuts); mGutsStub = null; mGutsStub = null; } } }); }); Loading Loading @@ -1175,6 +1174,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override @Override public void setActualHeight(int height, boolean notifyListeners) { public void setActualHeight(int height, boolean notifyListeners) { super.setActualHeight(height, notifyListeners); super.setActualHeight(height, notifyListeners); if (mGuts != null && mGuts.areGutsExposed()) { mGuts.setActualHeight(height); return; } int contentHeight = Math.max(getMinHeight(), height); int contentHeight = Math.max(getMinHeight(), height); mPrivateLayout.setContentHeight(contentHeight); mPrivateLayout.setContentHeight(contentHeight); mPublicLayout.setContentHeight(contentHeight); mPublicLayout.setContentHeight(contentHeight); Loading @@ -1184,7 +1187,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { if (mGuts != null) { if (mGuts != null) { mGuts.setActualHeight(height); mGuts.setActualHeight(height); } } invalidate(); } } @Override @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationSettingsIconRow.java +19 −8 Original line number Original line Diff line number Diff line Loading @@ -33,7 +33,7 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC /** /** * Called when the gear behind a notification is touched. * Called when the gear behind a notification is touched. */ */ public void onGearTouched(ExpandableNotificationRow row); public void onGearTouched(ExpandableNotificationRow row, int x, int y); } } private ExpandableNotificationRow mParent; private ExpandableNotificationRow mParent; Loading @@ -45,6 +45,8 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC private boolean mSettingsFadedIn = false; private boolean mSettingsFadedIn = false; private boolean mAnimating = false; private boolean mAnimating = false; private boolean mOnLeft = true; private boolean mOnLeft = true; private int[] mGearLocation = new int[2]; private int[] mParentLocation = new int[2]; public NotificationSettingsIconRow(Context context) { public NotificationSettingsIconRow(Context context) { this(context, null); this(context, null); Loading Loading @@ -74,6 +76,12 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC resetState(); resetState(); } } public void resetState() { setGearAlpha(0f); mAnimating = false; setIconLocation(true /* on left */); } public void setGearListener(SettingsIconRowListener listener) { public void setGearListener(SettingsIconRowListener listener) { mListener = listener; mListener = listener; } } Loading @@ -86,12 +94,6 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC return mParent; return mParent; } } public void resetState() { setGearAlpha(0f); mAnimating = false; setIconLocation(true /* on left */); } private void setGearAlpha(float alpha) { private void setGearAlpha(float alpha) { if (alpha == 0) { if (alpha == 0) { mSettingsFadedIn = false; // Can fade in again once it's gone. mSettingsFadedIn = false; // Can fade in again once it's gone. Loading Loading @@ -200,7 +202,16 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC public void onClick(View v) { public void onClick(View v) { if (v.getId() == R.id.gear_icon) { if (v.getId() == R.id.gear_icon) { if (mListener != null) { if (mListener != null) { mListener.onGearTouched(mParent); mGearIcon.getLocationOnScreen(mGearLocation); mParent.getLocationOnScreen(mParentLocation); final int centerX = (int) (mHorizSpaceForGear / 2); // Top / bottom padding are not equal, need to subtract them to get center of gear. final int centerY = (int) (mGearIcon.getHeight() - mGearIcon.getPaddingTop() - mGearIcon.getPaddingBottom()) / 2 + mGearIcon.getPaddingTop(); final int x = mGearLocation[0] - mParentLocation[0] + centerX; final int y = mGearLocation[1] - mParentLocation[1] + centerY; mListener.onGearTouched(mParent, x, y); } } } else { } else { // Do nothing when the background is touched. // Do nothing when the background is touched. Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -361,9 +361,9 @@ public class NotificationStackScrollLayout extends ViewGroup } } @Override @Override public void onGearTouched(ExpandableNotificationRow row) { public void onGearTouched(ExpandableNotificationRow row, int x, int y) { if (mLongPressListener != null) { if (mLongPressListener != null) { mLongPressListener.onLongPress(row, 0, 0); mLongPressListener.onLongPress(row, x, y); } } } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +19 −6 Original line number Original line Diff line number Diff line Loading @@ -959,7 +959,7 @@ public abstract class BaseStatusBar extends SystemUI implements }, false /* afterKeyguardGone */); }, false /* afterKeyguardGone */); } } private void bindGuts(ExpandableNotificationRow row) { private void bindGuts(final ExpandableNotificationRow row) { row.inflateGuts(); row.inflateGuts(); final StatusBarNotification sbn = row.getStatusBarNotification(); final StatusBarNotification sbn = row.getStatusBarNotification(); PackageManager pmUser = getPackageManagerForUser(mContext, sbn.getUser().getIdentifier()); PackageManager pmUser = getPackageManagerForUser(mContext, sbn.getUser().getIdentifier()); Loading Loading @@ -1003,7 +1003,17 @@ public abstract class BaseStatusBar extends SystemUI implements @Override @Override public void onClick(View v) { public void onClick(View v) { guts.saveImportance(sbn); guts.saveImportance(sbn); dismissPopups(); int[] rowLocation = new int[2]; int[] doneLocation = new int[2]; row.getLocationOnScreen(rowLocation); v.getLocationOnScreen(doneLocation); final int centerX = v.getWidth() / 2; final int centerY = v.getHeight() / 2; final int x = doneLocation[0] - rowLocation[0] + centerX; final int y = doneLocation[1] - rowLocation[1] + centerY; dismissPopups(x, y); } } }); }); Loading Loading @@ -1049,7 +1059,7 @@ public abstract class BaseStatusBar extends SystemUI implements // Post to ensure the the guts are properly laid out. // Post to ensure the the guts are properly laid out. guts.post(new Runnable() { guts.post(new Runnable() { public void run() { public void run() { dismissPopups(); dismissPopups(-1 /* x */, -1 /* y */, false /* resetGear */); guts.setVisibility(View.VISIBLE); guts.setVisibility(View.VISIBLE); final double horz = Math.max(guts.getWidth() - x, x); final double horz = Math.max(guts.getWidth() - x, x); final double vert = Math.max(guts.getHeight() - y, y); final double vert = Math.max(guts.getHeight() - y, y); Loading Loading @@ -1083,10 +1093,14 @@ public abstract class BaseStatusBar extends SystemUI implements } } public void dismissPopups() { public void dismissPopups() { dismissPopups(-1, -1); dismissPopups(-1 /* x */, -1 /* y */, true /* resetGear */); } } private void dismissPopups(int x, int y) { private void dismissPopups(int x, int y) { dismissPopups(x, y, true /* resetGear */); } public void dismissPopups(int x, int y, boolean resetGear) { if (mNotificationGutsExposed != null) { if (mNotificationGutsExposed != null) { final NotificationGuts v = mNotificationGutsExposed; final NotificationGuts v = mNotificationGutsExposed; mNotificationGutsExposed = null; mNotificationGutsExposed = null; Loading Loading @@ -1114,8 +1128,7 @@ public abstract class BaseStatusBar extends SystemUI implements v.setExposed(false); v.setExposed(false); mStackScroller.onHeightChanged(null, true /* needsAnimation */); mStackScroller.onHeightChanged(null, true /* needsAnimation */); } } if (resetGear && mNotificationGearDisplayed != null) { if (mNotificationGearDisplayed != null) { mNotificationGearDisplayed.resetTranslation(); mNotificationGearDisplayed.resetTranslation(); mNotificationGearDisplayed = null; mNotificationGearDisplayed = null; } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -656,7 +656,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mGuts = (NotificationGuts) inflated; mGuts = (NotificationGuts) inflated; mGuts.setClipTopAmount(getClipTopAmount()); mGuts.setClipTopAmount(getClipTopAmount()); mGuts.setActualHeight(getActualHeight()); mGuts.setActualHeight(getActualHeight()); mTranslateableViews.add(mGuts); mGutsStub = null; mGutsStub = null; } } }); }); Loading Loading @@ -1175,6 +1174,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { @Override @Override public void setActualHeight(int height, boolean notifyListeners) { public void setActualHeight(int height, boolean notifyListeners) { super.setActualHeight(height, notifyListeners); super.setActualHeight(height, notifyListeners); if (mGuts != null && mGuts.areGutsExposed()) { mGuts.setActualHeight(height); return; } int contentHeight = Math.max(getMinHeight(), height); int contentHeight = Math.max(getMinHeight(), height); mPrivateLayout.setContentHeight(contentHeight); mPrivateLayout.setContentHeight(contentHeight); mPublicLayout.setContentHeight(contentHeight); mPublicLayout.setContentHeight(contentHeight); Loading @@ -1184,7 +1187,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { if (mGuts != null) { if (mGuts != null) { mGuts.setActualHeight(height); mGuts.setActualHeight(height); } } invalidate(); } } @Override @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationSettingsIconRow.java +19 −8 Original line number Original line Diff line number Diff line Loading @@ -33,7 +33,7 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC /** /** * Called when the gear behind a notification is touched. * Called when the gear behind a notification is touched. */ */ public void onGearTouched(ExpandableNotificationRow row); public void onGearTouched(ExpandableNotificationRow row, int x, int y); } } private ExpandableNotificationRow mParent; private ExpandableNotificationRow mParent; Loading @@ -45,6 +45,8 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC private boolean mSettingsFadedIn = false; private boolean mSettingsFadedIn = false; private boolean mAnimating = false; private boolean mAnimating = false; private boolean mOnLeft = true; private boolean mOnLeft = true; private int[] mGearLocation = new int[2]; private int[] mParentLocation = new int[2]; public NotificationSettingsIconRow(Context context) { public NotificationSettingsIconRow(Context context) { this(context, null); this(context, null); Loading Loading @@ -74,6 +76,12 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC resetState(); resetState(); } } public void resetState() { setGearAlpha(0f); mAnimating = false; setIconLocation(true /* on left */); } public void setGearListener(SettingsIconRowListener listener) { public void setGearListener(SettingsIconRowListener listener) { mListener = listener; mListener = listener; } } Loading @@ -86,12 +94,6 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC return mParent; return mParent; } } public void resetState() { setGearAlpha(0f); mAnimating = false; setIconLocation(true /* on left */); } private void setGearAlpha(float alpha) { private void setGearAlpha(float alpha) { if (alpha == 0) { if (alpha == 0) { mSettingsFadedIn = false; // Can fade in again once it's gone. mSettingsFadedIn = false; // Can fade in again once it's gone. Loading Loading @@ -200,7 +202,16 @@ public class NotificationSettingsIconRow extends FrameLayout implements View.OnC public void onClick(View v) { public void onClick(View v) { if (v.getId() == R.id.gear_icon) { if (v.getId() == R.id.gear_icon) { if (mListener != null) { if (mListener != null) { mListener.onGearTouched(mParent); mGearIcon.getLocationOnScreen(mGearLocation); mParent.getLocationOnScreen(mParentLocation); final int centerX = (int) (mHorizSpaceForGear / 2); // Top / bottom padding are not equal, need to subtract them to get center of gear. final int centerY = (int) (mGearIcon.getHeight() - mGearIcon.getPaddingTop() - mGearIcon.getPaddingBottom()) / 2 + mGearIcon.getPaddingTop(); final int x = mGearLocation[0] - mParentLocation[0] + centerX; final int y = mGearLocation[1] - mParentLocation[1] + centerY; mListener.onGearTouched(mParent, x, y); } } } else { } else { // Do nothing when the background is touched. // Do nothing when the background is touched. Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -361,9 +361,9 @@ public class NotificationStackScrollLayout extends ViewGroup } } @Override @Override public void onGearTouched(ExpandableNotificationRow row) { public void onGearTouched(ExpandableNotificationRow row, int x, int y) { if (mLongPressListener != null) { if (mLongPressListener != null) { mLongPressListener.onLongPress(row, 0, 0); mLongPressListener.onLongPress(row, x, y); } } } } Loading