summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2015-11-19 11:27:18 -0800
committerCamera Software Integration <camswint@localhost>2015-12-30 13:57:24 +0530
commit799356334234fb157919fa87f85380a720706ba2 (patch)
tree426cf141c8e8f1f10febce644d1c3a9678d1abaa
parent2dd9b4336c1dacc681d43d7f3c24078aa915242d (diff)
downloadandroid_packages_apps_Snap-799356334234fb157919fa87f85380a720706ba2.tar.gz
android_packages_apps_Snap-799356334234fb157919fa87f85380a720706ba2.tar.bz2
android_packages_apps_Snap-799356334234fb157919fa87f85380a720706ba2.zip
SnapdragonCamera: Adjust remaining photos layout
There's a case exceeding the width. Correct the calculation to adjust it. Change-Id: I17553b471d4cf781b2532362c6dfc2c50dc5936b CRs-Fixed: 939587
-rw-r--r--src/com/android/camera/ui/CameraControls.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index a6e3332ae..f50ee80c3 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -97,6 +97,7 @@ public class CameraControls extends RotatableLayout {
private Paint mPaint;
private static final int LOW_REMAINING_PHOTOS = 20;
+ private static final int HIGH_REMAINING_PHOTOS = 1000000;
AnimatorListener outlistener = new AnimatorListener() {
@Override
@@ -903,7 +904,11 @@ public class CameraControls extends RotatableLayout {
if (mOrientation == 90 || mOrientation == 270) {
vc -= w / 2;
}
- mRemainingPhotos.layout(hc - w / 2, vc - h / 2, hc + w / 2, vc + h / 2);
+ if(hc < w/2) {
+ mRemainingPhotos.layout(0, vc - h / 2, w, vc + h / 2);
+ } else {
+ mRemainingPhotos.layout(hc - w / 2, vc - h / 2, hc + w / 2, vc + h / 2);
+ }
mRemainingPhotos.setRotation(-mOrientation);
}
@@ -917,6 +922,8 @@ public class CameraControls extends RotatableLayout {
}
if (remaining < LOW_REMAINING_PHOTOS) {
mRemainingPhotosText.setText("<" + LOW_REMAINING_PHOTOS + " ");
+ } else if (remaining >= HIGH_REMAINING_PHOTOS) {
+ mRemainingPhotosText.setText(">" + HIGH_REMAINING_PHOTOS);
} else {
mRemainingPhotosText.setText(remaining + " ");
}