Enable hyphenation on most of preference.

Bug: 217659992
Bug: 231924943
Test: manual
Change-Id: I1039fbc6c0573c8ce533594a039579b4c8b00e52
diff --git a/res/layout/accessibility_launch_activity_preference.xml b/res/layout/accessibility_launch_activity_preference.xml
index 772bb84..0e3e225 100644
--- a/res/layout/accessibility_launch_activity_preference.xml
+++ b/res/layout/accessibility_launch_activity_preference.xml
@@ -33,5 +33,6 @@
         android:layout_gravity="center_vertical"
         android:ellipsize="end"
         android:textAppearance="?android:attr/textAppearanceListItem"
+        android:hyphenationFrequency="normalFast"
         style="@style/MainSwitchText.Settingslib" />
 </LinearLayout>
diff --git a/res/layout/accessibility_shortcut_secondary_action.xml b/res/layout/accessibility_shortcut_secondary_action.xml
index bdb129f..ddbadb5 100644
--- a/res/layout/accessibility_shortcut_secondary_action.xml
+++ b/res/layout/accessibility_shortcut_secondary_action.xml
@@ -59,6 +59,7 @@
                 android:layout_height="wrap_content"
                 android:singleLine="true"
                 android:textAppearance="?android:attr/textAppearanceListItem"
+                android:hyphenationFrequency="normalFast"
                 android:ellipsize="marquee" />
 
             <TextView
@@ -69,6 +70,7 @@
                 android:layout_alignStart="@android:id/title"
                 android:textAppearance="?android:attr/textAppearanceListItemSecondary"
                 android:textColor="?android:attr/textColorSecondary"
+                android:hyphenationFrequency="normalFast"
                 android:maxLines="10" />
 
         </RelativeLayout>
diff --git a/res/layout/apn_preference_layout.xml b/res/layout/apn_preference_layout.xml
index 4d98443..2c453aa 100644
--- a/res/layout/apn_preference_layout.xml
+++ b/res/layout/apn_preference_layout.xml
@@ -51,6 +51,7 @@
             android:textAppearance="?android:attr/textAppearanceListItemSecondary"
             android:textColor="?android:attr/textColorSecondary"
             android:focusable="false"
+            android:hyphenationFrequency="normalFast"
             android:maxLines="2" />
 
     </RelativeLayout>
diff --git a/res/layout/app_preference_item.xml b/res/layout/app_preference_item.xml
index 85d6bb0..c685760 100755
--- a/res/layout/app_preference_item.xml
+++ b/res/layout/app_preference_item.xml
@@ -56,6 +56,7 @@
             android:paddingEnd="7dip"
             android:ellipsize="marquee"
             android:duplicateParentState="true"
+            android:hyphenationFrequency="normalFast"
             />
         <TextView
             android:id="@android:id/summary"
@@ -67,6 +68,7 @@
             android:ellipsize="marquee"
             android:visibility="gone"
             android:duplicateParentState="true"
+            android:hyphenationFrequency="normalFast"
             />
     </LinearLayout>
     <TextView
diff --git a/res/layout/battery_active_view.xml b/res/layout/battery_active_view.xml
index bdc0328..1583b95 100644
--- a/res/layout/battery_active_view.xml
+++ b/res/layout/battery_active_view.xml
@@ -28,6 +28,7 @@
         android:layout_height="wrap_content"
         android:textAlignment="viewStart"
         android:textAppearance="?android:attr/textAppearanceMedium"
+        android:hyphenationFrequency="normalFast"
         android:textColor="?android:attr/textColorSecondary" />
 
     <com.android.settings.fuelgauge.BatteryActiveView
diff --git a/res/layout/homepage_preference.xml b/res/layout/homepage_preference.xml
index 59dc7c4..97557b0 100644
--- a/res/layout/homepage_preference.xml
+++ b/res/layout/homepage_preference.xml
@@ -62,6 +62,7 @@
             android:layout_height="wrap_content"
             android:singleLine="true"
             android:textAppearance="?android:attr/textAppearanceListItem"
+            android:hyphenationFrequency="normalFast"
             android:ellipsize="marquee"/>
 
         <TextView
@@ -75,6 +76,7 @@
             android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="?android:attr/textColorSecondary"
             android:maxLines="4"
+            android:hyphenationFrequency="normalFast"
             style="@style/PreferenceSummaryTextStyle"/>
     </RelativeLayout>
 </LinearLayout>
diff --git a/res/layout/horizontal_preference.xml b/res/layout/horizontal_preference.xml
index e50fc3f..d87963c 100644
--- a/res/layout/horizontal_preference.xml
+++ b/res/layout/horizontal_preference.xml
@@ -30,6 +30,7 @@
         android:textAppearance="?android:attr/textAppearanceListItem"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
+        android:hyphenationFrequency="normalFast"
         android:layout_weight="1" />
 
     <TextView
@@ -39,6 +40,7 @@
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
         android:layout_weight="1"
+        android:hyphenationFrequency="normalFast"
         android:gravity="end|bottom" />
 
 </LinearLayout>
