diff options
| -rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 21 | ||||
| -rw-r--r-- | src/com/android/gallery3d/filtershow/editors/Editor.java | 4 |
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); } } |
