diff options
author | Gabriele M <moto.falcon.git@gmail.com> | 2017-02-18 22:19:05 +0100 |
---|---|---|
committer | Daniel Hillenbrand <daniel.hillenbrand@codeworkx.de> | 2017-04-10 17:01:55 +0000 |
commit | 30ba5582237ad86126e08cb55b6d1cff96de5ffa (patch) | |
tree | bbd6ac3dcaaa94cbccb290409a09534646ca93f1 | |
parent | f262e1a30d5f95d74f1a0a44ea25d3c7a40245f5 (diff) | |
download | android_packages_apps_Snap-30ba5582237ad86126e08cb55b6d1cff96de5ffa.tar.gz android_packages_apps_Snap-30ba5582237ad86126e08cb55b6d1cff96de5ffa.tar.bz2 android_packages_apps_Snap-30ba5582237ad86126e08cb55b6d1cff96de5ffa.zip |
WideAnglePanoramaUI: Correctly position the progressbar
The progressbar is not visible on devices with the navbar and the
cancel button that appears when generating the final picture overlaps
with the home button. Take into account the presence of the navbar
when calculating the position of the progressbar.
Change-Id: I81551477c426244531342e81c595ee020fe066c6
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaUI.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java index 548ef314f..9ca3c892f 100644 --- a/src/com/android/camera/WideAnglePanoramaUI.java +++ b/src/com/android/camera/WideAnglePanoramaUI.java @@ -559,31 +559,41 @@ public class WideAnglePanoramaUI extends BaseUI implements mRootView.findViewById(R.id.pano_progress_layout); int pivotY = ((ViewGroup) progressLayout).getPaddingTop() + progressLayout.getChildAt(0).getHeight() / 2; + int navbarHeight = mRootView.getHeight() - mRootView.getClientRectForOrientation(0).bottom; int[] x = { r / 2, r / 10, r * 9 / 10, r / 2 }; int[] y = { t / 2 + pivotY, (t + b1) / 2, (t + b1) / 2, b1 + pivotY }; int idx1, idx2; int g; + int adjustmentY, adjustmentX; switch (orientation) { case 90: idx1 = 1; idx2 = 2; + adjustmentX = -navbarHeight; + adjustmentY = 0; g = Gravity.TOP | Gravity.RIGHT; break; case 180: idx1 = 3; idx2 = 0; + adjustmentX = 0; + adjustmentY = navbarHeight; g = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM; break; case 270: idx1 = 2; idx2 = 1; + adjustmentX = navbarHeight; + adjustmentY = 0; g = Gravity.TOP | Gravity.RIGHT; break; default: idx1 = 0; idx2 = 3; + adjustmentX = 0; + adjustmentY = -navbarHeight; g = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM; break; } @@ -610,10 +620,10 @@ public class WideAnglePanoramaUI extends BaseUI implements final View[] views2 = { progressLayout, mReviewControl }; for (final View v : views2) { - v.setPivotX(r / 2); - v.setPivotY(pivotY); - v.setTranslationX(x[idx2] - x[3]); - v.setTranslationY(y[idx2] - y[3]); + v.setPivotX(r / 2 + adjustmentX / 2); + v.setPivotY(pivotY + adjustmentY / 2); + v.setTranslationX(x[idx2] - x[3] + adjustmentX); + v.setTranslationY(y[idx2] - y[3] + adjustmentY); v.setRotation(-orientation); } |