Wrap shortcuts to second line
Some system shortcuts are mostly truncated in other localizations. This fixes the issue allowing shortcuts to extend into a second line.
Screenshot:
https://screenshot.googleplex.com/CuTHVNn6PoC
https://screenshot.googleplex.com/yhwuLmbG7UX
Bug: 158182711
Change-Id: Ie5c2943be524c499c4444a9a54217f207a4684fd
diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
index 4b7097a..881df1b 100644
--- a/res/layout/system_shortcut.xml
+++ b/res/layout/system_shortcut.xml
@@ -22,7 +22,7 @@
android:theme="@style/PopupItem" >
<com.android.launcher3.BubbleTextView
- style="@style/BaseIcon"
+ style="@style/BaseIconUnBounded"
android:id="@+id/bubble_text"
android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
@@ -30,6 +30,7 @@
android:paddingStart="@dimen/deep_shortcuts_text_padding_start"
android:paddingEnd="@dimen/popup_padding_end"
android:textSize="14sp"
+ android:maxLines="2"
android:textColor="?android:attr/textColorPrimary"
launcher:iconDisplay="shortcut_popup"
launcher:layoutHorizontal="true"
diff --git a/res/values/styles.xml b/res/values/styles.xml
index ac00488..ac3c182 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -194,21 +194,24 @@
<item name="disabledIconAlpha">.28</item>
</style>
- <!-- Base theme for BubbleTextView and sub classes -->
- <style name="BaseIcon" parent="@android:style/TextAppearance.DeviceDefault">
+
+ <style name="BaseIconUnBounded" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_gravity">center</item>
<item name="android:focusable">true</item>
<item name="android:gravity">center_horizontal</item>
- <item name="android:lines">1</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:defaultFocusHighlightEnabled">false</item>
-
<!-- No shadows in the base theme -->
<item name="android:shadowRadius">0</item>
</style>
+ <!-- Base theme for BubbleTextView and sub classes -->
+ <style name="BaseIcon" parent="BaseIconUnBounded">
+ <item name="android:lines">1</item>
+ </style>
+
<!-- Icon displayed on the workspace -->
<style name="BaseIcon.Workspace" >
<item name="android:shadowRadius">2.0</item>