summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2013-04-30 15:34:19 -0700
committerMichael Kolb <kolby@google.com>2013-05-01 11:48:02 -0700
commit78a5b224eca3c702f4ecf8abd072779e32e26641 (patch)
treefe3ad3db10478fb0586cfd4dec4b16e8ed2d527c /src/com/android/camera/ui
parent8788079a51a90255dce330e56afcb6674deccbf7 (diff)
downloadandroid_packages_apps_Snap-78a5b224eca3c702f4ecf8abd072779e32e26641.tar.gz
android_packages_apps_Snap-78a5b224eca3c702f4ecf8abd072779e32e26641.tar.bz2
android_packages_apps_Snap-78a5b224eca3c702f4ecf8abd072779e32e26641.zip
Update capture animation
Bug: 8253060 Update preview thumb margins and size Add touch target for thumbnail Change-Id: I2b298de330834c42a55b4cb082148d971727f530
Diffstat (limited to 'src/com/android/camera/ui')
-rw-r--r--src/com/android/camera/ui/CameraControls.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index 3a5fbde57..e5b90dd51 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -21,7 +21,6 @@ import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
@@ -38,6 +37,7 @@ public class CameraControls extends RotatableLayout {
private View mSwitcher;
private View mMenu;
private View mIndicators;
+ private View mPreview;
public CameraControls(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -61,6 +61,7 @@ public class CameraControls extends RotatableLayout {
mShutter = findViewById(R.id.shutter_button);
mMenu = findViewById(R.id.menu);
mIndicators = findViewById(R.id.on_screen_indicators);
+ mPreview = findViewById(R.id.preview_thumb);
}
@Override
@@ -75,6 +76,7 @@ public class CameraControls extends RotatableLayout {
toLeft(mSwitcher, l, t, r, b, orientation, rotation, shutter);
toRight(mMenu, l, t, r, b, orientation, rotation, shutter);
toRight(mIndicators, l, t, r, b, orientation, rotation, shutter);
+ topRight(mPreview, l, t, r, b, orientation, rotation);
View retake = findViewById(R.id.btn_retake);
if (retake != null) {
Rect retakeRect = new Rect();
@@ -96,6 +98,7 @@ public class CameraControls extends RotatableLayout {
}
return rotation;
}
+
private void center(View v, int l, int t, int r, int b, int orientation, int rotation, Rect result) {
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) v.getLayoutParams();
int tw = lp.leftMargin + v.getMeasuredWidth() + lp.rightMargin;
@@ -209,6 +212,13 @@ public class CameraControls extends RotatableLayout {
v.layout(result.left, result.top, result.right, result.bottom);
}
+ private void topRight(View v, int l, int t, int r, int b, int orientation, int rotation) {
+ // layout using the specific margins; the rotation code messes up the others
+ int mt = getContext().getResources().getDimensionPixelSize(R.dimen.capture_margin_top);
+ int mr = getContext().getResources().getDimensionPixelSize(R.dimen.capture_margin_right);
+ v.layout(r - v.getMeasuredWidth() - mr, t + mt, r - mr, t + mt + v.getMeasuredHeight());
+ }
+
// In reverse landscape and reverse portrait, camera controls will be laid out
// on the wrong side of the screen. We need to make adjustment to move the controls
// to the USB side