OSDN Git Service

Update FX/pano button appearance, placement, animation
authorBobby Georgescu <georgescu@google.com>
Sun, 30 Sep 2012 19:57:45 +0000 (12:57 -0700)
committerBobby Georgescu <georgescu@google.com>
Sun, 30 Sep 2012 20:00:17 +0000 (13:00 -0700)
Bug: 7213162
Bug: 7233446
Change-Id: Ief62e3f17ee08999a23656217dcf39bb91421d1e

res/drawable/photopage_bottom_button_background.xml [new file with mode: 0644]
res/layout/photopage_bottom_controls.xml
res/values/colors.xml
src/com/android/gallery3d/app/PhotoPageBottomControls.java

diff --git a/res/drawable/photopage_bottom_button_background.xml b/res/drawable/photopage_bottom_button_background.xml
new file mode 100644 (file)
index 0000000..0c772ad
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@android:color/holo_blue_light" android:state_pressed="true"/>
+    <item android:drawable="@color/button_dark_transparent_background" android:state_selected="false"/>
+</selector>
index a8fca2d..5b80cf2 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/photopage_bottom_controls"
+        android:padding="10dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
         android:visibility="gone">
         <ImageButton
                 android:id="@+id/photopage_bottom_control_edit"
-                android:src="@drawable/photoeditor_artistic"
+                android:src="@drawable/ic_photoeditor_effects"
+                android:background="@drawable/photopage_bottom_button_background"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_alignParentLeft="true"
+                android:paddingTop="5dp"
+                android:paddingBottom="5dp"
+                android:paddingLeft="15dp"
+                android:paddingRight="15dp"
                 android:visibility="gone"/>
         <ImageButton
                 android:id="@+id/photopage_bottom_control_panorama"
-                android:src="@android:drawable/ic_dialog_map"
+                android:src="@drawable/ic_menu_photosphere"
+                android:background="@drawable/photopage_bottom_button_background"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
+                android:layout_alignParentRight="true"
+                android:paddingTop="5dp"
+                android:paddingBottom="5dp"
+                android:paddingLeft="15dp"
+                android:paddingRight="15dp"
                 android:visibility="gone"/>
-</LinearLayout>
+</RelativeLayout>
index 10f5b63..705748c 100644 (file)
@@ -38,4 +38,6 @@
     <color name="bitmap_screennail_placeholder">#333</color>
 
     <color name="slideshow_background">#1A1A1A</color>
+
+    <color name="button_dark_transparent_background">#6000</color>
 </resources>
index 8ba4818..40588e1 100644 (file)
@@ -51,8 +51,8 @@ public class PhotoPageBottomControls implements OnClickListener {
 
     private static final int CONTROL_ANIM_DURATION_MS = 150;
     private static Animation getControlAnimForVisibility(boolean visible) {
-        Animation anim = visible ? new ScaleAnimation(0, 1, 1, 1)
-                : new ScaleAnimation(1, 0, 1, 1);
+        Animation anim = visible ? new AlphaAnimation(0f, 1f)
+                : new AlphaAnimation(1f, 0f);
         anim.setDuration(CONTROL_ANIM_DURATION_MS);
         return anim;
     }