New folder look / assets

-> Restricting the number of items in folders
   to prevent scrolling (excess items deleted)

Change-Id: I4af2590cd5ea7677c875c031f84d4d5bcca3e6e9
This commit is contained in:
Adam Cohen
2013-09-20 12:05:49 -07:00
parent 89f9705077
commit 477828cc83
18 changed files with 32 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -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"

View File

@@ -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"

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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);