OSDN Git Service

Improves visual history
authornicolasroard <nicolasroard@google.com>
Tue, 5 Mar 2013 22:27:54 +0000 (14:27 -0800)
committernicolasroard <nicolasroard@google.com>
Tue, 5 Mar 2013 22:27:54 +0000 (14:27 -0800)
Change-Id: Ie43e99777d590a504b068d81f327119cca03b9d9

res/layout-land/filtershow_activity.xml
src/com/android/gallery3d/filtershow/FilterShowActivity.java

index 81e4fba..8cef0ce 100644 (file)
@@ -89,7 +89,7 @@
             <LinearLayout
                     android:id="@+id/historyPanel"
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
+                    android:layout_height="match_parent"
                     android:orientation="vertical"
                     android:layout_weight="1"
                     android:visibility="gone" >
index 518563a..4b59565 100644 (file)
@@ -872,7 +872,10 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
         super.onConfigurationChanged(newConfig);
         setDefaultValues();
         loadXML();
-        mShowingImageStatePanel = true;
+        if (getResources().getConfiguration().orientation
+                == Configuration.ORIENTATION_LANDSCAPE) {
+            mShowingImageStatePanel = true;
+        }
         if (mShowingHistoryPanel) {
             toggleHistoryPanel();
         }
@@ -911,7 +914,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
 
         if (mShowingImageStatePanel) {
             findViewById(R.id.imageStatePanel).setVisibility(View.GONE);
-            mShowingImageStatePanel = false;
         }
 
         int translate = translateMainPanel(viewList);
@@ -919,6 +921,8 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
             mShowingHistoryPanel = true;
             if (getResources().getConfiguration().orientation
                     == Configuration.ORIENTATION_PORTRAIT) {
+                // If portrait, always remove the state panel
+                mShowingImageStatePanel = false;
                 if (PanelController.useAnimations()) {
                     view.animate().setDuration(200).x(translate)
                             .withLayer().withEndAction(new Runnable() {
@@ -938,6 +942,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
                             .alpha(1.0f).start();
                 }
             } else {
+                findViewById(R.id.filtersPanel).setVisibility(View.GONE);
                 viewList.setVisibility(View.VISIBLE);
             }
         } else {
@@ -953,6 +958,11 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
                 }
             } else {
                 viewList.setVisibility(View.GONE);
+                findViewById(R.id.filtersPanel).setVisibility(View.VISIBLE);
+                // In landscape, bring back the state panel if it was there
+                if (mShowingImageStatePanel) {
+                    findViewById(R.id.imageStatePanel).setVisibility(View.VISIBLE);
+                }
             }
         }
         invalidateOptionsMenu();