From 9a352b60553ee4270fb4240b30ccf6d36f568c75 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 11 May 2017 15:24:13 -0700 Subject: [PATCH] Updating expand icon asset. Bug: 38237934 Test: Launch activity in PIP, tap to show expand icon Change-Id: Icae85ff27accd1e2143836541587e3bedc17570b --- packages/SystemUI/res/drawable/pip_expand.xml | 29 ++++++++++++++ .../SystemUI/res/drawable/pip_expand_ll.xml | 34 ---------------- .../SystemUI/res/drawable/pip_expand_lr.xml | 39 ------------------- .../SystemUI/res/drawable/pip_expand_pl.xml | 39 ------------------- .../SystemUI/res/drawable/pip_expand_pr.xml | 38 ------------------ .../SystemUI/res/layout/pip_menu_activity.xml | 2 + packages/SystemUI/res/values/dimens.xml | 2 +- .../systemui/pip/phone/PipMenuActivity.java | 19 --------- .../systemui/pip/tv/PipNotification.java | 3 +- 9 files changed, 33 insertions(+), 172 deletions(-) create mode 100644 packages/SystemUI/res/drawable/pip_expand.xml delete mode 100644 packages/SystemUI/res/drawable/pip_expand_ll.xml delete mode 100644 packages/SystemUI/res/drawable/pip_expand_lr.xml delete mode 100644 packages/SystemUI/res/drawable/pip_expand_pl.xml delete mode 100644 packages/SystemUI/res/drawable/pip_expand_pr.xml diff --git a/packages/SystemUI/res/drawable/pip_expand.xml b/packages/SystemUI/res/drawable/pip_expand.xml new file mode 100644 index 0000000000000..cdb2ee50482f9 --- /dev/null +++ b/packages/SystemUI/res/drawable/pip_expand.xml @@ -0,0 +1,29 @@ + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/pip_expand_ll.xml b/packages/SystemUI/res/drawable/pip_expand_ll.xml deleted file mode 100644 index a8b82b5846556..0000000000000 --- a/packages/SystemUI/res/drawable/pip_expand_ll.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/pip_expand_lr.xml b/packages/SystemUI/res/drawable/pip_expand_lr.xml deleted file mode 100644 index 44d97ef346f3f..0000000000000 --- a/packages/SystemUI/res/drawable/pip_expand_lr.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/pip_expand_pl.xml b/packages/SystemUI/res/drawable/pip_expand_pl.xml deleted file mode 100644 index 57b93581f4ba1..0000000000000 --- a/packages/SystemUI/res/drawable/pip_expand_pl.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/pip_expand_pr.xml b/packages/SystemUI/res/drawable/pip_expand_pr.xml deleted file mode 100644 index e34a95d257ac8..0000000000000 --- a/packages/SystemUI/res/drawable/pip_expand_pr.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/layout/pip_menu_activity.xml b/packages/SystemUI/res/layout/pip_menu_activity.xml index 8c66babd8a7f5..8b7f6926c9f7c 100644 --- a/packages/SystemUI/res/layout/pip_menu_activity.xml +++ b/packages/SystemUI/res/layout/pip_menu_activity.xml @@ -38,6 +38,8 @@ android:layout_height="60dp" android:layout_gravity="center" android:contentDescription="@string/pip_phone_expand" + android:padding="10dp" + android:src="@drawable/pip_expand" android:background="?android:selectableItemBackgroundBorderless" /> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index c00b562e0936c..6604b6cd79c34 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -768,7 +768,7 @@ - 36dp + 30dp 18dp 18dp diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index 65f24cf5ba983..766914c5a99a9 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -303,7 +303,6 @@ public class PipMenuActivity extends Activity { mMenuContainerAnimator.cancel(); } notifyMenuStateChange(menuState); - updateExpandButtonFromBounds(stackBounds, movementBounds); mMenuContainerAnimator = new AnimatorSet(); ObjectAnimator menuAnim = ObjectAnimator.ofFloat(mMenuContainer, View.ALPHA, mMenuContainer.getAlpha(), 1f); @@ -388,24 +387,6 @@ public class PipMenuActivity extends Activity { } } - private void updateExpandButtonFromBounds(Rect stackBounds, Rect movementBounds) { - if (stackBounds == null) { - return; - } - - boolean isLandscapePip = stackBounds.width() > stackBounds.height(); - boolean left = stackBounds.left < movementBounds.centerX(); - boolean top = stackBounds.top < movementBounds.centerY(); - boolean expandL = (left && top) || (!left && !top); - int iconResId; - if (isLandscapePip) { - iconResId = expandL ? R.drawable.pip_expand_ll : R.drawable.pip_expand_lr; - } else { - iconResId = expandL ? R.drawable.pip_expand_pl : R.drawable.pip_expand_pr; - } - mExpandButton.setImageResource(iconResId); - } - private void setActions(Rect stackBounds, List actions) { mActions.clear(); mActions.addAll(actions); diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java index 5b54d85f04b96..30240c36b1d98 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipNotification.java @@ -168,8 +168,7 @@ public class PipNotification { void onConfigurationChanged(Context context) { Resources res = context.getResources(); mDefaultTitle = res.getString(R.string.pip_notification_unknown_title); - mDefaultIconResId = res.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_LTR - ? R.drawable.pip_expand_ll : R.drawable.pip_expand_lr; + mDefaultIconResId = R.drawable.pip_expand; if (mNotified) { // update notification notifyPipNotification();