summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-11-06 21:48:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-11-06 21:48:41 +0000
commit10b9ac807f7cc0817e8dd4b96d587ccd41f8f177 (patch)
tree99e9c42ef3a1becd702c7ffb5daf8bf245d6b31d /packages
parent322934699433d703fa35505d72028abbcf8ce45f (diff)
parentb6c3b20d7150f725d638c620affd521145fe8f90 (diff)
downloadframeworks_base-10b9ac807f7cc0817e8dd4b96d587ccd41f8f177.zip
frameworks_base-10b9ac807f7cc0817e8dd4b96d587ccd41f8f177.tar.gz
frameworks_base-10b9ac807f7cc0817e8dd4b96d587ccd41f8f177.tar.bz2
Merge "Fix lockscreen camera preview position in RTL." into klp-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java b/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
index 7d1f24f..3dc4d5c 100644
--- a/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
+++ b/packages/Keyguard/src/com/android/keyguard/CameraWidgetFrame.java
@@ -243,11 +243,12 @@ public class CameraWidgetFrame extends KeyguardWidgetFrame implements View.OnCli
final float pvTransX = pvWidth < thisWidth ? (thisWidth - pvWidth) / 2 : 0;
final float pvTransY = pvHeight < thisHeight ? (thisHeight - pvHeight) / 2 : 0;
- mPreview.setPivotX(0);
+ final boolean isRtl = mPreview.getLayoutDirection() == LAYOUT_DIRECTION_RTL;
+ mPreview.setPivotX(isRtl ? mPreview.width : 0);
mPreview.setPivotY(0);
mPreview.setScaleX(pvScale);
mPreview.setScaleY(pvScale);
- mPreview.setTranslationX(pvTransX);
+ mPreview.setTranslationX((isRtl ? -1 : 1) * pvTransX);
mPreview.setTranslationY(pvTransY);
mRenderedSize.set(width, height);