am 34cde781: am 0de52fa6: Merge "Use SwitchPreference for spell checker setting" into lmp-dev
* commit '34cde7817426eb2e9f20fd74cd2efc9d338409f5': Use SwitchPreference for spell checker settingmain
commit
b2fa1a593e
|
@ -24,14 +24,14 @@ import android.preference.SwitchPreference;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
class TwoStatePreferenceHelper {
|
public class TwoStatePreferenceHelper {
|
||||||
private static final String EMPTY_TEXT = "";
|
private static final String EMPTY_TEXT = "";
|
||||||
|
|
||||||
private TwoStatePreferenceHelper() {
|
private TwoStatePreferenceHelper() {
|
||||||
// This utility class is not publicly instantiable.
|
// This utility class is not publicly instantiable.
|
||||||
}
|
}
|
||||||
|
|
||||||
static void replaceCheckBoxPreferencesBySwitchPreferences(final PreferenceGroup group) {
|
public static void replaceCheckBoxPreferencesBySwitchPreferences(final PreferenceGroup group) {
|
||||||
// The keyboard settings keeps using a CheckBoxPreference on KitKat or previous.
|
// The keyboard settings keeps using a CheckBoxPreference on KitKat or previous.
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -21,26 +21,20 @@ import android.preference.PreferenceFragment;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
|
|
||||||
import com.android.inputmethod.latin.R;
|
import com.android.inputmethod.latin.R;
|
||||||
|
import com.android.inputmethod.latin.settings.TwoStatePreferenceHelper;
|
||||||
import com.android.inputmethod.latin.utils.ApplicationUtils;
|
import com.android.inputmethod.latin.utils.ApplicationUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preference screen.
|
* Preference screen.
|
||||||
*/
|
*/
|
||||||
public final class SpellCheckerSettingsFragment extends PreferenceFragment {
|
public final class SpellCheckerSettingsFragment extends PreferenceFragment {
|
||||||
/**
|
|
||||||
* Empty constructor for fragment generation.
|
|
||||||
*/
|
|
||||||
public SpellCheckerSettingsFragment() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(final Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
addPreferencesFromResource(R.xml.spell_checker_settings);
|
addPreferencesFromResource(R.xml.spell_checker_settings);
|
||||||
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
final PreferenceScreen preferenceScreen = getPreferenceScreen();
|
||||||
if (preferenceScreen != null) {
|
preferenceScreen.setTitle(ApplicationUtils.getActivityTitleResId(
|
||||||
preferenceScreen.setTitle(ApplicationUtils.getActivityTitleResId(
|
getActivity(), SpellCheckerSettingsActivity.class));
|
||||||
getActivity(), SpellCheckerSettingsActivity.class));
|
TwoStatePreferenceHelper.replaceCheckBoxPreferencesBySwitchPreferences(preferenceScreen);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue