Loading res/layout/widgets_list_row_header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ android:id="@+id/app_subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="n widgets" /> tools:text="m widgets, n shortcuts" /> </LinearLayout> Loading res/values/strings.xml +15 −4 Original line number Diff line number Diff line Loading @@ -52,11 +52,22 @@ <string name="add_item_request_drag_hint">Touch & hold to place manually</string> <!-- Button label to automatically add icon on home screen [CHAR_LIMIT=50] --> <string name="place_automatically">Add automatically</string> <!-- Label for showing the number of widgets an app has in the full widgets picker. [CHAR_LIMIT=25] --> <plurals name="widgets_tray_subtitle"> <item quantity="one"><xliff:g id="widget_count" example="1">%1$d</xliff:g> widget</item> <item quantity="other"><xliff:g id="widget_count" example="2">%1$d</xliff:g> widgets</item> <!-- Label for showing the number of widgets an app has in the full widgets picker. [CHAR_LIMIT=25] --> <plurals name="widgets_count"> <item quantity="one"><xliff:g id="widgets_count" example="1">%1$d</xliff:g> widget</item> <item quantity="other"><xliff:g id="widgets_count" example="2">%1$d</xliff:g> widgets</item> </plurals> <!-- Label for showing the number of shortcut an app has in the full widgets picker. [CHAR_LIMIT=25] --> <plurals name="shortcuts_count"> <item quantity="one"><xliff:g id="shortcuts_count" example="1">%1$d</xliff:g> shortcut</item> <item quantity="other"><xliff:g id="shortcuts_count" example="2">%1$d</xliff:g> shortcuts</item> </plurals> <!-- Label for showing both the number of widgets and shortcuts an app has in the full widgets picker. [CHAR_LIMIT=50] --> <string name="widgets_and_shortcuts_count"><xliff:g id="widgets_count" example="5 widgets">%1$s</xliff:g>, <xliff:g id="shortcuts_count" example="1 shortcut">%2$s</xliff:g></string> <!-- Text for both the tile of a popup view, which shows all available widgets installed on the device, and the text of a button, which opens this popup view. [CHAR LIMIT=30]--> <string name="widget_button_text">Widgets</string> Loading src/com/android/launcher3/widget/picker/WidgetsListHeader.java +21 −6 Original line number Diff line number Diff line Loading @@ -157,14 +157,29 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd private void setTitles(WidgetsListHeaderEntry entry) { mTitle.setText(entry.mPkgItem.title); if (entry.widgetsCount > 0) { Resources resources = getContext().getResources(); mSubtitle.setText(resources.getQuantityString(R.plurals.widgets_tray_subtitle, entry.widgetsCount, entry.widgetsCount)); mSubtitle.setVisibility(VISIBLE); } else { if (entry.widgetsCount == 0 && entry.shortcutsCount == 0) { mSubtitle.setVisibility(GONE); return; } String subtitle; if (entry.widgetsCount > 0 && entry.shortcutsCount > 0) { String widgetsCount = resources.getQuantityString(R.plurals.widgets_count, entry.widgetsCount, entry.widgetsCount); String shortcutsCount = resources.getQuantityString(R.plurals.shortcuts_count, entry.shortcutsCount, entry.shortcutsCount); subtitle = resources.getString(R.string.widgets_and_shortcuts_count, widgetsCount, shortcutsCount); } else if (entry.widgetsCount > 0) { subtitle = resources.getQuantityString(R.plurals.widgets_count, entry.widgetsCount, entry.widgetsCount); } else { subtitle = resources.getQuantityString(R.plurals.shortcuts_count, entry.shortcutsCount, entry.shortcutsCount); } mSubtitle.setText(subtitle); mSubtitle.setVisibility(VISIBLE); } @Override Loading Loading
res/layout/widgets_list_row_header.xml +1 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ android:id="@+id/app_subtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="n widgets" /> tools:text="m widgets, n shortcuts" /> </LinearLayout> Loading
res/values/strings.xml +15 −4 Original line number Diff line number Diff line Loading @@ -52,11 +52,22 @@ <string name="add_item_request_drag_hint">Touch & hold to place manually</string> <!-- Button label to automatically add icon on home screen [CHAR_LIMIT=50] --> <string name="place_automatically">Add automatically</string> <!-- Label for showing the number of widgets an app has in the full widgets picker. [CHAR_LIMIT=25] --> <plurals name="widgets_tray_subtitle"> <item quantity="one"><xliff:g id="widget_count" example="1">%1$d</xliff:g> widget</item> <item quantity="other"><xliff:g id="widget_count" example="2">%1$d</xliff:g> widgets</item> <!-- Label for showing the number of widgets an app has in the full widgets picker. [CHAR_LIMIT=25] --> <plurals name="widgets_count"> <item quantity="one"><xliff:g id="widgets_count" example="1">%1$d</xliff:g> widget</item> <item quantity="other"><xliff:g id="widgets_count" example="2">%1$d</xliff:g> widgets</item> </plurals> <!-- Label for showing the number of shortcut an app has in the full widgets picker. [CHAR_LIMIT=25] --> <plurals name="shortcuts_count"> <item quantity="one"><xliff:g id="shortcuts_count" example="1">%1$d</xliff:g> shortcut</item> <item quantity="other"><xliff:g id="shortcuts_count" example="2">%1$d</xliff:g> shortcuts</item> </plurals> <!-- Label for showing both the number of widgets and shortcuts an app has in the full widgets picker. [CHAR_LIMIT=50] --> <string name="widgets_and_shortcuts_count"><xliff:g id="widgets_count" example="5 widgets">%1$s</xliff:g>, <xliff:g id="shortcuts_count" example="1 shortcut">%2$s</xliff:g></string> <!-- Text for both the tile of a popup view, which shows all available widgets installed on the device, and the text of a button, which opens this popup view. [CHAR LIMIT=30]--> <string name="widget_button_text">Widgets</string> Loading
src/com/android/launcher3/widget/picker/WidgetsListHeader.java +21 −6 Original line number Diff line number Diff line Loading @@ -157,14 +157,29 @@ public final class WidgetsListHeader extends LinearLayout implements ItemInfoUpd private void setTitles(WidgetsListHeaderEntry entry) { mTitle.setText(entry.mPkgItem.title); if (entry.widgetsCount > 0) { Resources resources = getContext().getResources(); mSubtitle.setText(resources.getQuantityString(R.plurals.widgets_tray_subtitle, entry.widgetsCount, entry.widgetsCount)); mSubtitle.setVisibility(VISIBLE); } else { if (entry.widgetsCount == 0 && entry.shortcutsCount == 0) { mSubtitle.setVisibility(GONE); return; } String subtitle; if (entry.widgetsCount > 0 && entry.shortcutsCount > 0) { String widgetsCount = resources.getQuantityString(R.plurals.widgets_count, entry.widgetsCount, entry.widgetsCount); String shortcutsCount = resources.getQuantityString(R.plurals.shortcuts_count, entry.shortcutsCount, entry.shortcutsCount); subtitle = resources.getString(R.string.widgets_and_shortcuts_count, widgetsCount, shortcutsCount); } else if (entry.widgetsCount > 0) { subtitle = resources.getQuantityString(R.plurals.widgets_count, entry.widgetsCount, entry.widgetsCount); } else { subtitle = resources.getQuantityString(R.plurals.shortcuts_count, entry.shortcutsCount, entry.shortcutsCount); } mSubtitle.setText(subtitle); mSubtitle.setVisibility(VISIBLE); } @Override Loading