OSDN Git Service

Update assets for pressed/focused/selected states
authorMichael Jurka <mikejurka@google.com>
Thu, 12 Sep 2013 00:53:22 +0000 (02:53 +0200)
committerMichael Jurka <mikejurka@google.com>
Wed, 18 Sep 2013 13:16:00 +0000 (15:16 +0200)
Also, add shadow below/above wallpaper strip

Bug: 10722070

Change-Id: I37c445bab90e103f414c95b62e101a73d060661f

38 files changed:
res/drawable-hdpi/grid_focused.9.png [deleted file]
res/drawable-hdpi/grid_pressed.9.png [deleted file]
res/drawable-hdpi/grid_selected.9.png [deleted file]
res/drawable-hdpi/tile_picker_focused.9.png [new file with mode: 0644]
res/drawable-hdpi/tile_picker_pressed.9.png [new file with mode: 0644]
res/drawable-hdpi/tile_picker_selected.9.png [new file with mode: 0644]
res/drawable-hdpi/tile_shadow_bottom.9.png [new file with mode: 0644]
res/drawable-hdpi/tile_shadow_top.9.png [new file with mode: 0644]
res/drawable-mdpi/grid_focused.9.png [deleted file]
res/drawable-mdpi/grid_pressed.9.png [deleted file]
res/drawable-mdpi/grid_selected.9.png [deleted file]
res/drawable-mdpi/tile_picker_focused.9.png [new file with mode: 0644]
res/drawable-mdpi/tile_picker_pressed.9.png [new file with mode: 0644]
res/drawable-mdpi/tile_picker_selected.9.png [new file with mode: 0644]
res/drawable-mdpi/tile_shadow_bottom.9.png [new file with mode: 0644]
res/drawable-mdpi/tile_shadow_top.9.png [new file with mode: 0644]
res/drawable-xhdpi/grid_focused.9.png [deleted file]
res/drawable-xhdpi/grid_pressed.9.png [deleted file]
res/drawable-xhdpi/grid_selected.9.png [deleted file]
res/drawable-xhdpi/tile_picker_focused.9.png [new file with mode: 0644]
res/drawable-xhdpi/tile_picker_pressed.9.png [new file with mode: 0644]
res/drawable-xhdpi/tile_picker_selected.9.png [new file with mode: 0644]
res/drawable-xhdpi/tile_shadow_bottom.9.png [new file with mode: 0644]
res/drawable-xhdpi/tile_shadow_top.9.png [new file with mode: 0644]
res/drawable-xxhdpi/grid_focused.9.png [deleted file]
res/drawable-xxhdpi/grid_pressed.9.png [deleted file]
res/drawable-xxhdpi/grid_selected.9.png [deleted file]
res/drawable-xxhdpi/tile_picker_focused.9.png [new file with mode: 0644]
res/drawable-xxhdpi/tile_picker_pressed.9.png [new file with mode: 0644]
res/drawable-xxhdpi/tile_picker_selected.9.png [new file with mode: 0644]
res/drawable-xxhdpi/tile_shadow_bottom.9.png [new file with mode: 0644]
res/drawable-xxhdpi/tile_shadow_top.9.png [new file with mode: 0644]
res/drawable/wallpaper_tile_fg.xml [moved from res/drawable/wallpaper_gallery_item.xml with 90% similarity]
res/layout/wallpaper_cropper.xml
res/layout/wallpaper_picker.xml
res/layout/wallpaper_picker_gallery_item.xml
res/layout/wallpaper_picker_item.xml
src/com/android/launcher3/WallpaperPickerActivity.java

