diff options
author | Danny Baumann <dannybaumann@web.de> | 2016-01-14 11:36:38 +0100 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-01-15 01:47:05 -0800 |
commit | 2233950e703e2532b01f9f2893d9f7d8f5845cb1 (patch) | |
tree | 7557bf4eee6074750db8913fc4aa008de36c2280 /src/com/android/camera/ui/CameraControls.java | |
parent | 607a2f0b99886cb07b2d2b042d38bfb26da0f166 (diff) | |
download | android_packages_apps_Snap-2233950e703e2532b01f9f2893d9f7d8f5845cb1.tar.gz android_packages_apps_Snap-2233950e703e2532b01f9f2893d9f7d8f5845cb1.tar.bz2 android_packages_apps_Snap-2233950e703e2532b01f9f2893d9f7d8f5845cb1.zip |
CameraActivity: Don't hide navigation bar
* Make it transparent instead.
Change-Id: I08b06ac72d88aaf62ae7f52a3dde9ba865bc3542
Diffstat (limited to 'src/com/android/camera/ui/CameraControls.java')
-rw-r--r-- | src/com/android/camera/ui/CameraControls.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java index b6e31ada2..15836353e 100644 --- a/src/com/android/camera/ui/CameraControls.java +++ b/src/com/android/camera/ui/CameraControls.java @@ -23,9 +23,8 @@ import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.AnimationDrawable; import android.graphics.Paint; -import android.graphics.Rect; -import android.graphics.Paint; import android.graphics.Path; +import android.graphics.Rect; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; @@ -82,6 +81,7 @@ public class CameraControls extends RotatableLayout { private LinearLayout mRemainingPhotos; private TextView mRemainingPhotosText; private int mOrientation; + private final Rect mInsets = new Rect(); private int mPreviewRatio; private static int mTopMargin = 0; @@ -240,6 +240,12 @@ public class CameraControls extends RotatableLayout { } @Override + protected boolean fitSystemWindows(Rect insets) { + mInsets.set(insets); + return false; + } + + @Override public void onLayout(boolean changed, int l, int t, int r, int b) { int orientation = getResources().getConfiguration().orientation; int size = getResources().getDimensionPixelSize(R.dimen.camera_controls_size); @@ -247,18 +253,24 @@ public class CameraControls extends RotatableLayout { adjustBackground(); // As l,t,r,b are positions relative to parents, we need to convert them // to child's coordinates - r = r - l; - b = b - t; + r = r - l - mInsets.right; + b = b - t - mInsets.bottom; l = 0; t = 0; for (int i = 0; i < getChildCount(); i++) { View v = getChildAt(i); - v.layout(l, t, r, b); + if (v == mBackgroundView) { + v.layout(l, t, r + mInsets.right, b + mInsets.bottom); + } else { + v.layout(l, t, r, b); + } } + Rect shutter = new Rect(); center(mShutter, l, t, r, b, orientation, rotation, shutter, SHUTTER_INDEX); mSize = (int) (Math.max(shutter.right - shutter.left, shutter.bottom - shutter.top) * 1.2f); - center(mBackgroundView, l, t, r, b, orientation, rotation, new Rect(), -1); + center(mBackgroundView, l, t, r + mInsets.right, b + mInsets.bottom, + orientation, rotation, new Rect(), -1); mBackgroundView.setVisibility(View.GONE); setLocation(r - l, b - t); |