summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/RotateLayout.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/ui/RotateLayout.java')
-rw-r--r--src/com/android/camera/ui/RotateLayout.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/camera/ui/RotateLayout.java b/src/com/android/camera/ui/RotateLayout.java
index 61bcf2282..1ebdf719d 100644
--- a/src/com/android/camera/ui/RotateLayout.java
+++ b/src/com/android/camera/ui/RotateLayout.java
@@ -36,7 +36,7 @@ public class RotateLayout extends ViewGroup implements Rotatable {
private CameraRootView mRootView;
public interface Child {
- void onApplyWindowInsets(Rect insets);
+ void onApplyWindowInsets(Rect insets, int rootWidth, int rootHeight);
}
public RotateLayout(Context context, AttributeSet attrs) {
@@ -66,11 +66,18 @@ public class RotateLayout extends ViewGroup implements Rotatable {
}
}
+ @Override
public void addView(View child) {
super.addView(child);
setupChild(child);
}
+ @Override
+ public void addView(View child, LayoutParams params) {
+ super.addView(child, params);
+ setupChild(child);
+ }
+
public void removeView(View v) {
super.removeView(v);
mOrientation = 0;
@@ -165,7 +172,8 @@ public class RotateLayout extends ViewGroup implements Rotatable {
private void applyInsetsToChild() {
if (mRootView != null && mChild instanceof Child) {
Rect insets = mRootView.getInsetsForOrientation(mOrientation);
- ((Child) mChild).onApplyWindowInsets(insets);
+ final Child child = (Child) mChild;
+ child.onApplyWindowInsets(insets, mRootView.getWidth(), mRootView.getHeight());
}
}