From a8c97b3a637c748fbfdbd5fd9a3ba43862c0bb0f Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Mon, 25 Aug 2014 16:03:22 +0200 Subject: Fix QS header animation for RTL Bug: 17201391 Change-Id: I88a94df82ee23e4e5fe0b85c6be56e6014e66c1c --- .../statusbar/phone/StatusBarHeaderView.java | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java index 807a37b..1922637 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java @@ -542,7 +542,13 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL target.avatarScale = mMultiUserAvatar.getScaleX(); target.avatarX = mMultiUserSwitch.getLeft() + mMultiUserAvatar.getLeft(); target.avatarY = mMultiUserSwitch.getTop() + mMultiUserAvatar.getTop(); - target.batteryX = mSystemIconsSuperContainer.getLeft() + mSystemIconsContainer.getRight(); + if (getLayoutDirection() == LAYOUT_DIRECTION_LTR) { + target.batteryX = mSystemIconsSuperContainer.getLeft() + + mSystemIconsContainer.getRight(); + } else { + target.batteryX = mSystemIconsSuperContainer.getLeft() + + mSystemIconsContainer.getLeft(); + } target.batteryY = mSystemIconsSuperContainer.getTop() + mSystemIconsContainer.getTop(); target.batteryLevelAlpha = getAlphaForVisibility(mBatteryLevel); target.settingsAlpha = getAlphaForVisibility(mSettingsButton); @@ -579,11 +585,20 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL mMultiUserAvatar.setScaleY(values.avatarScale); mMultiUserAvatar.setX(values.avatarX - mMultiUserSwitch.getLeft()); mMultiUserAvatar.setY(values.avatarY - mMultiUserSwitch.getTop()); - mSystemIconsSuperContainer.setX(values.batteryX - mSystemIconsContainer.getRight()); + if (getLayoutDirection() == LAYOUT_DIRECTION_LTR) { + mSystemIconsSuperContainer.setX(values.batteryX - mSystemIconsContainer.getRight()); + } else { + mSystemIconsSuperContainer.setX(values.batteryX - mSystemIconsContainer.getLeft()); + } mSystemIconsSuperContainer.setY(values.batteryY - mSystemIconsContainer.getTop()); if (mSignalCluster != null && mExpanded) { - mSignalCluster.setX(mSystemIconsSuperContainer.getX() - - mSignalCluster.getWidth()); + if (getLayoutDirection() == LAYOUT_DIRECTION_LTR) { + mSignalCluster.setX(mSystemIconsSuperContainer.getX() + - mSignalCluster.getWidth()); + } else { + mSignalCluster.setX(mSystemIconsSuperContainer.getX() + + mSystemIconsSuperContainer.getWidth()); + } mSignalCluster.setY( mSystemIconsSuperContainer.getY() + mSystemIconsSuperContainer.getHeight()/2 - mSignalCluster.getHeight()/2); -- cgit v1.1