diff --git a/res/drawable-hdpi/grid_focused.9.png b/res/drawable-hdpi/grid_focused.9.png
deleted file mode 100644 (file)
index f6ae267..0000000
Binary files a/res/drawable-hdpi/grid_focused.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/grid_pressed.9.png b/res/drawable-hdpi/grid_pressed.9.png
deleted file mode 100644 (file)
index cb5aea8..0000000
Binary files a/res/drawable-hdpi/grid_pressed.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/grid_selected.9.png b/res/drawable-hdpi/grid_selected.9.png
deleted file mode 100644 (file)
index add46a7..0000000
Binary files a/res/drawable-hdpi/grid_selected.9.png and /dev/null differ
diff --git a/res/drawable-hdpi/tile_picker_focused.9.png b/res/drawable-hdpi/tile_picker_focused.9.png
new file mode 100644 (file)
index 0000000..c72d6a2
Binary files /dev/null and b/res/drawable-hdpi/tile_picker_focused.9.png differ
diff --git a/res/drawable-hdpi/tile_picker_pressed.9.png b/res/drawable-hdpi/tile_picker_pressed.9.png
new file mode 100644 (file)
index 0000000..44c65ac
Binary files /dev/null and b/res/drawable-hdpi/tile_picker_pressed.9.png differ
diff --git a/res/drawable-hdpi/tile_picker_selected.9.png b/res/drawable-hdpi/tile_picker_selected.9.png
new file mode 100644 (file)
index 0000000..461bacb
Binary files /dev/null and b/res/drawable-hdpi/tile_picker_selected.9.png differ
diff --git a/res/drawable-hdpi/tile_shadow_bottom.9.png b/res/drawable-hdpi/tile_shadow_bottom.9.png
new file mode 100644 (file)
index 0000000..e80558b
Binary files /dev/null and b/res/drawable-hdpi/tile_shadow_bottom.9.png differ
diff --git a/res/drawable-hdpi/tile_shadow_top.9.png b/res/drawable-hdpi/tile_shadow_top.9.png
new file mode 100644 (file)
index 0000000..7e93865
Binary files /dev/null and b/res/drawable-hdpi/tile_shadow_top.9.png differ
diff --git a/res/drawable-mdpi/grid_focused.9.png b/res/drawable-mdpi/grid_focused.9.png
deleted file mode 100644 (file)
index 6660a8c..0000000
Binary files a/res/drawable-mdpi/grid_focused.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/grid_pressed.9.png b/res/drawable-mdpi/grid_pressed.9.png
deleted file mode 100644 (file)
index c7e6b06..0000000
Binary files a/res/drawable-mdpi/grid_pressed.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/grid_selected.9.png b/res/drawable-mdpi/grid_selected.9.png
deleted file mode 100644 (file)
index e2732b7..0000000
Binary files a/res/drawable-mdpi/grid_selected.9.png and /dev/null differ
diff --git a/res/drawable-mdpi/tile_picker_focused.9.png b/res/drawable-mdpi/tile_picker_focused.9.png
new file mode 100644 (file)
index 0000000..13b325b
Binary files /dev/null and b/res/drawable-mdpi/tile_picker_focused.9.png differ
diff --git a/res/drawable-mdpi/tile_picker_pressed.9.png b/res/drawable-mdpi/tile_picker_pressed.9.png
new file mode 100644 (file)
index 0000000..4e8196d
Binary files /dev/null and b/res/drawable-mdpi/tile_picker_pressed.9.png differ
diff --git a/res/drawable-mdpi/tile_picker_selected.9.png b/res/drawable-mdpi/tile_picker_selected.9.png
new file mode 100644 (file)
index 0000000..eee69ec
Binary files /dev/null and b/res/drawable-mdpi/tile_picker_selected.9.png differ
diff --git a/res/drawable-mdpi/tile_shadow_bottom.9.png b/res/drawable-mdpi/tile_shadow_bottom.9.png
new file mode 100644 (file)
index 0000000..d95787b
Binary files /dev/null and b/res/drawable-mdpi/tile_shadow_bottom.9.png differ
diff --git a/res/drawable-mdpi/tile_shadow_top.9.png b/res/drawable-mdpi/tile_shadow_top.9.png
new file mode 100644 (file)
index 0000000..8da913c
Binary files /dev/null and b/res/drawable-mdpi/tile_shadow_top.9.png differ
diff --git a/res/drawable-xhdpi/grid_focused.9.png b/res/drawable-xhdpi/grid_focused.9.png
deleted file mode 100644 (file)
index 37228b3..0000000
Binary files a/res/drawable-xhdpi/grid_focused.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/grid_pressed.9.png b/res/drawable-xhdpi/grid_pressed.9.png
deleted file mode 100644 (file)
index 20d4647..0000000
Binary files a/res/drawable-xhdpi/grid_pressed.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/grid_selected.9.png b/res/drawable-xhdpi/grid_selected.9.png
deleted file mode 100644 (file)
index c8b9b6b..0000000
Binary files a/res/drawable-xhdpi/grid_selected.9.png and /dev/null differ
diff --git a/res/drawable-xhdpi/tile_picker_focused.9.png b/res/drawable-xhdpi/tile_picker_focused.9.png
new file mode 100644 (file)
index 0000000..279e859
Binary files /dev/null and b/res/drawable-xhdpi/tile_picker_focused.9.png differ
diff --git a/res/drawable-xhdpi/tile_picker_pressed.9.png b/res/drawable-xhdpi/tile_picker_pressed.9.png
new file mode 100644 (file)
index 0000000..abe0e00
Binary files /dev/null and b/res/drawable-xhdpi/tile_picker_pressed.9.png differ
diff --git a/res/drawable-xhdpi/tile_picker_selected.9.png b/res/drawable-xhdpi/tile_picker_selected.9.png
new file mode 100644 (file)
index 0000000..b047591
Binary files /dev/null and b/res/drawable-xhdpi/tile_picker_selected.9.png differ
diff --git a/res/drawable-xhdpi/tile_shadow_bottom.9.png b/res/drawable-xhdpi/tile_shadow_bottom.9.png
new file mode 100644 (file)
index 0000000..81571f3
Binary files /dev/null and b/res/drawable-xhdpi/tile_shadow_bottom.9.png differ
diff --git a/res/drawable-xhdpi/tile_shadow_top.9.png b/res/drawable-xhdpi/tile_shadow_top.9.png
new file mode 100644 (file)
index 0000000..8503a59
Binary files /dev/null and b/res/drawable-xhdpi/tile_shadow_top.9.png differ
diff --git a/res/drawable-xxhdpi/grid_focused.9.png b/res/drawable-xxhdpi/grid_focused.9.png
deleted file mode 100644 (file)
index a8dff7a..0000000
Binary files a/res/drawable-xxhdpi/grid_focused.9.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/grid_pressed.9.png b/res/drawable-xxhdpi/grid_pressed.9.png
deleted file mode 100644 (file)
index cbc83d1..0000000
Binary files a/res/drawable-xxhdpi/grid_pressed.9.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/grid_selected.9.png b/res/drawable-xxhdpi/grid_selected.9.png
deleted file mode 100644 (file)
index f8cd673..0000000
Binary files a/res/drawable-xxhdpi/grid_selected.9.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/tile_picker_focused.9.png b/res/drawable-xxhdpi/tile_picker_focused.9.png
new file mode 100644 (file)
index 0000000..1004c14
Binary files /dev/null and b/res/drawable-xxhdpi/tile_picker_focused.9.png differ
diff --git a/res/drawable-xxhdpi/tile_picker_pressed.9.png b/res/drawable-xxhdpi/tile_picker_pressed.9.png
new file mode 100644 (file)
index 0000000..9658444
Binary files /dev/null and b/res/drawable-xxhdpi/tile_picker_pressed.9.png differ
diff --git a/res/drawable-xxhdpi/tile_picker_selected.9.png b/res/drawable-xxhdpi/tile_picker_selected.9.png
new file mode 100644 (file)
index 0000000..a3cd303
Binary files /dev/null and b/res/drawable-xxhdpi/tile_picker_selected.9.png differ
diff --git a/res/drawable-xxhdpi/tile_shadow_bottom.9.png b/res/drawable-xxhdpi/tile_shadow_bottom.9.png
new file mode 100644 (file)
index 0000000..55250f0
Binary files /dev/null and b/res/drawable-xxhdpi/tile_shadow_bottom.9.png differ
diff --git a/res/drawable-xxhdpi/tile_shadow_top.9.png b/res/drawable-xxhdpi/tile_shadow_top.9.png
new file mode 100644 (file)
index 0000000..3f22633
Binary files /dev/null and b/res/drawable-xxhdpi/tile_shadow_top.9.png differ
similarity index 90%
rename from res/drawable/wallpaper_gallery_item.xml
rename to res/drawable/wallpaper_tile_fg.xml
index 9ac931b..c299f32 100644 (file)
@@ -15,9 +15,9 @@
 -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_checked="true" android:drawable="@drawable/grid_pressed" />
