Merge "Fixed apply bar text.  Moved strings to xml." into gb-ub-photos-arches
diff --git a/res/drawable-hdpi/ic_menu_photosphere.png b/res/drawable-hdpi/ic_menu_photosphere.png
deleted file mode 100644
index 27043ef..0000000
--- a/res/drawable-hdpi/ic_menu_photosphere.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_photosphere_active.png b/res/drawable-hdpi/ic_menu_photosphere_active.png
deleted file mode 100644
index c576015..0000000
--- a/res/drawable-hdpi/ic_menu_photosphere_active.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_photosphere.png b/res/drawable-mdpi/ic_menu_photosphere.png
deleted file mode 100644
index 4ba0969..0000000
--- a/res/drawable-mdpi/ic_menu_photosphere.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_photosphere_active.png b/res/drawable-mdpi/ic_menu_photosphere_active.png
deleted file mode 100644
index 96e2ac5..0000000
--- a/res/drawable-mdpi/ic_menu_photosphere_active.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_photosphere.png b/res/drawable-xhdpi/ic_menu_photosphere.png
deleted file mode 100644
index 19f9b29..0000000
--- a/res/drawable-xhdpi/ic_menu_photosphere.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_photosphere_active.png b/res/drawable-xhdpi/ic_menu_photosphere_active.png
deleted file mode 100644
index a77a712..0000000
--- a/res/drawable-xhdpi/ic_menu_photosphere_active.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/btn_undo.xml b/res/drawable/btn_undo.xml
deleted file mode 100644
index 3323255..0000000
--- a/res/drawable/btn_undo.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_enabled="false" android:drawable="@drawable/filtershow_button_undo_disabled" />
-    <item android:drawable="@drawable/filtershow_button_undo" />
-</selector>
-
diff --git a/res/drawable/filtershow_button_undo_disabled.png b/res/drawable/filtershow_button_undo_disabled.png
deleted file mode 100644
index 6d42aa8..0000000
--- a/res/drawable/filtershow_button_undo_disabled.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/action_bar_two_line_text.xml b/res/layout/action_bar_two_line_text.xml
index 9b76a80..95faffa 100644
--- a/res/layout/action_bar_two_line_text.xml
+++ b/res/layout/action_bar_two_line_text.xml
@@ -14,29 +14,29 @@
      limitations under the License.
 -->
 <TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android"
-    android:paddingLeft="18dp"
-    android:paddingRight="18dp"
-    android:background="?android:attr/activatedBackgroundIndicator"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:minHeight="?android:attr/listPreferredItemHeight"
-    android:mode="twoLine"
-    android:gravity="center_vertical"
->
-    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@android:id/text1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:singleLine="true"
-        android:ellipsize="end"
-        android:textSize="15dp"
-    />
-    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@android:id/text2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@android:id/text1"
-        android:textSize="9dp"
-        android:singleLine="true"
-    />
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:gravity="center_vertical"
+        android:background="?android:attr/activatedBackgroundIndicator"
+        android:duplicateParentState="false"
+        android:layout_alignParentLeft="true"
+        android:layout_width="wrap_content" >
+        <TextView
+            android:id="@android:id/text1"
+            style="@style/ActionBarTwoLinePrimary"
+            android:singleLine="true"
+            android:ellipsize="end"
+            android:includeFontPadding="false"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+        <TextView
+            android:id="@android:id/text2"
+            style="@style/ActionBarTwoLineSecondary"
+            android:singleLine="true"
+            android:ellipsize="end"
+            android:includeFontPadding="false"
+            android:layout_marginRight="4dp"
+            android:layout_below="@android:id/text1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
 </TwoLineListItem>
diff --git a/res/layout/photopage_bottom_controls.xml b/res/layout/photopage_bottom_controls.xml
index 434c598..1111ef4 100644
--- a/res/layout/photopage_bottom_controls.xml
+++ b/res/layout/photopage_bottom_controls.xml
@@ -23,7 +23,7 @@
                 android:visibility="gone"/>
         <ImageView
                 android:id="@+id/photopage_bottom_control_panorama"
-                android:src="@drawable/ic_menu_photosphere"
+                android:src="@drawable/ic_view_photosphere"
                 android:layout_width="70dp"
                 android:layout_height="70dp"
                 android:layout_centerHorizontal="true"
diff --git a/res/values-land/styles.xml b/res/values-land/styles.xml
new file mode 100644
index 0000000..c10362e
--- /dev/null
+++ b/res/values-land/styles.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- Spinner primary text is smaller than usual due to extra vertical padding in spinner asset -->
+    <style name="ActionBarTwoLinePrimary" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
+        <item name="android:textSize">14sp</item>
+    </style>
+</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index abcd4dd..c534ad8 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -41,4 +41,6 @@
     </style>
     <bool name="picker_is_dialog">false</bool>
     <color name="darker_transparent">#C1000000</color>
+    <style name="ActionBarTwoLinePrimary" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"></style>
+    <style name="ActionBarTwoLineSecondary" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Subtitle"></style>
 </resources>
diff --git a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
index 0ddb017..18aa1fb 100644
--- a/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/presets/ImagePreset.java
@@ -122,32 +122,38 @@
     }
 
     public void add(ImageFilter filter) {
+
         if (filter.getFilterType() == ImageFilter.TYPE_BORDER){
             setHistoryName("Border");
             setBorder(filter);
         } else if (filter.getFilterType() == ImageFilter.TYPE_FX){
-            Vector<ImageFilter> fl = mFilters;
+
             boolean found = false;
             for (int i = 0; i < mFilters.size(); i++) {
-                byte type = fl.get(i).getFilterType();
+                byte type = mFilters.get(i).getFilterType();
                 if (found) {
                     if (type != ImageFilter.TYPE_VIGNETTE){
-                        fl.remove(i);
+                        mFilters.remove(i);
+                        continue;
                     }
-                } else  if (type==ImageFilter.TYPE_FX){
-                    fl.remove(i);
-                    fl.add(i, filter);
+                }
+                if (type==ImageFilter.TYPE_FX){
+                    mFilters.remove(i);
+                    mFilters.add(i, filter);
                     setHistoryName(filter.getName());
                     found = true;
                 }
 
             }
-            mFilters.add(filter);
-            setHistoryName(filter.getName());
+            if (!found) {
+                mFilters.add(filter);
+                setHistoryName(filter.getName());
+            }
         } else {
             mFilters.add(filter);
             setHistoryName(filter.getName());
         }
+
     }
 
     public void remove(String filterName) {