summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-09-20 12:05:49 -0700
committerAdam Cohen <adamcohen@google.com>2013-09-20 14:13:44 -0700
commit477828cc83b60a17eb9b6fc8ee08b4abbc3d2fb1 (patch)
treec22828ede8209ec8da2290c246b47f6108849caf
parent89f9705077c054b541af7da52be832760e2ae2e8 (diff)
downloadandroid_packages_apps_Trebuchet-477828cc83b60a17eb9b6fc8ee08b4abbc3d2fb1.tar.gz
android_packages_apps_Trebuchet-477828cc83b60a17eb9b6fc8ee08b4abbc3d2fb1.tar.bz2
android_packages_apps_Trebuchet-477828cc83b60a17eb9b6fc8ee08b4abbc3d2fb1.zip
New folder look / assets
-> Restricting the number of items in folders to prevent scrolling (excess items deleted) Change-Id: I4af2590cd5ea7677c875c031f84d4d5bcca3e6e9
-rw-r--r--res/drawable-hdpi/portal_container_holo.9.pngbin1407 -> 1384 bytes
-rw-r--r--res/drawable-hdpi/portal_ring_inner_holo.pngbin9284 -> 4429 bytes
-rw-r--r--res/drawable-hdpi/portal_ring_inner_nolip_holo.pngbin2924 -> 4118 bytes
-rw-r--r--res/drawable-mdpi/portal_container_holo.9.pngbin864 -> 843 bytes
-rw-r--r--res/drawable-mdpi/portal_ring_inner_holo.pngbin4991 -> 2779 bytes
-rw-r--r--res/drawable-mdpi/portal_ring_inner_nolip_holo.pngbin1772 -> 2632 bytes
-rw-r--r--res/drawable-xhdpi/portal_container_holo.9.pngbin2019 -> 2130 bytes
-rw-r--r--res/drawable-xhdpi/portal_ring_inner_holo.pngbin14349 -> 6711 bytes
-rw-r--r--res/drawable-xhdpi/portal_ring_inner_nolip_holo.pngbin4283 -> 6191 bytes
-rw-r--r--res/drawable-xhdpi/portal_ring_outer_holo.pngbin10068 -> 17212 bytes
-rw-r--r--res/drawable-xxhdpi/portal_container_holo.9.pngbin3702 -> 4096 bytes
-rw-r--r--res/drawable-xxhdpi/portal_ring_inner_holo.pngbin20462 -> 10046 bytes
-rw-r--r--res/drawable-xxhdpi/portal_ring_inner_nolip_holo.pngbin8026 -> 9127 bytes
-rw-r--r--res/layout/folder_icon.xml1
-rw-r--r--res/layout/user_folder.xml2
-rw-r--r--res/values/colors.xml1
-rw-r--r--src/com/android/launcher3/BubbleTextView.java25
-rw-r--r--src/com/android/launcher3/Folder.java9
18 files changed, 32 insertions, 6 deletions
diff --git a/res/drawable-hdpi/portal_container_holo.9.png b/res/drawable-hdpi/portal_container_holo.9.png
index 557ee5a98..ba8a4a8cd 100644
--- a/res/drawable-hdpi/portal_container_holo.9.png
+++ b/res/drawable-hdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_inner_holo.png b/res/drawable-hdpi/portal_ring_inner_holo.png
index e95322156..857a01ec4 100644
--- a/res/drawable-hdpi/portal_ring_inner_holo.png
+++ b/res/drawable-hdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-hdpi/portal_ring_inner_nolip_holo.png b/res/drawable-hdpi/portal_ring_inner_nolip_holo.png
index 257fc691b..53df36a43 100644
--- a/res/drawable-hdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-hdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_container_holo.9.png b/res/drawable-mdpi/portal_container_holo.9.png
index 9a4751730..1e4afae76 100644
--- a/res/drawable-mdpi/portal_container_holo.9.png
+++ b/res/drawable-mdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_inner_holo.png b/res/drawable-mdpi/portal_ring_inner_holo.png
index 3d704af65..72e0af8f8 100644
--- a/res/drawable-mdpi/portal_ring_inner_holo.png
+++ b/res/drawable-mdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-mdpi/portal_ring_inner_nolip_holo.png b/res/drawable-mdpi/portal_ring_inner_nolip_holo.png
index 1dbdbe841..483f0ebec 100644
--- a/res/drawable-mdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-mdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_container_holo.9.png b/res/drawable-xhdpi/portal_container_holo.9.png
index 4ae8d223b..cedbdc401 100644
--- a/res/drawable-xhdpi/portal_container_holo.9.png
+++ b/res/drawable-xhdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_inner_holo.png b/res/drawable-xhdpi/portal_ring_inner_holo.png
index b9867c0d9..f9acfa284 100644
--- a/res/drawable-xhdpi/portal_ring_inner_holo.png
+++ b/res/drawable-xhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png b/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png
index e218713e4..eb2cf5f8b 100644
--- a/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-xhdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/portal_ring_outer_holo.png b/res/drawable-xhdpi/portal_ring_outer_holo.png
index 286bee039..281e9b565 100644
--- a/res/drawable-xhdpi/portal_ring_outer_holo.png
+++ b/res/drawable-xhdpi/portal_ring_outer_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_container_holo.9.png b/res/drawable-xxhdpi/portal_container_holo.9.png
index 2a28f4aa7..599a076d8 100644
--- a/res/drawable-xxhdpi/portal_container_holo.9.png
+++ b/res/drawable-xxhdpi/portal_container_holo.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_inner_holo.png b/res/drawable-xxhdpi/portal_ring_inner_holo.png
index 3b93f8342..8cd6a5930 100644
--- a/res/drawable-xxhdpi/portal_ring_inner_holo.png
+++ b/res/drawable-xxhdpi/portal_ring_inner_holo.png
Binary files differ
diff --git a/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png b/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
index 01f330c13..0fad65629 100644
--- a/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
+++ b/res/drawable-xxhdpi/portal_ring_inner_nolip_holo.png
Binary files differ
diff --git a/res/layout/folder_icon.xml b/res/layout/folder_icon.xml
index 9c5c46bd8..44056828c 100644
--- a/res/layout/folder_icon.xml
+++ b/res/layout/folder_icon.xml
@@ -26,6 +26,7 @@
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:antialias="true"
android:src="@drawable/portal_ring_inner_holo"/>
<com.android.launcher3.BubbleTextView
style="@style/WorkspaceIcon"
diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml
index 45986e532..8ea88799f 100644
--- a/res/layout/user_folder.xml
+++ b/res/layout/user_folder.xml
@@ -44,7 +44,7 @@
android:background="#00000000"
android:hint="@string/folder_hint_text"
android:textSize="14sp"
- android:textColor="#ff33b5e5"
+ android:textColor="#ff777777"
android:textColorHighlight="#ff333333"
android:gravity="center_horizontal"
android:singleLine="true"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 01fd64c7c..6b9221c33 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -33,4 +33,5 @@
<color name="apps_customize_icon_text_color">#FFF</color>
<color name="wallpaper_picker_translucent_gray">#66000000</color>
+ <color name="folder_items_text_color">#FF333333</color>
</resources>
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 7a7a3b61f..54f8846b1 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Region.Op;
@@ -55,6 +56,8 @@ public class BubbleTextView extends TextView {
private int mPressedOutlineColor;
private int mPressedGlowColor;
+ private int mTextColor;
+ private boolean mShadowsEnabled = true;
private boolean mIsTextVisible;
private boolean mBackgroundSizeChanged;
@@ -85,6 +88,7 @@ public class BubbleTextView extends TextView {
LauncherAppState app = LauncherAppState.getInstance();
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize);
+ setTextColor(getResources().getColor(R.color.workspace_icon_text_color));
}
private void init() {
@@ -290,6 +294,11 @@ public class BubbleTextView extends TextView {
@Override
public void draw(Canvas canvas) {
+ if (!mShadowsEnabled) {
+ super.draw(canvas);
+ return;
+ }
+
final Drawable background = mBackground;
if (background != null) {
final int scrollX = getScrollX();
@@ -340,12 +349,24 @@ public class BubbleTextView extends TextView {
if (mBackground != null) mBackground.setCallback(null);
}
+ @Override
+ public void setTextColor(int color) {
+ mTextColor = color;
+ super.setTextColor(color);
+ }
+
+ public void setShadowsEnabled(boolean enabled) {
+ mShadowsEnabled = enabled;
+ getPaint().clearShadowLayer();
+ invalidate();
+ }
+
public void setTextVisibility(boolean visible) {
Resources res = getResources();
if (visible) {
- setTextColor(res.getColor(R.color.workspace_icon_text_color));
+ super.setTextColor(mTextColor);
} else {
- setTextColor(res.getColor(android.R.color.transparent));
+ super.setTextColor(res.getColor(android.R.color.transparent));
}
mIsTextVisible = visible;
}
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 808d85d66..47fc6c3f4 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -143,7 +143,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
Resources res = getResources();
mMaxCountX = (int) grid.numColumns;
- mMaxCountY = mMaxNumItems = Integer.MAX_VALUE;
+ mMaxCountY = (int) grid.numRows;
+ mMaxNumItems = mMaxCountX * mMaxCountY;
mInputMethodManager = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
@@ -526,12 +527,14 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
}
protected boolean createAndAddShortcut(ShortcutInfo item) {
- final TextView textView =
- (TextView) mInflater.inflate(R.layout.application, this, false);
+ final BubbleTextView textView =
+ (BubbleTextView) mInflater.inflate(R.layout.application, this, false);
textView.setCompoundDrawablesWithIntrinsicBounds(null,
new FastBitmapDrawable(item.getIcon(mIconCache)), null, null);
textView.setText(item.title);
textView.setTag(item);
+ textView.setTextColor(getResources().getColor(R.color.folder_items_text_color));
+ textView.setShadowsEnabled(false);
textView.setOnClickListener(this);
textView.setOnLongClickListener(this);