New folder look / assets
-> Restricting the number of items in folders
to prevent scrolling (excess items deleted)
Change-Id: I4af2590cd5ea7677c875c031f84d4d5bcca3e6e9
diff --git a/res/drawable-hdpi/portal_container_holo.9.png b/res/drawable-hdpi/portal_container_holo.9.png
index 557ee5a..ba8a4a8 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 e953221..857a01e 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 257fc69..53df36a 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 9a47517..1e4afae 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 3d704af..72e0af8 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 1dbdbe8..483f0eb 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 4ae8d22..cedbdc4 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 b9867c0..f9acfa2 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 e218713..eb2cf5f 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 286bee0..281e9b5 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 2a28f4a..599a076 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 3b93f83..8cd6a59 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 01f330c..0fad656 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 9c5c46b..4405682 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 45986e5..8ea8879 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 01fd64c..6b9221c 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 7a7a3b6..54f8846 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -20,6 +20,7 @@
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 @@
private int mPressedOutlineColor;
private int mPressedGlowColor;
+ private int mTextColor;
+ private boolean mShadowsEnabled = true;
private boolean mIsTextVisible;
private boolean mBackgroundSizeChanged;
@@ -85,6 +88,7 @@
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 @@
@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 @@
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 808d85d..47fc6c3 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -143,7 +143,8 @@
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 @@
}
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);