OSDN Git Service

Merge "Implemented onRestrictBackgroundBlacklistChanged()." into nyc-dev
authorTreeHugger Robot <treehugger-gerrit@google.com>
Tue, 17 May 2016 18:28:20 +0000 (18:28 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 17 May 2016 18:28:21 +0000 (18:28 +0000)
res/layout/preference_tts_engine.xml
res/layout/setup_redaction_interstitial.xml
src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
src/com/android/settings/inputmethod/SpellCheckersSettings.java
src/com/android/settings/notification/ZenModeSettingsBase.java
src/com/android/settings/tts/TtsEnginePreference.java

index db0febe..fe8e967 100644 (file)
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
+    android:layout_height="?android:attr/listPreferredItemHeight"
     android:paddingStart="?android:attr/listPreferredItemPaddingStart"
     android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
-    android:minHeight="?android:attr/listPreferredItemHeight"
-    android:gravity="center_vertical">
+    android:layout_gravity="center_vertical">
 
-    <LinearLayout
-        android:id="@+id/tts_engine_pref"
+    <RadioButton
+        android:id="@+id/tts_engine_radiobutton"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
-        android:layout_weight="1"
-        android:gravity="center_vertical"
         android:clickable="true"
-        android:focusable="true"
-        android:background="?android:attr/selectableItemBackground">
-
-        <RadioButton
-            android:id="@+id/tts_engine_radiobutton"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_gravity="center_vertical"
-            android:orientation="vertical"
-            android:clickable="true" />
-
-        <RelativeLayout
-            android:id="@+id/tts_engine_pref_text"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="15dip"
-            android:layout_marginEnd="6dip"
-            android:layout_marginTop="6dip"
-            android:layout_marginBottom="6dip"
-            android:layout_weight="1">
-
-            <TextView
-                android:id="@android:id/title"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:textAppearance="?android:attr/textAppearanceMedium"
-                android:ellipsize="marquee"
-                android:fadingEdge="horizontal"/>
-
-            <TextView
-                android:id="@android:id/summary"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_below="@android:id/title"
-                android:layout_alignStart="@android:id/title"
-                android:visibility="gone"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:textSize="13sp"
-                android:textColor="?android:attr/textColorSecondary"
-                android:maxLines="4" />
-
-        </RelativeLayout>
-
-    </LinearLayout>
+        android:textAppearance="?android:attr/textAppearanceMedium" />
 
     <View
-        android:layout_width="2dip"
+        android:layout_width="0dp"
         android:layout_height="match_parent"
-        android:layout_marginTop="5dip"
-        android:layout_marginBottom="5dip"
+        android:layout_weight="1"
         android:background="@android:drawable/divider_horizontal_dark" />
 
     <ImageView
         android:id="@+id/tts_engine_settings"
         android:layout_width="wrap_content"
-        android:layout_height="fill_parent"
-        android:paddingStart="15dip"
-        android:paddingEnd="?android:attr/scrollbarSize"
+        android:layout_height="match_parent"
+        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
         android:src="@drawable/ic_sysbar_quicksettings"
         android:contentDescription="@string/tts_engine_settings_button"
-        android:layout_gravity="center"
+        android:layout_centerVertical="true"
         android:clickable="true"
         android:focusable="true"
         android:background="?android:attr/selectableItemBackground" />
-
 </LinearLayout>
index 40b4215..1b96d20 100644 (file)
@@ -74,7 +74,7 @@
 
             <!-- Place the checkbox inside RadioGroup and use SuwRadioButton style instead of
                  SuwCheckBox style so that the checkbox and text is aligned with radio buttons. -->
-            <com.android.settings.RestrictedRadioButton
+            <com.android.settings.RestrictedCheckBox
                 android:id="@+id/lockscreen_remote_input"
                 style="@style/SuwRadioButton"
                 android:layout_width="wrap_content"
index de6c699..0117a69 100644 (file)
@@ -258,7 +258,7 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
     }
 
     private void toggleKeyboardShortcutsMenu() {
-        getActivity().requestKeyboardShortcutsHelper();
+        getActivity().requestShowKeyboardShortcuts();
     }
 
     private final OnPreferenceChangeListener mShowVirtualKeyboardSwitchPreferenceChangeListener =
index 3309af2..de013e0 100644 (file)
@@ -44,6 +44,7 @@ public class SpellCheckersSettings extends SettingsPreferenceFragment
     private static final boolean DBG = false;
 
     private static final String KEY_SPELL_CHECKER_LANGUAGE = "spellchecker_language";
+    private static final String KEY_DEFAULT_SPELL_CHECKER = "default_spellchecker";
     private static final int ITEM_ID_USE_SYSTEM_LANGUAGE = 0;
 
     private SwitchBar mSwitchBar;
@@ -82,6 +83,7 @@ public class SpellCheckersSettings extends SettingsPreferenceFragment
         } else {
             pref.setSummary(R.string.spell_checker_not_selected);
         }
+        pref.setKey(KEY_DEFAULT_SPELL_CHECKER);
         pref.setOnPreferenceChangeListener(this);
         getPreferenceScreen().addPreference(pref);
     }
index 7864244..6a9431e 100644 (file)
@@ -96,11 +96,15 @@ abstract public class ZenModeSettingsBase extends RestrictedSettingsFragment {
     }
 
     protected String addZenRule(AutomaticZenRule rule) {
-        String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
-        final AutomaticZenRule savedRule =
-                NotificationManager.from(mContext).getAutomaticZenRule(id);
-        maybeRefreshRules(savedRule != null, true);
-        return id;
+        try {
+            String id = NotificationManager.from(mContext).addAutomaticZenRule(rule);
+            final AutomaticZenRule savedRule =
+                    NotificationManager.from(mContext).getAutomaticZenRule(id);
+            maybeRefreshRules(savedRule != null, true);
+            return id;
+        } catch (Exception e) {
+            return null;
+        }
     }
 
     protected boolean setZenRule(String id, AutomaticZenRule rule) {
index 35ecf86..385b861 100644 (file)
@@ -106,7 +106,7 @@ public class TtsEnginePreference extends Preference {
         setKey(mEngineInfo.name);
         setTitle(mEngineInfo.label);
     }
-    
+
     @Override
     public void onBindViewHolder(PreferenceViewHolder view) {
         super.onBindViewHolder(view);
@@ -118,6 +118,7 @@ public class TtsEnginePreference extends Preference {
 
         final RadioButton rb = (RadioButton) view.findViewById(R.id.tts_engine_radiobutton);
         rb.setOnCheckedChangeListener(mRadioChangeListener);
+        rb.setText(mEngineInfo.label);
 
         boolean isChecked = getKey().equals(mSharedState.getCurrentKey());
         if (isChecked) {
@@ -130,14 +131,6 @@ public class TtsEnginePreference extends Preference {
 
         mRadioButton = rb;
 
-        View textLayout = view.findViewById(R.id.tts_engine_pref_text);
-        textLayout.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                onRadioButtonClicked(rb, !rb.isChecked());
-            }
-        });
-
         mSettingsIcon = view.findViewById(R.id.tts_engine_settings);
         // Will be enabled only the engine has passed the voice check, and
         // is currently enabled.