diff options
author | Camera Software Integration <camswint@localhost> | 2016-12-01 09:16:27 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-01 09:16:27 -0800 |
commit | d17195f046cceff271bc6075b0663e32708c6803 (patch) | |
tree | 470567d0b05e2408233a839fe9e24e10db9cf9d1 /src/com/android/camera/ui | |
parent | 7da8fbcfe7f132e714663def4f9e7bac9a30a68e (diff) | |
parent | 379b47473762c8b4a335e30f046667bdb48dbaa8 (diff) | |
download | android_packages_apps_Snap-d17195f046cceff271bc6075b0663e32708c6803.tar.gz android_packages_apps_Snap-d17195f046cceff271bc6075b0663e32708c6803.tar.bz2 android_packages_apps_Snap-d17195f046cceff271bc6075b0663e32708c6803.zip |
Merge "SnapdragonCamera:Fix wrong Countdown tip position" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/com/android/camera/ui')
-rwxr-xr-x[-rw-r--r--] | src/com/android/camera/ui/CountDownView.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/camera/ui/CountDownView.java b/src/com/android/camera/ui/CountDownView.java index 6420fd2c3..7e1f28d52 100644..100755 --- a/src/com/android/camera/ui/CountDownView.java +++ b/src/com/android/camera/ui/CountDownView.java @@ -153,16 +153,21 @@ public class CountDownView extends FrameLayout { public void setOrientation(int orientation) { mRemainingSecondsView.setRotation(-orientation); - mCountDownTitle.setRotation(-orientation); + int width = getResources().getDisplayMetrics().widthPixels; + int height = mCountDownTitle.getMeasuredHeight(); + if (height == 0) { + measure(MeasureSpec.UNSPECIFIED,MeasureSpec.UNSPECIFIED); + height = mCountDownTitle.getMeasuredHeight(); + } int dx = 0, dy = 0; switch (orientation) { case 90: - dy = (mCountDownTitle.getWidth() - mCountDownTitle.getHeight()) / 2; + dy = (width - height) / 2; dx = -dy; break; case 270: - dx = dy = (mCountDownTitle.getWidth() - mCountDownTitle.getHeight()) / 2; + dx = dy = (width - height) / 2; break; case 180: break; |