OSDN Git Service

Adding some assets / fixing a couple bugs
authorAdam Cohen <adamcohen@google.com>
Thu, 19 Sep 2013 18:57:17 +0000 (11:57 -0700)
committerAdam Cohen <adamcohen@google.com>
Thu, 19 Sep 2013 18:58:22 +0000 (11:58 -0700)
-> Adding wallpaper, settings and widgets icons for overview mode
-> Fix issues with disappearing search bar / custom content screen
   when screen is turned off from overview mode.

Change-Id: I0904098bd642c40709e27f571e458f1b6e479c17

14 files changed:
res/drawable-hdpi/ic_gel_setting_icn.png [new file with mode: 0644]
res/drawable-hdpi/ic_gel_wallpaper_icn.png [new file with mode: 0644]
res/drawable-hdpi/ic_gel_widget_icn.png [new file with mode: 0644]
res/drawable-mdpi/ic_gel_setting_icn.png [new file with mode: 0644]
res/drawable-mdpi/ic_gel_wallpaper_icn.png [new file with mode: 0644]
res/drawable-mdpi/ic_gel_widget_icn.png [new file with mode: 0644]
res/drawable-xhdpi/ic_gel_setting_icn.png [new file with mode: 0644]
res/drawable-xhdpi/ic_gel_wallpaper_icn.png [new file with mode: 0644]
res/drawable-xhdpi/ic_gel_widget_icn.png [new file with mode: 0644]
res/drawable-xxhdpi/ic_gel_setting_icn.png [new file with mode: 0644]
res/drawable-xxhdpi/ic_gel_wallpaper_icn.png [new file with mode: 0644]
res/drawable-xxhdpi/ic_gel_widget_icn.png [new file with mode: 0644]
res/layout/overview_panel.xml
src/com/android/launcher3/Workspace.java

diff --git a/res/drawable-hdpi/ic_gel_setting_icn.png b/res/drawable-hdpi/ic_gel_setting_icn.png
new file mode 100644 (file)
index 0000000..f805947
Binary files /dev/null and b/res/drawable-hdpi/ic_gel_setting_icn.png differ
diff --git a/res/drawable-hdpi/ic_gel_wallpaper_icn.png b/res/drawable-hdpi/ic_gel_wallpaper_icn.png
new file mode 100644 (file)
index 0000000..ad13c85
Binary files /dev/null and b/res/drawable-hdpi/ic_gel_wallpaper_icn.png differ
diff --git a/res/drawable-hdpi/ic_gel_widget_icn.png b/res/drawable-hdpi/ic_gel_widget_icn.png
new file mode 100644 (file)
index 0000000..2bfd2c1
Binary files /dev/null and b/res/drawable-hdpi/ic_gel_widget_icn.png differ
diff --git a/res/drawable-mdpi/ic_gel_setting_icn.png b/res/drawable-mdpi/ic_gel_setting_icn.png
new file mode 100644 (file)
index 0000000..096e6bc
Binary files /dev/null and b/res/drawable-mdpi/ic_gel_setting_icn.png differ
diff --git a/res/drawable-mdpi/ic_gel_wallpaper_icn.png b/res/drawable-mdpi/ic_gel_wallpaper_icn.png
new file mode 100644 (file)
index 0000000..61a7b7e
Binary files /dev/null and b/res/drawable-mdpi/ic_gel_wallpaper_icn.png differ
diff --git a/res/drawable-mdpi/ic_gel_widget_icn.png b/res/drawable-mdpi/ic_gel_widget_icn.png
new file mode 100644 (file)
index 0000000..8a2cb7a
Binary files /dev/null and b/res/drawable-mdpi/ic_gel_widget_icn.png differ
diff --git a/res/drawable-xhdpi/ic_gel_setting_icn.png b/res/drawable-xhdpi/ic_gel_setting_icn.png
new file mode 100644 (file)
index 0000000..fe17163
Binary files /dev/null and b/res/drawable-xhdpi/ic_gel_setting_icn.png differ
diff --git a/res/drawable-xhdpi/ic_gel_wallpaper_icn.png b/res/drawable-xhdpi/ic_gel_wallpaper_icn.png
new file mode 100644 (file)
index 0000000..d9472d9
Binary files /dev/null and b/res/drawable-xhdpi/ic_gel_wallpaper_icn.png differ
diff --git a/res/drawable-xhdpi/ic_gel_widget_icn.png b/res/drawable-xhdpi/ic_gel_widget_icn.png
new file mode 100644 (file)
index 0000000..da6e3e9
Binary files /dev/null and b/res/drawable-xhdpi/ic_gel_widget_icn.png differ
diff --git a/res/drawable-xxhdpi/ic_gel_setting_icn.png b/res/drawable-xxhdpi/ic_gel_setting_icn.png
new file mode 100644 (file)
index 0000000..813716d
Binary files /dev/null and b/res/drawable-xxhdpi/ic_gel_setting_icn.png differ
diff --git a/res/drawable-xxhdpi/ic_gel_wallpaper_icn.png b/res/drawable-xxhdpi/ic_gel_wallpaper_icn.png
new file mode 100644 (file)
index 0000000..3525446
Binary files /dev/null and b/res/drawable-xxhdpi/ic_gel_wallpaper_icn.png differ
diff --git a/res/drawable-xxhdpi/ic_gel_widget_icn.png b/res/drawable-xxhdpi/ic_gel_widget_icn.png
new file mode 100644 (file)
index 0000000..9342437
Binary files /dev/null and b/res/drawable-xxhdpi/ic_gel_widget_icn.png differ
index e05adf2..e4f4c89 100644 (file)
@@ -26,6 +26,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/widget_button_text"
+        android:drawablePadding="4dp"
+        android:drawableTop="@drawable/ic_gel_widget_icn"
         android:textSize="18dp"/>
     <Space
         android:layout_width="@dimen/overview_panel_buttonSpacing"
