diff options
author | nicolasroard <nicolasroard@google.com> | 2013-08-13 16:29:11 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-08-13 16:37:44 -0700 |
commit | e799626df47f99e4ba70bcfe787fdbdac64a8cc7 (patch) | |
tree | d66e812007ade4315e8b45313216c432f2d15cbd | |
parent | c41fdd6f37df5dbd7f44b1c79cdd6d025937209d (diff) | |
download | android_packages_apps_Gallery2-e799626df47f99e4ba70bcfe787fdbdac64a8cc7.tar.gz android_packages_apps_Gallery2-e799626df47f99e4ba70bcfe787fdbdac64a8cc7.tar.bz2 android_packages_apps_Gallery2-e799626df47f99e4ba70bcfe787fdbdac64a8cc7.zip |
Fix tablet UI layout
Change-Id: I19a6f6751dd7754e8b0de6eb22a82041b1dff29f
-rw-r--r-- | res/layout-land/filtershow_activity.xml | 51 | ||||
-rw-r--r-- | res/layout-land/filtershow_editor_panel.xml | 14 | ||||
-rw-r--r-- | res/layout-land/filtershow_main_panel.xml | 12 | ||||
-rw-r--r-- | res/layout-land/filtershow_state_panel_new.xml | 33 | ||||
-rw-r--r-- | res/layout/filtershow_editor_panel.xml | 7 | ||||
-rw-r--r-- | res/layout/filtershow_state_panel_new.xml | 2 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/FilterShowActivity.java | 4 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/category/MainPanel.java | 14 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/editors/EditorPanel.java | 18 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/state/StatePanel.java | 1 |
10 files changed, 84 insertions, 72 deletions
diff --git a/res/layout-land/filtershow_activity.xml b/res/layout-land/filtershow_activity.xml index a47396f2f..e6599f049 100644 --- a/res/layout-land/filtershow_activity.xml +++ b/res/layout-land/filtershow_activity.xml @@ -28,33 +28,48 @@ android:animateLayoutChanges="true"> <LinearLayout - android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="match_parent" - android:orientation="horizontal"> + android:layout_weight="1" + android:orientation="vertical" + > - <FrameLayout - android:id="@+id/central_panel_container" - android:layout_gravity="center" - android:layout_width="match_parent" - android:layout_height="wrap_content" + <LinearLayout android:layout_weight="1" - android:visibility="gone"/> + android:layout_width="wrap_content" + android:layout_height="0dp" + android:orientation="horizontal"> - <FrameLayout - android:id="@+id/editorContainer" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1"/> + <FrameLayout + android:id="@+id/central_panel_container" + android:layout_gravity="center" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:visibility="gone"/> - <com.android.gallery3d.filtershow.imageshow.ImageShow - android:id="@+id/imageShow" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" /> + <FrameLayout + android:id="@+id/editorContainer" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1"/> + + <com.android.gallery3d.filtershow.imageshow.ImageShow + android:id="@+id/imageShow" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1"/> + + </LinearLayout> + + <FrameLayout android:id="@+id/state_panel_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="visible"/> </LinearLayout> + <LinearLayout android:id="@+id/mainPanel" android:layout_width="350dip" diff --git a/res/layout-land/filtershow_editor_panel.xml b/res/layout-land/filtershow_editor_panel.xml index 015fa26a7..2cb00e3b9 100644 --- a/res/layout-land/filtershow_editor_panel.xml +++ b/res/layout-land/filtershow_editor_panel.xml @@ -30,12 +30,12 @@ android:background="@color/background_main_toolbar" /> - <FrameLayout android:id="@+id/state_panel_container" - android:layout_width="match_parent" - android:layout_height="0dip" - android:visibility="visible" - android:layout_gravity="top" - android:layout_weight="1" /> + <View + android:layout_width="match_parent" + android:layout_height="0dip" + android:visibility="invisible" + android:layout_gravity="top" + android:layout_weight="1" /> <LinearLayout android:layout_width="match_parent" @@ -62,7 +62,7 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="56dip" + android:layout_height="48dip" android:background="@color/background_main_toolbar" android:orientation="horizontal" android:baselineAligned="false" diff --git a/res/layout-land/filtershow_main_panel.xml b/res/layout-land/filtershow_main_panel.xml index 705eb690b..6a36de2d7 100644 --- a/res/layout-land/filtershow_main_panel.xml +++ b/res/layout-land/filtershow_main_panel.xml @@ -23,13 +23,6 @@ android:animateLayoutChanges="true" android:visibility="visible" > - <FrameLayout android:id="@+id/state_panel_container" - android:layout_width="match_parent" - android:layout_height="0dip" - android:visibility="visible" - android:layout_gravity="top" - android:layout_weight="1" /> - <FrameLayout android:id="@+id/category_panel_container" android:layout_width="match_parent" android:layout_height="0dip" @@ -95,4 +88,9 @@ </com.android.gallery3d.filtershow.CenteredLinearLayout> + <View + android:background="@color/toolbar_separation_line" + android:layout_height="1dip" + android:layout_width="match_parent"/> + </LinearLayout>
\ No newline at end of file diff --git a/res/layout-land/filtershow_state_panel_new.xml b/res/layout-land/filtershow_state_panel_new.xml deleted file mode 100644 index c83cd8833..000000000 --- a/res/layout-land/filtershow_state_panel_new.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:custom="http://schemas.android.com/apk/res/com.android.gallery3d" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <ScrollView - android:layout_width="match_parent" - android:layout_height="0dip" - android:layout_weight="1" - android:scrollbars="none"> - - <com.android.gallery3d.filtershow.state.StatePanelTrack - android:id="@+id/listStates" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent" - custom:elemSize="72dip" - custom:elemEndSize="32dip" - android:layout_margin="8dip" - android:animateLayoutChanges="true" /> - - </ScrollView> - - <View - android:background="@color/state_panel_separation_line" - android:layout_height="6dip" - android:layout_width="match_parent" - android:paddingTop="8dip"/> - -</LinearLayout> diff --git a/res/layout/filtershow_editor_panel.xml b/res/layout/filtershow_editor_panel.xml index a6da46a08..7332657a4 100644 --- a/res/layout/filtershow_editor_panel.xml +++ b/res/layout/filtershow_editor_panel.xml @@ -22,6 +22,11 @@ android:orientation="vertical" android:visibility="visible" > + <View + android:background="@color/toolbar_separation_line" + android:layout_height="1dip" + android:layout_width="match_parent"/> + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -46,7 +51,7 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="56dip" + android:layout_height="48dip" android:background="@color/background_main_toolbar" android:orientation="horizontal" android:baselineAligned="false" diff --git a/res/layout/filtershow_state_panel_new.xml b/res/layout/filtershow_state_panel_new.xml index 184f85130..b19969567 100644 --- a/res/layout/filtershow_state_panel_new.xml +++ b/res/layout/filtershow_state_panel_new.xml @@ -29,7 +29,7 @@ android:layout_height="48dip" custom:elemEndSize="128dip" custom:elemSize="128dip" - android:layout_margin="8dip" + android:layout_margin="0dip" android:animateLayoutChanges="true" /> </HorizontalScrollView> diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 5ef5724c3..733084915 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -637,6 +637,10 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL mCategoryBordersAdapter.reflectImagePreset(preset); } + public View getMainStatePanelContainer(int id) { + return findViewById(id); + } + private class LoadHighresBitmapTask extends AsyncTask<Void, Void, Boolean> { @Override protected Boolean doInBackground(Void... params) { diff --git a/src/com/android/gallery3d/filtershow/category/MainPanel.java b/src/com/android/gallery3d/filtershow/category/MainPanel.java index 47f575d4d..9eccad3ed 100644 --- a/src/com/android/gallery3d/filtershow/category/MainPanel.java +++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java @@ -257,11 +257,19 @@ public class MainPanel extends Fragment { } public void showImageStatePanel(boolean show) { - if (mMainView.findViewById(R.id.state_panel_container) == null) { + View container = mMainView.findViewById(R.id.state_panel_container); + FragmentTransaction transaction = null; + if (container == null) { + FilterShowActivity activity = (FilterShowActivity) getActivity(); + container = activity.getMainStatePanelContainer(R.id.state_panel_container); + } else { + transaction = getChildFragmentManager().beginTransaction(); + } + if (container == null) { return; + } else { + transaction = getFragmentManager().beginTransaction(); } - FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); - final View container = mMainView.findViewById(R.id.state_panel_container); int currentPanel = mCurrentSelected; if (show) { container.setVisibility(View.VISIBLE); diff --git a/src/com/android/gallery3d/filtershow/editors/EditorPanel.java b/src/com/android/gallery3d/filtershow/editors/EditorPanel.java index bc4ca6ab6..97b3075df 100644 --- a/src/com/android/gallery3d/filtershow/editors/EditorPanel.java +++ b/src/com/android/gallery3d/filtershow/editors/EditorPanel.java @@ -120,10 +120,21 @@ public class EditorPanel extends Fragment { } public void showImageStatePanel(boolean show) { - if (mMainView.findViewById(R.id.state_panel_container) == null) { + View container = mMainView.findViewById(R.id.state_panel_container); + FragmentTransaction transaction = null; + boolean child = false; + if (container == null) { + FilterShowActivity activity = (FilterShowActivity) getActivity(); + container = activity.getMainStatePanelContainer(R.id.state_panel_container); + } else { + transaction = getChildFragmentManager().beginTransaction(); + child = true; + } + if (container == null) { return; + } else { + transaction = getFragmentManager().beginTransaction(); } - FragmentTransaction transaction = getChildFragmentManager().beginTransaction(); Fragment panel = getActivity().getSupportFragmentManager().findFragmentByTag( MainPanel.FRAGMENT_TAG); if (panel == null || panel instanceof MainPanel) { @@ -134,6 +145,9 @@ public class EditorPanel extends Fragment { transaction.replace(R.id.state_panel_container, statePanel, StatePanel.FRAGMENT_TAG); } else { Fragment statePanel = getChildFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG); + if (child) { + statePanel = getFragmentManager().findFragmentByTag(StatePanel.FRAGMENT_TAG); + } if (statePanel != null) { transaction.remove(statePanel); } diff --git a/src/com/android/gallery3d/filtershow/state/StatePanel.java b/src/com/android/gallery3d/filtershow/state/StatePanel.java index d65a77260..ff405cd98 100644 --- a/src/com/android/gallery3d/filtershow/state/StatePanel.java +++ b/src/com/android/gallery3d/filtershow/state/StatePanel.java @@ -44,6 +44,7 @@ public class StatePanel extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mMainView = (LinearLayout) inflater.inflate(R.layout.filtershow_state_panel_new, null); + View panel = mMainView.findViewById(R.id.listStates); track = (StatePanelTrack) panel; track.setAdapter(MasterImage.getImage().getState()); |