diff options
author | Likai Ding <likaid@codeaurora.org> | 2015-02-10 15:22:20 +0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-02-17 03:13:19 -0700 |
commit | 1ce2883603bd1e98a487cb40577fbba281282aca (patch) | |
tree | 633972648df42b517ebb9e1d27b05a4100226e82 /src/com/android/camera/ui | |
parent | 12379846e84e949e5f96fb32ecf5ddd6f28d1a51 (diff) | |
download | android_packages_apps_Snap-1ce2883603bd1e98a487cb40577fbba281282aca.tar.gz android_packages_apps_Snap-1ce2883603bd1e98a487cb40577fbba281282aca.tar.bz2 android_packages_apps_Snap-1ce2883603bd1e98a487cb40577fbba281282aca.zip |
SnapdragonCamera: don't hide count down title
Don't hide count down title, instead, rotate and offset it to correct
position.
Change-Id: I31aca121bc7f8b5e672b6457e049c186ac1179d3
(cherry picked from commit 7023e606647cb5c2b60582a3755309565748f1fd)
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r-- | src/com/android/camera/ui/CountDownView.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/com/android/camera/ui/CountDownView.java b/src/com/android/camera/ui/CountDownView.java index f6d163624..c8d7174b1 100644 --- a/src/com/android/camera/ui/CountDownView.java +++ b/src/com/android/camera/ui/CountDownView.java @@ -150,10 +150,23 @@ public class CountDownView extends FrameLayout { public void setOrientation(int orientation) { mRemainingSecondsView.setRotation(-orientation); - if (orientation == 0) { - mCountDownTitle.setVisibility(View.VISIBLE); - } else { - mCountDownTitle.setVisibility(View.GONE); + + mCountDownTitle.setRotation(-orientation); + int dx = 0, dy = 0; + switch (orientation) { + case 90: + dy = (mCountDownTitle.getWidth() - mCountDownTitle.getHeight()) / 2; + dx = -dy; + break; + case 270: + dx = dy = (mCountDownTitle.getWidth() - mCountDownTitle.getHeight()) / 2; + break; + case 180: + break; + default: + break; } + mCountDownTitle.setTranslationX(dx); + mCountDownTitle.setTranslationY(dy); } } |