summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/CameraControls.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/ui/CameraControls.java')
-rw-r--r--src/com/android/camera/ui/CameraControls.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index fa9796f0e..674cb03f7 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -27,6 +27,7 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
+import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
@@ -87,6 +88,7 @@ public class CameraControls extends RotatableLayout {
private TextView mRemainingPhotosText;
private int mCurrentRemaining = -1;
private int mOrientation;
+ private final Rect mInsets = new Rect();
private int mPreviewRatio;
private int mTopMargin = 0;
@@ -282,20 +284,31 @@ 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) {
Log.d(TAG, String.format("onLayout changed=%b l=%d t=%d r=%d b=%d", changed, l, t, r, b));
super.onLayout(changed, l, t, r, b);
+ r -= mInsets.right;
+ b -= mInsets.bottom;
+
ViewGroup.LayoutParams lpTop = mTopBar.getLayoutParams();
lpTop.height = mTopMargin;
mTopBar.setLayoutParams(lpTop);
mTopBar.layout(l, t, r, mTopMargin);
ViewGroup.LayoutParams lpBottom = mBottomBar.getLayoutParams();
- lpBottom.height = mBottomMargin;
+ lpBottom.width = r - l + mInsets.right;
+ lpBottom.height = mBottomMargin + mInsets.bottom;
mBottomBar.setLayoutParams(lpBottom);
- mBottomBar.layout(l, b - mBottomMargin, r, b);
+ mBottomBar.setPadding(0, 0, mInsets.right, mInsets.bottom);
+ mBottomBar.layout(l, b - mBottomMargin, r + mInsets.right, b + mInsets.bottom);
setLocation(r - l, b - t);