WidgetTray UI improvement
- Long application title should be ellipsized
- Disable the drawable when the view is no longer attached to the window
- Save the PackageItemInfo to the WidgetModel once full res icon bitmap is loaded
b/19897708
Change-Id: I96f260f9d165b206905a127fcee9879556c3d0c4
diff --git a/res/layout/widget_cell.xml b/res/layout/widget_cell.xml
index 1286a62..9e91f67 100644
--- a/res/layout/widget_cell.xml
+++ b/res/layout/widget_cell.xml
@@ -41,7 +41,7 @@
android:layout_weight="1"
android:gravity="start"
android:singleLine="true"
- android:ellipsize="marquee"
+ android:ellipsize="end"
android:fadingEdge="horizontal"
android:textColor="#FFFFFFFF"
diff --git a/res/layout/widgets_list_row_view.xml b/res/layout/widgets_list_row_view.xml
index c7863c7..017b450 100644
--- a/res/layout/widgets_list_row_view.xml
+++ b/res/layout/widgets_list_row_view.xml
@@ -52,6 +52,8 @@
android:paddingTop="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
+ android:singleLine="true"
+ android:ellipsize="end"
android:gravity="start|center_vertical"
android:textColor="@color/widgets_view_section_text_color"
android:background="@color/widget_text_panel"
diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java
index ccd67ce..93ee94a 100644
--- a/src/com/android/launcher3/widget/WidgetCell.java
+++ b/src/com/android/launcher3/widget/WidgetCell.java
@@ -120,7 +120,7 @@
Log.d(TAG, String.format("[tag=%s] onDetachedFromWindow", getTagToString()));
}
super.onDetachedFromWindow();
- deletePreview(false);
+ deletePreview(true);
}
public void deletePreview(boolean recycleImage) {
diff --git a/src/com/android/launcher3/widget/WidgetsListAdapter.java b/src/com/android/launcher3/widget/WidgetsListAdapter.java
index d0d1e60..8d1f20c 100644
--- a/src/com/android/launcher3/widget/WidgetsListAdapter.java
+++ b/src/com/android/launcher3/widget/WidgetsListAdapter.java
@@ -124,6 +124,7 @@
if (infoOut.usingLowResIcon) {
mIconCache.getTitleAndIconForApp(packageName, UserHandleCompat.myUserHandle(),
false /* useLowResIcon */, infoOut);
+ mWidgetsModel.setPackageItemInfo(packageName, infoOut);
}
((TextView) holder.getContent().findViewById(R.id.section)).setText(infoOut.title);
ImageView iv = (ImageView) holder.getContent().findViewById(R.id.section_image);
diff --git a/src/com/android/launcher3/widget/WidgetsModel.java b/src/com/android/launcher3/widget/WidgetsModel.java
index c400d63..463c79e 100644
--- a/src/com/android/launcher3/widget/WidgetsModel.java
+++ b/src/com/android/launcher3/widget/WidgetsModel.java
@@ -133,4 +133,8 @@
}
});
}
+
+ public void setPackageItemInfo(String packageName, PackageItemInfo infoOut) {
+ mPackageItemInfoList.put(packageName, infoOut);
+ }
}