From 96f78f50464a0f394802ff0709ba7276976ef275 Mon Sep 17 00:00:00 2001 From: Winson Date: Wed, 21 Sep 2016 12:14:16 -0700 Subject: [PATCH] Fixing RTL issues with transition and screen pinning. Bug: 31367531 Change-Id: Id790293cc5246535d6fb829ec57e4ee640fea1a2 --- packages/SystemUI/res/layout/recents_task_view.xml | 4 ++-- .../src/com/android/systemui/recents/RecentsImpl.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/res/layout/recents_task_view.xml b/packages/SystemUI/res/layout/recents_task_view.xml index 1978a930b199b..c8e5b61241961 100644 --- a/packages/SystemUI/res/layout/recents_task_view.xml +++ b/packages/SystemUI/res/layout/recents_task_view.xml @@ -30,8 +30,8 @@ android:id="@+id/lock_to_app_fab" android:layout_width="@dimen/recents_lock_to_app_size" android:layout_height="@dimen/recents_lock_to_app_size" - android:layout_gravity="bottom|right" - android:layout_marginRight="15dp" + android:layout_gravity="bottom|end" + android:layout_marginEnd="15dp" android:layout_marginBottom="15dp" android:translationZ="4dp" android:contentDescription="@string/recents_lock_to_app_button_label" diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java index ab4c811f6a060..a4129660da842 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java @@ -205,9 +205,17 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener } public void onConfigurationChanged() { + Resources res = mContext.getResources(); reloadResources(); mDummyStackView.reloadOnConfigurationChange(); + // Update the header bar direction directly as it is not attached to anything and does not + // layout except in updateHeaderBarLayout() + mHeaderBar.setLayoutDirection(res.getConfiguration().getLayoutDirection()); mHeaderBar.onConfigurationChanged(); + mHeaderBar.forceLayout(); + mHeaderBar.measure( + MeasureSpec.makeMeasureSpec(mHeaderBar.getMeasuredWidth(), MeasureSpec.EXACTLY), + MeasureSpec.makeMeasureSpec(mHeaderBar.getMeasuredHeight(), MeasureSpec.EXACTLY)); } /** @@ -626,6 +634,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener synchronized (mHeaderBarLock) { if (mHeaderBar.getMeasuredWidth() != taskViewWidth || mHeaderBar.getMeasuredHeight() != mTaskBarHeight) { + mHeaderBar.forceLayout(); mHeaderBar.measure( MeasureSpec.makeMeasureSpec(taskViewWidth, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(mTaskBarHeight, MeasureSpec.EXACTLY));