diff --git a/res/layout/notification_app.xml b/res/layout/notification_app.xml
index 54060c1..2d17c8d 100644
--- a/res/layout/notification_app.xml
+++ b/res/layout/notification_app.xml
@@ -38,6 +38,7 @@
         android:ellipsize="end"
         android:singleLine="true"
         android:textAlignment="viewStart"
+        android:hyphenationFrequency="normalFast"
         android:textAppearance="?android:attr/textAppearanceMedium" />
 
     <TextView
@@ -50,6 +51,7 @@
         android:singleLine="true"
         android:textAlignment="viewStart"
         android:textColor="?android:attr/textColorSecondary"
+        android:hyphenationFrequency="normalFast"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <View
diff --git a/res/layout/preference_app_restrictions.xml b/res/layout/preference_app_restrictions.xml
index 698f1ed..f92f683 100644
--- a/res/layout/preference_app_restrictions.xml
+++ b/res/layout/preference_app_restrictions.xml
@@ -61,6 +61,7 @@
                 android:singleLine="true"
                 android:textAppearance="?android:attr/textAppearanceMedium"
                 android:ellipsize="marquee"
+                android:hyphenationFrequency="normalFast"
                 android:fadingEdge="horizontal"/>
             <TextView
                 android:id="@android:id/summary"
@@ -74,6 +75,7 @@
                 android:textSize="13sp"
                 android:textColor="?android:attr/textColorSecondary"
                 android:focusable="false"
+                android:hyphenationFrequency="normalFast"
                 android:maxLines="4" />
         </RelativeLayout>
     </LinearLayout>
diff --git a/res/layout/preference_balance_slider.xml b/res/layout/preference_balance_slider.xml
index 7f1e809..3f1c4ed 100644
--- a/res/layout/preference_balance_slider.xml
+++ b/res/layout/preference_balance_slider.xml
@@ -45,6 +45,7 @@
                 android:textAppearance="?android:attr/textAppearanceListItem"
                 android:textColor="?android:attr/textColorPrimary"
                 android:ellipsize="marquee"
+                android:hyphenationFrequency="normalFast"
                 android:fadingEdge="horizontal"/>
             <LinearLayout
                 android:id="@android:id/widget_frame"
diff --git a/res/layout/preference_icon.xml b/res/layout/preference_icon.xml
index 590a05a..1312979 100644
--- a/res/layout/preference_icon.xml
+++ b/res/layout/preference_icon.xml
@@ -57,6 +57,7 @@
             android:layout_below="@android:id/title"
             android:layout_alignStart="@android:id/title"
             android:textAppearance="?android:attr/textAppearanceSmall"
+            android:hyphenationFrequency="normalFast"
             android:maxLines="2" />
 
     </RelativeLayout>
diff --git a/res/layout/preference_labeled_slider.xml b/res/layout/preference_labeled_slider.xml
index 294b979..610b79f 100644
--- a/res/layout/preference_labeled_slider.xml
+++ b/res/layout/preference_labeled_slider.xml
@@ -35,6 +35,7 @@
         android:fadingEdge="horizontal"
         android:singleLine="true"
         android:textAppearance="?android:attr/textAppearanceListItem"
+        android:hyphenationFrequency="normalFast"
         android:textColor="?android:attr/textColorPrimary" />
 
     <TextView
@@ -44,6 +45,7 @@
         android:layout_below="@android:id/title"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textAlignment="viewStart"
+        android:hyphenationFrequency="normalFast"
         android:textColor="?android:attr/textColorSecondary" />
 
     <include
diff --git a/res/layout/preference_multiline_title.xml b/res/layout/preference_multiline_title.xml
index f64b27f..d68e8c1 100644
--- a/res/layout/preference_multiline_title.xml
+++ b/res/layout/preference_multiline_title.xml
@@ -38,6 +38,7 @@
             android:textColor="?android:attr/textColorPrimary"
             android:textAlignment="center"
             android:ellipsize="marquee"
+            android:hyphenationFrequency="normalFast"
             android:fadingEdge="horizontal" />
 
         <TextView
@@ -50,6 +51,7 @@
             android:textAlignment="viewStart"
             android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
             android:textColor="?android:attr/textColorSecondary"
+            android:hyphenationFrequency="normalFast"
             android:maxLines="10" />
 
     </RelativeLayout>
diff --git a/res/layout/preference_progress_category.xml b/res/layout/preference_progress_category.xml
index 9a22c54..9e33c5d 100644
--- a/res/layout/preference_progress_category.xml
+++ b/res/layout/preference_progress_category.xml
@@ -47,6 +47,7 @@
         android:layout_weight="1"
         android:layout_gravity="start|center"
         android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"
+        android:hyphenationFrequency="normalFast"
         android:textColor="?android:attr/colorAccent"/>
 
     <ProgressBar
diff --git a/res/layout/preference_radio_with_extra_widget.xml b/res/layout/preference_radio_with_extra_widget.xml
index c3470c0..a03f556 100644
--- a/res/layout/preference_radio_with_extra_widget.xml
+++ b/res/layout/preference_radio_with_extra_widget.xml
@@ -75,6 +75,7 @@
                   android:layout_weight="1"
                   android:textAppearance="?android:attr/textAppearanceSmall"
                   android:textAlignment="viewStart"