@@ -35,6 +37,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/wallpaper_button_text"
+        android:drawablePadding="4dp"
+        android:drawableTop="@drawable/ic_gel_wallpaper_icn"
         android:textSize="18dp" />
     <Space
         android:layout_width="@dimen/overview_panel_buttonSpacing"
@@ -44,5 +48,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/settings_button_text"
+        android:drawablePadding="4dp"
+        android:drawableTop="@drawable/ic_gel_setting_icn"
         android:textSize="18dp" />
 </LinearLayout>
index 76d60a8..6cb6a57 100644 (file)
@@ -1931,7 +1931,8 @@ public class Workspace extends SmoothPagedView
                 AlphaUpdateListener.updateVisibility(getPageIndicator());
             }
             searchBar.setAlpha(finalSearchBarAlpha);
-            AlphaUpdateListener.updateVisibility(mLauncher.getSearchBar());
+            AlphaUpdateListener.updateVisibility(searchBar);
+            updateCustomContentVisibility();
         }
         if (finalSearchBarAlpha == 0) {
             mLauncher.setVoiceButtonProxyVisible(false);
@@ -1998,10 +1999,27 @@ public class Workspace extends SmoothPagedView
     private void onTransitionPrepare() {
         mIsSwitchingState = true;
         updateChildrenLayersEnabled(false);
-        if (mState != Workspace.State.NORMAL) {
-            if (hasCustomContent()) {
-                mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(INVISIBLE);
-            }
+        hideCustomContentIfNecessary();
+    }
+
+    void updateCustomContentVisibility() {
+        int visibility = mState == Workspace.State.NORMAL ? VISIBLE : INVISIBLE;
+        if (hasCustomContent()) {
+            mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(visibility);
+        }
+    }
+
+    void showCustomContentIfNecessary() {
+        boolean show  = mState == Workspace.State.NORMAL;
+        if (show && hasCustomContent()) {
+            mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(VISIBLE);
+        }
+    }
+
+    void hideCustomContentIfNecessary() {
+        boolean hide  = mState != Workspace.State.NORMAL;
+        if (hide && hasCustomContent()) {
+            mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(INVISIBLE);
         }
     }
 
@@ -2018,11 +2036,7 @@ public class Workspace extends SmoothPagedView
                 cl.setShortcutAndWidgetAlpha(1f);
             }
         }
-        if (mState == Workspace.State.NORMAL) {
-            if (hasCustomContent()) {
-                mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID).setVisibility(VISIBLE);
-            }
-        }
+        showCustomContentIfNecessary();
     }
 
     @Override