Merge "Polish of the accessibility settings."
This commit is contained in:
committed by
Android (Google) Code Review
commit
e05d63d771
@@ -2741,10 +2741,16 @@ found in the list of installed applications.</string>
|
|||||||
<xliff:g id="service" example="TalkBack">%1$s</xliff:g>?</string>
|
<xliff:g id="service" example="TalkBack">%1$s</xliff:g>?</string>
|
||||||
<!-- Summary for a warning message about security implications of enabling an accessibility service,
|
<!-- Summary for a warning message about security implications of enabling an accessibility service,
|
||||||
displayed as a dialog message when the user selects to enable an accessibility service (tablet). [CHAR LIMIT=NONE] -->
|
displayed as a dialog message when the user selects to enable an accessibility service (tablet). [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_service_security_warning_summary">
|
<string name="accessibility_service_security_warning_summary" product="tablet">
|
||||||
<xliff:g id="accessibility_service_name">%1$s</xliff:g> can
|
<xliff:g id="accessibility_service_name">%1$s</xliff:g> can
|
||||||
collect all of the text you type, except passwords. This includes personal data such as credit card
|
collect all of the text you type, except passwords. This includes personal data such as credit card
|
||||||
numbers. It can also collect data about your interactions with the device.</string>
|
numbers. It can also collect data about your interactions with the tablet.</string>
|
||||||
|
<!-- Summary for a warning message about security implications of enabling an accessibility service,
|
||||||
|
displayed as a dialog message when the user selects to enable an accessibility service (phone). [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_service_security_warning_summary" product="default">
|
||||||
|
<xliff:g id="accessibility_service_name">%1$s</xliff:g> can
|
||||||
|
collect all of the text you type, except passwords. This includes personal data such as credit card
|
||||||
|
numbers. It can also collect data about your interactions with the phone.</string>
|
||||||
|
|
||||||
<!-- Title for a warning about disabling an accessibility service displayed as a dialog message when the user
|
<!-- Title for a warning about disabling an accessibility service displayed as a dialog message when the user
|
||||||
selects to disable that service. This avoids accidental disabling. [CHAR LIMIT=NONE] -->
|
selects to disable that service. This avoids accidental disabling. [CHAR LIMIT=NONE] -->
|
||||||
@@ -2755,16 +2761,20 @@ found in the list of installed applications.</string>
|
|||||||
<string name="accessibility_service_disable_warning_summary">Touching OK will
|
<string name="accessibility_service_disable_warning_summary">Touching OK will
|
||||||
stop <xliff:g id="service" example="TalkBack">%1$s</xliff:g>.</string>
|
stop <xliff:g id="service" example="TalkBack">%1$s</xliff:g>.</string>
|
||||||
|
|
||||||
|
<!-- Title for the prompt shown as a placeholder if no accessibility serivices are installed. [CHAR LIMIT=50] -->
|
||||||
|
<string name="accessibility_no_services_installed">No services installed</string>
|
||||||
|
|
||||||
<!-- Title for the prompt that lets users know that they have no accessibility related apps
|
<!-- Title for the prompt that lets users know that they have no accessibility related apps
|
||||||
installed and that they can install TalkBack from Market. [CHAR LIMIT=50] -->
|
installed and that they can install TalkBack from Market. [CHAR LIMIT=50] -->
|
||||||
<string name="accessibility_service_no_apps_title">No accessibility applications</string>
|
<string name="accessibility_service_no_apps_title">Need a screen reader?</string>
|
||||||
<!-- Message for the prompt that lets users know that they have no accessibility related apps
|
<!-- Message for the prompt that lets users know that they have no accessibility related apps
|
||||||
installed and that they can install TalkBack from Market. [CHAR LIMIT=NONE] -->
|
installed and that they can install TalkBack from Market. [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_service_no_apps_message">You don\'t have accessibility
|
<string name="accessibility_service_no_apps_message">TalkBack provides spoken feedback to
|
||||||
applications installed. Do you want to download a screen reader from the Android Market?</string>
|
help blind and low-vision users. Do you want to install it for free from Android
|
||||||
|
Market?</string>
|
||||||
|
|
||||||
<!-- Title for a warning about downloading accessibility scripts displayed as a dialog message
|
<!-- Title for a warning about downloading accessibility scripts displayed as a dialog message
|
||||||
when the user selects to enable script downloading. [CHAR LIMIT=40] -->
|
when the user selects to enable script downloading. [CHAR LIMIT=50] -->
|
||||||
<string name="accessibility_script_injection_security_warning_title">Install accessibility scripts?</string>
|
<string name="accessibility_script_injection_security_warning_title">Install accessibility scripts?</string>
|
||||||
<!-- Warning message about security implications of downloading accessibility scripts,
|
<!-- Warning message about security implications of downloading accessibility scripts,
|
||||||
displayed as a dialog message when the user selects to enable script downloading. [CHAR LIMIT=NONE] -->
|
displayed as a dialog message when the user selects to enable script downloading. [CHAR LIMIT=NONE] -->
|
||||||
@@ -2774,10 +2784,12 @@ found in the list of installed applications.</string>
|
|||||||
<!-- Warning message that the interaction model changes on enabling touch exploration. [CHAR LIMIT=NONE] -->
|
<!-- Warning message that the interaction model changes on enabling touch exploration. [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_touch_exploration_warning">This feature changes the
|
<string name="accessibility_touch_exploration_warning">This feature changes the
|
||||||
way your device responds to touch. Turn on?</string>
|
way your device responds to touch. Turn on?</string>
|
||||||
<!-- Default description for an accessiiblity serivice if the latter doesn't provide one. [CHAR LIMIT=NONE] -->
|
<!-- Default description for an accessibility serivice if the latter doesn't provide one (tablet). [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_service_default_description">This accessibility service has no
|
<string name="accessibility_service_default_description" product="tablet">This service has no
|
||||||
description.\n\nAccessibility services provide various types of feedback when you interact
|
description.\n\nServices provide feedback when you interact with the tablet.</string>
|
||||||
with the device. </string>
|
<!-- Default description for an accessibility serivice if the latter doesn't provide one (phone). [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="accessibility_service_default_description" product="default">This service has no
|
||||||
|
description.\n\nServices provide feedback when you interact with the phone.</string>
|
||||||
|
|
||||||
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
|
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
|
||||||
<string name="settings_button">Settings</string>
|
<string name="settings_button">Settings</string>
|
||||||
|
|||||||
@@ -30,22 +30,26 @@
|
|||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="toggle_large_text_preference"
|
android:key="toggle_large_text_preference"
|
||||||
android:title="@string/accessibility_toggle_large_text_title"
|
android:title="@string/accessibility_toggle_large_text_title"
|
||||||
android:persistent="false"/>
|
android:persistent="false"
|
||||||
|
android:order="1"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="toggle_power_button_ends_call_preference"
|
android:key="toggle_power_button_ends_call_preference"
|
||||||
android:title="@string/accessibility_power_button_ends_call_title"
|
android:title="@string/accessibility_power_button_ends_call_title"
|
||||||
android:persistent="false"/>
|
android:persistent="false"
|
||||||
|
android:order="2"/>
|
||||||
|
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="toggle_auto_rotate_screen_preference"
|
android:key="toggle_auto_rotate_screen_preference"
|
||||||
android:title="@string/accelerometer_title"
|
android:title="@string/accelerometer_title"
|
||||||
android:persistent="false"/>
|
android:persistent="false"
|
||||||
|
android:order="3"/>
|
||||||
|
|
||||||
<PreferenceScreen
|
<PreferenceScreen
|
||||||
android:key="toggle_touch_exploration_preference"
|
android:key="toggle_touch_exploration_preference"
|
||||||
android:title="@string/accessibility_touch_exploration_title"
|
android:title="@string/accessibility_touch_exploration_title"
|
||||||
android:fragment="com.android.settings.AccessibilitySettings$ToggleTouchExplorationFragment" >
|
android:fragment="com.android.settings.AccessibilitySettings$ToggleTouchExplorationFragment"
|
||||||
|
android:order="4" >
|
||||||
<extra android:name="title" android:value="@string/accessibility_touch_exploration_title" />
|
<extra android:name="title" android:value="@string/accessibility_touch_exploration_title" />
|
||||||
<extra android:name="summary" android:value="@string/accessibility_touch_exploration_summary" />
|
<extra android:name="summary" android:value="@string/accessibility_touch_exploration_summary" />
|
||||||
<extra android:name="enable_warning_title" android:value="@android:string/dialog_alert_title" />
|
<extra android:name="enable_warning_title" android:value="@android:string/dialog_alert_title" />
|
||||||
@@ -58,7 +62,8 @@
|
|||||||
android:title="@string/accessibility_long_press_timeout_title"
|
android:title="@string/accessibility_long_press_timeout_title"
|
||||||
android:entries="@array/long_press_timeout_selector_titles"
|
android:entries="@array/long_press_timeout_selector_titles"
|
||||||
android:entryValues="@array/long_press_timeout_selector_values"
|
android:entryValues="@array/long_press_timeout_selector_values"
|
||||||
android:persistent="false"/>
|
android:persistent="false"
|
||||||
|
android:order="5"/>
|
||||||
|
|
||||||
<com.android.settings.AccessibilityEnableScriptInjectionPreference
|
<com.android.settings.AccessibilityEnableScriptInjectionPreference
|
||||||
android:key="toggle_script_injection_preference"
|
android:key="toggle_script_injection_preference"
|
||||||
@@ -68,7 +73,8 @@
|
|||||||
android:dialogMessage="@string/accessibility_script_injection_security_warning_summary"
|
android:dialogMessage="@string/accessibility_script_injection_security_warning_summary"
|
||||||
android:positiveButtonText="@string/accessibility_script_injection_button_allow"
|
android:positiveButtonText="@string/accessibility_script_injection_button_allow"
|
||||||
android:negativeButtonText="@string/accessibility_script_injection_button_disallow"
|
android:negativeButtonText="@string/accessibility_script_injection_button_disallow"
|
||||||
android:persistent="false"/>
|
android:persistent="false"
|
||||||
|
android:order="6"/>
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
private Preference mToggleTouchExplorationPreference;
|
private Preference mToggleTouchExplorationPreference;
|
||||||
private ListPreference mSelectLongPressTimeoutPreference;
|
private ListPreference mSelectLongPressTimeoutPreference;
|
||||||
private AccessibilityEnableScriptInjectionPreference mToggleScriptInjectionPreference;
|
private AccessibilityEnableScriptInjectionPreference mToggleScriptInjectionPreference;
|
||||||
|
private Preference mNoServicesMessagePreference;
|
||||||
|
|
||||||
private int mLongPressTimeoutDefault;
|
private int mLongPressTimeoutDefault;
|
||||||
|
|
||||||
@@ -376,7 +377,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
containerView.setGravity(Gravity.CENTER);
|
containerView.setGravity(Gravity.CENTER);
|
||||||
|
|
||||||
TextView summaryView = (TextView) view.findViewById(R.id.summary);
|
TextView summaryView = (TextView) view.findViewById(R.id.summary);
|
||||||
String title = getString(R.string.accessibility_service_no_apps_title);
|
String title = getString(R.string.accessibility_no_services_installed);
|
||||||
summaryView.setText(title);
|
summaryView.setText(title);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -389,8 +390,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Preference mNoServicesMessagePreference;
|
|
||||||
|
|
||||||
private void updateSystemPreferences() {
|
private void updateSystemPreferences() {
|
||||||
// Large text.
|
// Large text.
|
||||||
try {
|
try {
|
||||||
@@ -417,16 +416,22 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
mToggleAutoRotateScreenPreference.setChecked(autoRotationEnabled);
|
mToggleAutoRotateScreenPreference.setChecked(autoRotationEnabled);
|
||||||
|
|
||||||
// Touch exploration enabled.
|
// Touch exploration enabled.
|
||||||
final boolean touchExplorationEnabled = (Settings.Secure.getInt(getContentResolver(),
|
if (AccessibilityManager.getInstance(getActivity()).isEnabled()) {
|
||||||
Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0) == 1);
|
mSystemsCategory.addPreference(mToggleTouchExplorationPreference);
|
||||||
if (touchExplorationEnabled) {
|
final boolean touchExplorationEnabled = (Settings.Secure.getInt(getContentResolver(),
|
||||||
mToggleTouchExplorationPreference.setSummary(
|
Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0) == 1);
|
||||||
getString(R.string.accessibility_service_state_on));
|
if (touchExplorationEnabled) {
|
||||||
mToggleTouchExplorationPreference.getExtras().putBoolean(EXTRA_CHECKED, true);
|
mToggleTouchExplorationPreference.setSummary(
|
||||||
|
getString(R.string.accessibility_service_state_on));
|
||||||
|
mToggleTouchExplorationPreference.getExtras().putBoolean(EXTRA_CHECKED, true);
|
||||||
|
} else {
|
||||||
|
mToggleTouchExplorationPreference.setSummary(
|
||||||
|
getString(R.string.accessibility_service_state_off));
|
||||||
|
mToggleTouchExplorationPreference.getExtras().putBoolean(EXTRA_CHECKED, false);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
mToggleTouchExplorationPreference.setSummary(
|
mSystemsCategory.removePreference(mToggleTouchExplorationPreference);
|
||||||
getString(R.string.accessibility_service_state_off));
|
|
||||||
mToggleTouchExplorationPreference.getExtras().putBoolean(EXTRA_CHECKED, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Long press timeout.
|
// Long press timeout.
|
||||||
@@ -443,7 +448,8 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void offerInstallAccessibilitySerivceOnce() {
|
private void offerInstallAccessibilitySerivceOnce() {
|
||||||
if (mServicesCategory.getPreferenceCount() > 0) {
|
// There is always one preference - if no services it is just a message.
|
||||||
|
if (mServicesCategory.getPreference(0) != mNoServicesMessagePreference) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SharedPreferences preferences = getActivity().getPreferences(Context.MODE_PRIVATE);
|
SharedPreferences preferences = getActivity().getPreferences(Context.MODE_PRIVATE);
|
||||||
@@ -578,7 +584,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
|
|||||||
// Enabling the first service enables accessibility.
|
// Enabling the first service enables accessibility.
|
||||||
Settings.Secure.putInt(getContentResolver(),
|
Settings.Secure.putInt(getContentResolver(),
|
||||||
Settings.Secure.ACCESSIBILITY_ENABLED, 1);
|
Settings.Secure.ACCESSIBILITY_ENABLED, 1);
|
||||||
|
|
||||||
} else if (length > 0) {
|
} else if (length > 0) {
|
||||||
enabledServices += ENABLED_ACCESSIBILITY_SERVICES_SEPARATOR + preferenceKey;
|
enabledServices += ENABLED_ACCESSIBILITY_SERVICES_SEPARATOR + preferenceKey;
|
||||||
Settings.Secure.putString(getContentResolver(),
|
Settings.Secure.putString(getContentResolver(),
|
||||||
|
|||||||
Reference in New Issue
Block a user