+                  android:hyphenationFrequency="normalFast"
                   android:textColor="?android:attr/textColorSecondary" />
     </LinearLayout>
     <LinearLayout
diff --git a/res/layout/preference_single_target.xml b/res/layout/preference_single_target.xml
index 27c33ba..ae40fd3 100644
--- a/res/layout/preference_single_target.xml
+++ b/res/layout/preference_single_target.xml
@@ -76,6 +76,7 @@
                 android:layout_alignStart="@android:id/title"
                 android:textAppearance="?android:attr/textAppearanceListItemSecondary"
                 android:textColor="?android:attr/textColorSecondary"
+                android:hyphenationFrequency="normalFast"
                 android:maxLines="10" />
 
         </RelativeLayout>
diff --git a/res/layout/preference_two_target_radio.xml b/res/layout/preference_two_target_radio.xml
index dc97f1d..e5e6d4a 100644
--- a/res/layout/preference_two_target_radio.xml
+++ b/res/layout/preference_two_target_radio.xml
@@ -73,6 +73,7 @@
                 android:layout_alignStart="@android:id/title"
                 android:textAppearance="?android:attr/textAppearanceListItemSecondary"
                 android:textColor="?android:attr/textColorSecondary"
+                android:hyphenationFrequency="normalFast"
                 android:maxLines="10" />
 
         </RelativeLayout>
diff --git a/res/layout/radio_with_summary.xml b/res/layout/radio_with_summary.xml
index 5b89591..2f39e67 100644
--- a/res/layout/radio_with_summary.xml
+++ b/res/layout/radio_with_summary.xml
@@ -33,6 +33,7 @@
         android:gravity="center_vertical"
         android:paddingStart="20dp"
         android:drawableStart="?android:attr/listChoiceIndicatorSingle"
+        android:hyphenationFrequency="normalFast"
         android:ellipsize="marquee" />
 
 
@@ -43,6 +44,7 @@
         android:paddingStart="52dp"
         android:textAppearance="?android:attr/textAppearanceListItemSecondary"
         android:textColor="?android:attr/textColorSecondary"
+        android:hyphenationFrequency="normalFast"
         android:maxLines="10" />
 
 </com.android.settings.CheckableLinearLayout>
diff --git a/res/layout/running_services_app_item.xml b/res/layout/running_services_app_item.xml
index 705d714..f258530 100644
--- a/res/layout/running_services_app_item.xml
+++ b/res/layout/running_services_app_item.xml
@@ -55,6 +55,7 @@
             android:ellipsize="marquee"
             android:fadingEdge="horizontal"
             android:maxLines="2"
+            android:hyphenationFrequency="normalFast"
             android:textAppearance="?android:attr/textAppearanceListItem"/>
 
         <TextView
@@ -63,6 +64,7 @@
             android:layout_height="wrap_content"
             android:textDirection="locale"
             android:textAppearance="?android:attr/textAppearanceSmall"
+            android:hyphenationFrequency="normalFast"
             android:textColor="?android:attr/textColorSecondary"/>
 
     </LinearLayout>
diff --git a/res/layout/settings_summary_preference.xml b/res/layout/settings_summary_preference.xml
index 61f27ca..2f899e1 100644
--- a/res/layout/settings_summary_preference.xml
+++ b/res/layout/settings_summary_preference.xml
@@ -32,6 +32,7 @@
         android:paddingTop="0dp"
         android:textColor="?android:attr/textColorPrimary"
         android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Display1"
+        android:hyphenationFrequency="normalFast"
         />
 
     <TextView android:id="@android:id/summary"
@@ -40,6 +41,7 @@
         android:textAppearance="?android:attr/textAppearanceListItemSecondary"
         android:textColor="?android:attr/textColorSecondary"
         android:paddingBottom="5dp"
+        android:hyphenationFrequency="normalFast"
         android:maxLines="10" />
 
     <ProgressBar
diff --git a/src/com/android/settings/core/SettingsBaseActivity.java b/src/com/android/settings/core/SettingsBaseActivity.java
index 7842459..2fc0ba4 100644
--- a/src/com/android/settings/core/SettingsBaseActivity.java
+++ b/src/com/android/settings/core/SettingsBaseActivity.java
@@ -15,6 +15,8 @@
  */
 package com.android.settings.core;
 
+import static android.text.Layout.HYPHENATION_FREQUENCY_NORMAL_FAST;
+
 import android.annotation.LayoutRes;
 import android.app.ActivityManager;
 import android.content.ComponentName;
@@ -106,6 +108,7 @@
             mAppBarLayout = findViewById(R.id.app_bar);
             if (mCollapsingToolbarLayout != null) {
                 mCollapsingToolbarLayout.setLineSpacingMultiplier(TOOLBAR_LINE_SPACING_MULTIPLIER);
+                mCollapsingToolbarLayout.setHyphenationFrequency(HYPHENATION_FREQUENCY_NORMAL_FAST);
             }
             disableCollapsingToolbarLayoutScrollingBehavior();
         } else {