summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-01-31 20:12:47 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-01-31 20:12:47 -0800
commit7bfe745b2d0bbc42999a74eaee70a7ed878ca135 (patch)
tree3decd33d4b55a36625838c6e15b40f3be7660760 /src
parentc8a544ad654009abd43d774a422885dfd8dd46c6 (diff)
parent0316f86c60f65ad521ee1e0a12919b82a2d3c03f (diff)
downloadandroid_packages_apps_Gallery2-7bfe745b2d0bbc42999a74eaee70a7ed878ca135.tar.gz
android_packages_apps_Gallery2-7bfe745b2d0bbc42999a74eaee70a7ed878ca135.tar.bz2
android_packages_apps_Gallery2-7bfe745b2d0bbc42999a74eaee70a7ed878ca135.zip
Merge "Gallery2: fix crop button and action bar overlapped when crop a 16:9 photo."
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java21
-rw-r--r--src/com/android/gallery3d/filtershow/editors/Editor.java4
2 files changed, 23 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 1824e7fd0..ab921e689 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -739,11 +739,30 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL
}
private void setupEditors() {
- mEditorPlaceHolder.setContainer((FrameLayout) findViewById(R.id.editorContainer));
+ FrameLayout editorContainer = (FrameLayout) findViewById(R.id.editorContainer);
+ LayoutParams layoutParams = (LayoutParams) editorContainer.getLayoutParams();
+ // if topMargin is not set in xml, set a default value here.
+ if (layoutParams.topMargin == 0) {
+ layoutParams.topMargin = getActionBarHeight() + getStatusBarHeight();
+ editorContainer.setLayoutParams(layoutParams);
+ }
+
+ mEditorPlaceHolder.setContainer(editorContainer);
EditorManager.addEditors(mEditorPlaceHolder);
mEditorPlaceHolder.setOldViews(mImageViews);
}
+ private int getActionBarHeight() {
+ ActionBar actionBar = getActionBar();
+ return actionBar == null ? 0 : actionBar.getHeight();
+ }
+
+ private int getStatusBarHeight() {
+ Rect frame = new Rect();
+ getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
+ return frame.top;
+ }
+
private void setDefaultValues() {
Resources res = getResources();
diff --git a/src/com/android/gallery3d/filtershow/editors/Editor.java b/src/com/android/gallery3d/filtershow/editors/Editor.java
index 490e5991c..d4d872a4d 100644
--- a/src/com/android/gallery3d/filtershow/editors/Editor.java
+++ b/src/com/android/gallery3d/filtershow/editors/Editor.java
@@ -145,10 +145,12 @@ public class Editor implements OnSeekBarChangeListener, SwapButton.SwapButtonLis
mSeekBar = (SeekBar) lp.findViewById(R.id.primarySeekBar);
mSeekBar.setOnSeekBarChangeListener(this);
mSeekBar.setVisibility(View.GONE);
+ editControl.setVisibility(View.GONE);
if (context.getResources().getConfiguration().orientation
== Configuration.ORIENTATION_PORTRAIT) {
if (showsSeekBar()) {
- mSeekBar.setVisibility(View.VISIBLE);
+ mSeekBar.setVisibility(View.VISIBLE);
+ editControl.setVisibility(View.VISIBLE);
}
}