-    <item android:state_focused="true" android:drawable="@drawable/grid_focused" />
-    <item android:state_pressed="true" android:drawable="@drawable/grid_pressed" />
-    <item android:state_selected="true" android:drawable="@drawable/grid_selected" />
+    <item android:state_checked="true" android:drawable="@drawable/tile_picker_selected" />
+    <item android:state_focused="true" android:drawable="@drawable/tile_picker_focused" />
+    <item android:state_pressed="true" android:drawable="@drawable/tile_picker_pressed" />
+    <item android:state_selected="true" android:drawable="@drawable/tile_picker_selected" />
     <item android:drawable="@android:color/transparent" />
 </selector>
index 768500c..3a3d98a 100644 (file)
@@ -19,7 +19,7 @@
 -->
 
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/wallpaper_cropper"
+    android:id="@+id/wallpaper_root"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
     <com.android.launcher3.CropView
index 347a63e..a0672f6 100644 (file)
@@ -19,7 +19,7 @@
 -->
 
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/wallpaper_picker"
+    android:id="@+id/wallpaper_root"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
     <com.android.launcher3.CropView
         android:indeterminate="true"
         android:indeterminateOnly="true"
         android:background="@android:color/transparent" />
-    <HorizontalScrollView
+    <LinearLayout
         android:id="@+id/wallpaper_strip"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true" >
