Merge "Use FooterPreference in xml explicitly"
This commit is contained in:
committed by
Android (Google) Code Review
commit
182ca7893f
@@ -16,6 +16,7 @@
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="autoclick_preference_screen"
|
||||
android:title="@string/accessibility_autoclick_preference_title">
|
||||
|
||||
@@ -24,4 +25,9 @@
|
||||
android:key="autoclick_delay"
|
||||
android:title="@string/accessibility_autoclick_delay_preference_title" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="autoclick_footer"
|
||||
android:title="@string/accessibility_autoclick_description"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"/>
|
||||
</PreferenceScreen>
|
||||
|
@@ -16,6 +16,7 @@
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="daltonizer_preference_screen"
|
||||
android:title="@string/accessibility_display_daltonizer_preference_title">
|
||||
|
||||
@@ -27,4 +28,9 @@
|
||||
android:title="@string/daltonizer_type"
|
||||
android:icon="@drawable/ic_accessibility_illustration_colorblind" />
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="daltonizer_footer"
|
||||
android:title="@string/accessibility_display_daltonizer_preference_subtitle"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"/>
|
||||
</PreferenceScreen>
|
||||
|
@@ -14,6 +14,7 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/accessibility_global_gesture_preference_title" >
|
||||
|
||||
<Preference
|
||||
@@ -24,4 +25,10 @@
|
||||
<SwitchPreference
|
||||
android:key="accessibility_shortcut_on_lock_screen"
|
||||
android:title="@string/accessibility_shortcut_service_on_lock_screen_title"/>
|
||||
|
||||
<com.android.settingslib.widget.FooterPreference
|
||||
android:key="accessibility_shortcut_footer"
|
||||
android:title="@string/accessibility_shortcut_description"
|
||||
android:selectable="false"
|
||||
settings:searchable="false"/>
|
||||
</PreferenceScreen>
|
@@ -80,8 +80,6 @@ public class AccessibilityShortcutPreferenceFragment extends ToggleFeaturePrefer
|
||||
((Boolean) o) ? 1 : 0);
|
||||
return true;
|
||||
});
|
||||
mFooterPreferenceMixin.createFooterPreference()
|
||||
.setTitle(R.string.accessibility_shortcut_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,7 +184,8 @@ public class AccessibilityShortcutPreferenceFragment extends ToggleFeaturePrefer
|
||||
return getServiceInfo(context) != null;
|
||||
}
|
||||
|
||||
private static @Nullable ComponentName getShortcutComponent(Context context) {
|
||||
private static @Nullable
|
||||
ComponentName getShortcutComponent(Context context) {
|
||||
String componentNameString = AccessibilityUtils.getShortcutTargetServiceComponentNameString(
|
||||
context, UserHandle.myUserId());
|
||||
if (componentNameString == null) return null;
|
||||
|
@@ -77,8 +77,9 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
/**
|
||||
* Gets string that should be used as a autoclick preference summary for provided autoclick
|
||||
* delay.
|
||||
*
|
||||
* @param resources Resources from which string should be retrieved.
|
||||
* @param delay Delay for whose value summary should be retrieved.
|
||||
* @param delay Delay for whose value summary should be retrieved.
|
||||
*/
|
||||
static CharSequence getAutoclickPreferenceSummary(Resources resources, int delay) {
|
||||
int summaryIndex = getAutoclickPreferenceSummaryIndex(delay);
|
||||
@@ -136,8 +137,6 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
mDelay.setMax(delayToSeekBarProgress(MAX_AUTOCLICK_DELAY));
|
||||
mDelay.setProgress(delayToSeekBarProgress(delay));
|
||||
mDelay.setOnPreferenceChangeListener(this);
|
||||
mFooterPreferenceMixin.createFooterPreference()
|
||||
.setTitle(R.string.accessibility_autoclick_description);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -166,11 +165,11 @@ public class ToggleAutoclickPreferenceFragment extends ToggleFeaturePreferenceFr
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (preference == mDelay && newValue instanceof Integer) {
|
||||
Settings.Secure.putInt(getContentResolver(),
|
||||
Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
|
||||
seekBarProgressToDelay((int)newValue));
|
||||
Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
|
||||
seekBarProgressToDelay((int) newValue));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -43,6 +43,7 @@ public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceF
|
||||
private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED;
|
||||
private static final String TYPE = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER;
|
||||
private static final int DEFAULT_TYPE = AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY;
|
||||
private static final String KEY_DALTONIZER_FOOTER = "daltonizer_footer";
|
||||
|
||||
private ListPreference mType;
|
||||
|
||||
@@ -62,10 +63,8 @@ public class ToggleDaltonizerPreferenceFragment extends ToggleFeaturePreferenceF
|
||||
|
||||
mType = (ListPreference) findPreference("type");
|
||||
|
||||
if (!ColorDisplayManager.isColorTransformAccelerated(getActivity())) {
|
||||
mFooterPreferenceMixin.createFooterPreference().setTitle(
|
||||
R.string.accessibility_display_daltonizer_preference_subtitle);
|
||||
}
|
||||
final Preference footer = findPreference(KEY_DALTONIZER_FOOTER);
|
||||
footer.setVisible(!ColorDisplayManager.isColorTransformAccelerated(getActivity()));
|
||||
initPreferences();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user