Loading res/drawable/ic_check_24dp.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0" android:tint="?androidprv:attr/colorAccentPrimaryVariant"> android:tint="?androidprv:attr/colorAccent"> <path android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" android:fillColor="@android:color/white"/> Loading res/layout/preference_check_icon.xml +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ --> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyboard_check_icon" android:id="@+id/check_icon" android:src="@drawable/ic_check_24dp" android:layout_width="wrap_content" android:layout_height="wrap_content" Loading src/com/android/settings/inputmethod/NewKeyboardLayoutPickerController.java +13 −12 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; import com.android.settings.widget.TickButtonPreference; import com.android.settingslib.core.lifecycle.LifecycleObserver; import com.android.settingslib.core.lifecycle.events.OnStart; import com.android.settingslib.core.lifecycle.events.OnStop; Loading @@ -38,7 +39,7 @@ import java.util.Map; public class NewKeyboardLayoutPickerController extends BasePreferenceController implements InputManager.InputDeviceListener, LifecycleObserver, OnStart, OnStop { private final InputManager mIm; private final Map<KeyboardLayoutPreference, KeyboardLayout> mPreferenceMap; private final Map<TickButtonPreference, KeyboardLayout> mPreferenceMap; private Fragment mParent; private int mInputDeviceId; Loading Loading @@ -102,16 +103,15 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController @Override public boolean handlePreferenceTreeClick(Preference preference) { if (!(preference instanceof KeyboardLayoutPreference)) { if (!(preference instanceof TickButtonPreference)) { return false; } final KeyboardLayoutPreference pref = (KeyboardLayoutPreference) preference; pref.setCheckMark(true); final TickButtonPreference pref = (TickButtonPreference) preference; pref.setSelected(true); if (mPreviousSelection != null && !mPreviousSelection.equals(preference.getKey())) { KeyboardLayoutPreference preSelectedPref = mScreen.findPreference(mPreviousSelection); preSelectedPref.setCheckMark(false); TickButtonPreference preSelectedPref = mScreen.findPreference(mPreviousSelection); preSelectedPref.setSelected(false); } setLayout(pref); mPreviousSelection = preference.getKey(); Loading Loading @@ -140,12 +140,13 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController return; } for (KeyboardLayout layout : mKeyboardLayouts) { final KeyboardLayoutPreference pref; final TickButtonPreference pref; pref = new TickButtonPreference(mScreen.getContext()); pref.setTitle(layout.getLabel()); if (mLayout.equals(layout.getLabel())) { pref = new KeyboardLayoutPreference(mScreen.getContext(), layout.getLabel(), true); pref.setSelected(true); mPreviousSelection = layout.getDescriptor(); } else { pref = new KeyboardLayoutPreference(mScreen.getContext(), layout.getLabel(), false); } pref.setKey(layout.getDescriptor()); mScreen.addPreference(pref); Loading @@ -153,7 +154,7 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController } } private void setLayout(KeyboardLayoutPreference preference) { private void setLayout(TickButtonPreference preference) { mIm.setKeyboardLayoutForInputDevice( mInputDeviceIdentifier, mUserId, Loading src/com/android/settings/regionalpreferences/NumberingSystemItemController.java +4 −3 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import com.android.internal.app.LocaleStore; import com.android.settings.core.BasePreferenceController; import com.android.settings.core.SubSettingLauncher; import com.android.settings.dashboard.DashboardFragment; import com.android.settings.widget.TickButtonPreference; import java.util.Locale; Loading Loading @@ -138,7 +139,7 @@ public class NumberingSystemItemController extends BasePreferenceController { String key = supportedLocale.getUnicodeLocaleType( ExtensionTypes.NUMBERING_SYSTEM); pref.setKey(key == null ? RegionalPreferencesDataUtils.DEFAULT_VALUE : key); pref.setTickEnable(isSameNumberingSystem(targetLocale, supportedLocale)); pref.setSelected(isSameNumberingSystem(targetLocale, supportedLocale)); screen.addPreference(pref); } } Loading @@ -162,7 +163,7 @@ public class NumberingSystemItemController extends BasePreferenceController { TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(i); Log.i(TAG, "[onPreferenceClick] key is " + pref.getKey()); if (pref.getKey().equals(preference.getKey())) { pref.setTickEnable(true); pref.setSelected(true); Locale updatedLocale = saveNumberingSystemToLocale( Locale.forLanguageTag(mSelectedLanguage), pref.getKey()); Loading @@ -176,7 +177,7 @@ public class NumberingSystemItemController extends BasePreferenceController { mParentFragment.setArguments(bundle); continue; } pref.setTickEnable(false); pref.setSelected(false); } } Loading src/com/android/settings/regionalpreferences/RegionalPreferencesFragment.java +4 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.widget.TickButtonPreference; /** A fragment to include each kind of regional preferences. */ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { Loading Loading @@ -63,7 +64,7 @@ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(i); Log.i(TAG, "[onPreferenceClick] key is " + pref.getKey()); if (pref.getKey().equals(preference.getKey())) { pref.setTickEnable(true); pref.setSelected(true); RegionalPreferencesDataUtils.savePreference( getPrefContext(), mType, Loading @@ -72,7 +73,7 @@ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { ? null : preference.getKey()); continue; } pref.setTickEnable(false); pref.setSelected(false); } return true; } Loading Loading @@ -115,7 +116,7 @@ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { String value = RegionalPreferencesDataUtils.getDefaultUnicodeExtensionData( getPrefContext(), mType); pref.setKey(item); pref.setTickEnable(!value.isEmpty() && item.equals(value)); pref.setSelected(!value.isEmpty() && item.equals(value)); mPreferenceScreen.addPreference(pref); } return super.onCreateView(inflater, container, savedInstanceState); Loading Loading
res/drawable/ic_check_24dp.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0" android:tint="?androidprv:attr/colorAccentPrimaryVariant"> android:tint="?androidprv:attr/colorAccent"> <path android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" android:fillColor="@android:color/white"/> Loading
res/layout/preference_check_icon.xml +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ --> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyboard_check_icon" android:id="@+id/check_icon" android:src="@drawable/ic_check_24dp" android:layout_width="wrap_content" android:layout_height="wrap_content" Loading
src/com/android/settings/inputmethod/NewKeyboardLayoutPickerController.java +13 −12 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; import com.android.settings.widget.TickButtonPreference; import com.android.settingslib.core.lifecycle.LifecycleObserver; import com.android.settingslib.core.lifecycle.events.OnStart; import com.android.settingslib.core.lifecycle.events.OnStop; Loading @@ -38,7 +39,7 @@ import java.util.Map; public class NewKeyboardLayoutPickerController extends BasePreferenceController implements InputManager.InputDeviceListener, LifecycleObserver, OnStart, OnStop { private final InputManager mIm; private final Map<KeyboardLayoutPreference, KeyboardLayout> mPreferenceMap; private final Map<TickButtonPreference, KeyboardLayout> mPreferenceMap; private Fragment mParent; private int mInputDeviceId; Loading Loading @@ -102,16 +103,15 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController @Override public boolean handlePreferenceTreeClick(Preference preference) { if (!(preference instanceof KeyboardLayoutPreference)) { if (!(preference instanceof TickButtonPreference)) { return false; } final KeyboardLayoutPreference pref = (KeyboardLayoutPreference) preference; pref.setCheckMark(true); final TickButtonPreference pref = (TickButtonPreference) preference; pref.setSelected(true); if (mPreviousSelection != null && !mPreviousSelection.equals(preference.getKey())) { KeyboardLayoutPreference preSelectedPref = mScreen.findPreference(mPreviousSelection); preSelectedPref.setCheckMark(false); TickButtonPreference preSelectedPref = mScreen.findPreference(mPreviousSelection); preSelectedPref.setSelected(false); } setLayout(pref); mPreviousSelection = preference.getKey(); Loading Loading @@ -140,12 +140,13 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController return; } for (KeyboardLayout layout : mKeyboardLayouts) { final KeyboardLayoutPreference pref; final TickButtonPreference pref; pref = new TickButtonPreference(mScreen.getContext()); pref.setTitle(layout.getLabel()); if (mLayout.equals(layout.getLabel())) { pref = new KeyboardLayoutPreference(mScreen.getContext(), layout.getLabel(), true); pref.setSelected(true); mPreviousSelection = layout.getDescriptor(); } else { pref = new KeyboardLayoutPreference(mScreen.getContext(), layout.getLabel(), false); } pref.setKey(layout.getDescriptor()); mScreen.addPreference(pref); Loading @@ -153,7 +154,7 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController } } private void setLayout(KeyboardLayoutPreference preference) { private void setLayout(TickButtonPreference preference) { mIm.setKeyboardLayoutForInputDevice( mInputDeviceIdentifier, mUserId, Loading
src/com/android/settings/regionalpreferences/NumberingSystemItemController.java +4 −3 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import com.android.internal.app.LocaleStore; import com.android.settings.core.BasePreferenceController; import com.android.settings.core.SubSettingLauncher; import com.android.settings.dashboard.DashboardFragment; import com.android.settings.widget.TickButtonPreference; import java.util.Locale; Loading Loading @@ -138,7 +139,7 @@ public class NumberingSystemItemController extends BasePreferenceController { String key = supportedLocale.getUnicodeLocaleType( ExtensionTypes.NUMBERING_SYSTEM); pref.setKey(key == null ? RegionalPreferencesDataUtils.DEFAULT_VALUE : key); pref.setTickEnable(isSameNumberingSystem(targetLocale, supportedLocale)); pref.setSelected(isSameNumberingSystem(targetLocale, supportedLocale)); screen.addPreference(pref); } } Loading @@ -162,7 +163,7 @@ public class NumberingSystemItemController extends BasePreferenceController { TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(i); Log.i(TAG, "[onPreferenceClick] key is " + pref.getKey()); if (pref.getKey().equals(preference.getKey())) { pref.setTickEnable(true); pref.setSelected(true); Locale updatedLocale = saveNumberingSystemToLocale( Locale.forLanguageTag(mSelectedLanguage), pref.getKey()); Loading @@ -176,7 +177,7 @@ public class NumberingSystemItemController extends BasePreferenceController { mParentFragment.setArguments(bundle); continue; } pref.setTickEnable(false); pref.setSelected(false); } } Loading
src/com/android/settings/regionalpreferences/RegionalPreferencesFragment.java +4 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.SettingsPreferenceFragment; import com.android.settings.widget.TickButtonPreference; /** A fragment to include each kind of regional preferences. */ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { Loading Loading @@ -63,7 +64,7 @@ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { TickButtonPreference pref = (TickButtonPreference) mPreferenceScreen.getPreference(i); Log.i(TAG, "[onPreferenceClick] key is " + pref.getKey()); if (pref.getKey().equals(preference.getKey())) { pref.setTickEnable(true); pref.setSelected(true); RegionalPreferencesDataUtils.savePreference( getPrefContext(), mType, Loading @@ -72,7 +73,7 @@ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { ? null : preference.getKey()); continue; } pref.setTickEnable(false); pref.setSelected(false); } return true; } Loading Loading @@ -115,7 +116,7 @@ public class RegionalPreferencesFragment extends SettingsPreferenceFragment { String value = RegionalPreferencesDataUtils.getDefaultUnicodeExtensionData( getPrefContext(), mType); pref.setKey(item); pref.setTickEnable(!value.isEmpty() && item.equals(value)); pref.setSelected(!value.isEmpty() && item.equals(value)); mPreferenceScreen.addPreference(pref); } return super.onCreateView(inflater, container, savedInstanceState); Loading