-        <LinearLayout android:id="@+id/wallpaper_list"
+        android:layout_alignParentBottom="true"
+        android:orientation="vertical"
+        android:fitsSystemWindows="true" >
+        <View
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal" />
-    </HorizontalScrollView>
+            android:layout_height="2dp"
+            android:background="@drawable/tile_shadow_top" />
+        <HorizontalScrollView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" >
+            <LinearLayout android:id="@+id/wallpaper_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal" />
+        </HorizontalScrollView>
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="2dp"
+            android:background="@drawable/tile_shadow_bottom" />
+    </LinearLayout>
 </RelativeLayout>
index ecfba60..976d3fa 100644 (file)
@@ -20,8 +20,8 @@
     android:layout_height="@dimen/wallpaperThumbnailHeight"
     android:focusable="true"
     android:clickable="true"
-    android:background="@drawable/wallpaper_gallery_item"
-    android:foreground="@drawable/wallpaper_gallery_item">
+    android:background="@drawable/wallpaper_tile_fg"
+    android:foreground="@drawable/wallpaper_tile_fg">
     <ImageView
         android:id="@+id/wallpaper_image"
         android:layout_width="match_parent"
index 79d45c0..0ac8f97 100644 (file)
@@ -20,8 +20,8 @@
     android:layout_height="@dimen/wallpaperThumbnailHeight"
     android:focusable="true"
     android:clickable="true"
-    android:background="@drawable/wallpaper_gallery_item"
-    android:foreground="@drawable/wallpaper_gallery_item">
+    android:background="@drawable/wallpaper_tile_fg"
+    android:foreground="@drawable/wallpaper_tile_fg">
     <ImageView
         android:id="@+id/wallpaper_image"
         android:layout_width="match_parent"
index d980967..824dea6 100644 (file)
@@ -109,8 +109,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
                     mIgnoreNextTap = true;
                 }
                 mAnim = new LauncherViewPropertyAnimator(wallpaperStrip);
-                mAnim.translationY(wallpaperStrip.getHeight())
-                    .setInterpolator(new DecelerateInterpolator(0.75f));
+                mAnim.translationY(wallpaperStrip.getHeight()).alpha(0f)
+                        .setInterpolator(new DecelerateInterpolator(0.75f));
                 mAnim.start();
             }
             public void onTap() {
@@ -121,7 +121,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
                         mAnim.cancel();
                     }
                     mAnim = new LauncherViewPropertyAnimator(wallpaperStrip);
-                    mAnim.translationY(0).setInterpolator(new DecelerateInterpolator(0.75f));
+                    mAnim.translationY(0).alpha(1f)
+                            .setInterpolator(new DecelerateInterpolator(0.75f));
                     mAnim.start();
                 }
             }
@@ -363,7 +364,16 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
         cursor.close();
         return thumb;
     }
-    
+
+    protected void onStop() {
+        super.onStop();
+        final View wallpaperStrip = findViewById(R.id.wallpaper_strip);
+        if (wallpaperStrip.getTranslationY() > 0) {
+            wallpaperStrip.setTranslationY(0);
+            wallpaperStrip.setAlpha(1f);
+        }
+    }
+
     protected void onSaveInstanceState(Bundle outState) {
         outState.putParcelableArrayList(TEMP_WALLPAPER_TILES, mTempWallpaperTiles);
     }