diff options
| -rw-r--r-- | res/layout-land/filtershow_activity.xml | 90 | ||||
| -rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 44 |
2 files changed, 75 insertions, 59 deletions
diff --git a/res/layout-land/filtershow_activity.xml b/res/layout-land/filtershow_activity.xml index 8e74de908..81e4fba76 100644 --- a/res/layout-land/filtershow_activity.xml +++ b/res/layout-land/filtershow_activity.xml @@ -86,6 +86,51 @@ </LinearLayout> + <LinearLayout + android:id="@+id/historyPanel" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:layout_weight="1" + android:visibility="gone" > + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@android:color/transparent" + android:gravity="center" + android:padding="2dip" + android:text="@string/history" + android:textColor="@android:color/white" + android:textSize="24sp" + android:textStyle="bold" /> + + <ListView + android:id="@+id/operationsList" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" > + </ListView> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" > + + <Button + android:id="@+id/resetOperationsButton" + style="@style/FilterShowHistoryButton" + android:gravity="center" + android:text="@string/reset" /> + + <Button + android:id="@+id/saveOperationsButton" + style="@style/FilterShowHistoryButton" + android:text="@string/save" + android:visibility="gone" /> + </LinearLayout> + </LinearLayout> + <FrameLayout android:layout_gravity="bottom" @@ -288,49 +333,4 @@ </LinearLayout> - <LinearLayout - android:id="@+id/historyPanel" - android:layout_width="200dip" - android:layout_height="match_parent" - android:layout_gravity="right" - android:orientation="vertical" - android:visibility="invisible" > - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@android:color/transparent" - android:gravity="center" - android:padding="2dip" - android:text="@string/history" - android:textColor="@android:color/white" - android:textSize="24sp" - android:textStyle="bold" /> - - <ListView - android:id="@+id/operationsList" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" > - </ListView> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" > - - <Button - android:id="@+id/resetOperationsButton" - style="@style/FilterShowHistoryButton" - android:gravity="center" - android:text="@string/reset" /> - - <Button - android:id="@+id/saveOperationsButton" - style="@style/FilterShowHistoryButton" - android:text="@string/save" - android:visibility="gone" /> - </LinearLayout> - </LinearLayout> - </FrameLayout> diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 2f9269f13..e5d3ac655 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -150,6 +150,11 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, fillEditors(); loadXML(); + if (getResources().getConfiguration().orientation + == Configuration.ORIENTATION_LANDSCAPE) { + mShowingImageStatePanel = true; + } + setDefaultPreset(); processIntent(); @@ -842,7 +847,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, final View viewList = findViewById(R.id.imageStatePanel); if (mShowingHistoryPanel) { - findViewById(R.id.historyPanel).setVisibility(View.INVISIBLE); + findViewById(R.id.historyPanel).setVisibility(View.GONE); mShowingHistoryPanel = false; } @@ -862,6 +867,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, super.onConfigurationChanged(newConfig); setDefaultValues(); loadXML(); + mShowingImageStatePanel = true; if (mShowingHistoryPanel) { toggleHistoryPanel(); } @@ -893,16 +899,18 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, final View viewList = findViewById(R.id.historyPanel); if (mShowingImageStatePanel) { - findViewById(R.id.imageStatePanel).setVisibility(View.INVISIBLE); + findViewById(R.id.imageStatePanel).setVisibility(View.GONE); mShowingImageStatePanel = false; } int translate = translateMainPanel(viewList); if (!mShowingHistoryPanel) { mShowingHistoryPanel = true; - if (PanelController.useAnimations()) { - view.animate().setDuration(200).x(translate) - .withLayer().withEndAction(new Runnable() { + if (getResources().getConfiguration().orientation + == Configuration.ORIENTATION_PORTRAIT) { + if (PanelController.useAnimations()) { + view.animate().setDuration(200).x(translate) + .withLayer().withEndAction(new Runnable() { @Override public void run() { viewList.setAlpha(0); @@ -911,21 +919,29 @@ public class FilterShowActivity extends Activity implements OnItemClickListener, .alpha(1.0f).start(); } }).start(); + } else { + view.setX(translate); + viewList.setAlpha(0); + viewList.setVisibility(View.VISIBLE); + viewList.animate().setDuration(100) + .alpha(1.0f).start(); + } } else { - view.setX(translate); - viewList.setAlpha(0); viewList.setVisibility(View.VISIBLE); - viewList.animate().setDuration(100) - .alpha(1.0f).start(); } } else { mShowingHistoryPanel = false; - viewList.setVisibility(View.INVISIBLE); - if (PanelController.useAnimations()) { - view.animate().setDuration(200).x(0).withLayer() - .start(); + if (getResources().getConfiguration().orientation + == Configuration.ORIENTATION_PORTRAIT) { + viewList.setVisibility(View.INVISIBLE); + if (PanelController.useAnimations()) { + view.animate().setDuration(200).x(0).withLayer() + .start(); + } else { + view.setX(0); + } } else { - view.setX(0); + viewList.setVisibility(View.GONE); } } invalidateOptionsMenu(); |
