Revamp of the accessibility settings.

1. Reimplemented accessibility settings accrding to UX design.

NOTE: The strings are not final, rather reasonable placeholders
   to avoid blocking on them. Will submit another CL with string
   updates and any necessary polishes.

bug:5065409

Change-Id: I3ba229a624298dbf238bc8562b42616b386f8c34
This commit is contained in:
Costin Manolache
2011-07-21 10:38:15 -07:00
committed by Svetoslav Ganov
parent 9422580fa7
commit 672b3c6576
7 changed files with 672 additions and 527 deletions

View File

@@ -691,12 +691,15 @@
</activity>
<activity android:name="Settings$AccessibilitySettingsActivity"
android:label="@string/accessibility_settings_title">
android:label="@string/accessibility_settings_title"
android:configChanges="orientation|keyboardHidden|screenSize"
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.ACCESSIBILITY_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
<category android:name="com.android.settings.SHORTCUT" />
</intent-filter>
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.AccessibilitySettings" />

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:padding="16dip" />
</LinearLayout>

View File

@@ -2659,78 +2659,73 @@ found in the list of installed applications.</string>
<string name="accessibility_settings">Accessibility</string>
<!-- Settings title for accessibility settings screen -->
<string name="accessibility_settings_title">Accessibility settings</string>
<!-- Settings summary for accessibility settings [CHAR LIMIT=40] -->
<string name="accessibility_settings_summary">Manage accessibility options</string>
<!-- Setting Checkbox title for enabling accessibility large text [CHAR LIMIT=25] -->
<string name="toggle_large_text_title">Large text</string>
<!-- Setting accessibility services category [CHAR LIMIT=25] -->
<string name="accessibility_services_category">Accessibility services</string>
<!-- Setting Checkbox title for enabling accessibility services [CHAR LIMIT=40] -->
<string name="toggle_accessibility_title">Allow accessibility services</string>
<!-- Setting Checkbox title for enabling touch exploration mode [CHAR LIMIT=40] -->
<string name="accessibility_touch_exploration_title">Enable touch exploration mode</string>
<!-- Setting Checkbox summary for enabling touch exploration mode [CHAR LIMIT=65] -->
<string name="accessibility_touch_exploration_summary">Allows you to touch the screen to hear the contents under your finger.</string>
<!-- Warning message describing changes in interaction from enabling touch exploration mode
and suggesting that the user goes through a tutorial, displayed as a dialog message the
first time the user selects to enable touch exploration -->
<string name="accessibility_touch_exploration_warning">Touch exploration mode changes the way your
device handles touch input. Would you like to take a short tutorial on using touch exploration?</string>
<!-- Message for announcing the lack of installed accessibility services. -->
<string name="no_accessibility_services_summary">No installed accessibility services.</string>
<!-- Title for the accessibility preference category of accessibility services. [CHAR LIMIT=25] -->
<string name="accessibility_services_title">Services</string>
<!-- Title for the accessibility preference category of system related preferences. [CHAR LIMIT=25] -->
<string name="accessibility_system_title">System</string>
<!-- Title for the accessibility preference to enable large text. [CHAR LIMIT=35] -->
<string name="accessibility_toggle_large_text_title">Large text</string>
<!-- Title for the accessibility preference to power button to end a call. [CHAR LIMIT=35] -->
<string name="accessibility_power_button_ends_call_title">Power button ends call</string>
<!-- Title for accessibility preference to enable touch exploration mode. [CHAR LIMIT=35] -->
<string name="accessibility_touch_exploration_title">Explore by touch</string>
<!-- Summary for accessibility of the touch exploration mode. [CHAR LIMIT=NONE] -->
<string name="accessibility_touch_exploration_summary" >Allows exploring screen content and interacting with the device.\n\n
Touch the screen to receive feedback of the content under your finger.\n\n Tap on the last explored location to activate.\n\n
Use two fingers to drag. </string>
<!-- Title for accessibility preference to choose long-press delay i.e. timeout before it is detected. [CHAR LIMIT=35] -->
<string name="accessibility_long_press_timeout_title">Touch &amp; hold delay</string>
<!-- Title for accessibility preference to install accessibility scripts from Google. [CHAR LIMIT=35] -->
<string name="accessibility_script_injection_title">Install accessibility scripts</string>
<!-- Title for accessibility menu item to lauch a settings activity. [CHAR LIMIT=15] -->
<string name="accessibility_menu_item_settings">Settings</string>
<!-- Title for accessibility menu item to lauch a tutorial. [CHAR LIMIT=15] -->
<string name="accessibility_menu_item_tutorial">Tutorial</string>
<!-- Summary for the enabled state of an accessiblity serivce. [CHAR LIMIT=10] -->
<string name="accessibility_service_state_on">On</string>
<!-- Summary for the disabled state of an accessiblity serivce. [CHAR LIMIT=10] -->
<string name="accessibility_service_state_off">Off</string>
<!-- Summary for the allowed state of script injection. [CHAR LIMIT=15] -->
<string name="accessibility_script_injection_allowed">Allowed</string>
<!-- Summary for the disallowed state of script injection. [CHAR LIMIT=15] -->
<string name="accessibility_script_injection_disallowed">Disallowed</string>
<!-- Title for the dialog button to allow script injection. [CHAR LIMIT=15] -->
<string name="accessibility_script_injection_button_allow">Allow</string>
<!-- Title for the dialog button to disallow script injection. [CHAR LIMIT=15] -->
<string name="accessibility_script_injection_button_disallow">Don\'t Allow</string>
<!-- Warning message about security implications of enabling an accessibility service,
displayed as a dialog message when the user selects to enable an accessibility service. -->
displayed as a dialog message when the user selects to enable an accessibility service. [CHAR LIMIT=NONE] -->
<string name="accessibility_service_security_warning">This accessibility service may be able to collect
all the text you type, including personal data credit card numbers except passwords.
It may also log your user interface interactions. It comes from the application
<xliff:g id="accessibility_service_name">%1$s</xliff:g>. Use this accessibility service?</string>
<!-- Warning about disabling accessibility displayed as a dialog message when the user
selects to disable accessibility. This avoids accidental disabling. -->
selects to disable accessibility. This avoids accidental disabling. [CHAR LIMIT=NONE] -->
<string name="accessibility_service_disable_warning">Disable accessibility?</string>
<!-- Title for the prompt that lets users know that they have no accessibility related apps
installed and that they can install TalkBack from Market. -->
installed and that they can install TalkBack from Market. [CHAR LIMIT=50] -->
<string name="accessibility_service_no_apps_title">No accessibility related applications found
</string>
<!-- Message for the prompt that lets users know that they have no accessibility related apps
installed and that they can install TalkBack from Market. -->
installed and that they can install TalkBack from Market. [CHAR LIMIT=NONE] -->
<string name="accessibility_service_no_apps_message">You do not have any accessibility-related
applications installed.\n\nYou can download a screen reader for your device from Android
Market.\n\nClick "OK" to install the screen reader.</string>
<!-- Accessibility settings: Checkbox title for enabling download of accessibility scripts [CHAR LIMIT=40] -->
<string name="accessibility_script_injection_enabled">Download accessibility scripts</string>
<!-- Accessibility settings: Checkbox summary for enabling download of accessibility scripts [CHAR LIMIT=65] -->
<string name="accessibility_script_injection_enabled_summary">Allow applications to download accessibility scripts from Google</string>
<!-- 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"] -->
<string name="accessibility_script_injection_security_warning" product="tablet">Some applications can ask Google
to download scripts to your tablet that make their content more accessible. Are you sure you
want to allow Google to install accessibility scripts on your tablet?</string>
<!-- 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"] -->
<string name="accessibility_script_injection_security_warning" product="default">Some applications can ask Google
to download scripts to your phone that make their content more accessible. Are you sure you
want to allow Google to install accessibility scripts on your phone?</string>
<!-- Accessibility settings: Power button category -->
<string name="accessibility_power_button_category">Power button</string>
<!-- Accessibility settings: checkbox title for power button behavior -->
<string name="accessibility_power_button_ends_call">Power button ends call</string>
<!-- Accessibility settings: power button behavior summary text -->
<string name="accessibility_power_button_ends_call_summary">During a call, pressing Power ends call instead of turning off screen</string>
<!-- Accessibility settings: touch exploration state -->
<string name="accessibility_touch_exploration_enabled">Touch exploration</string>
<!-- Accessibility settings: button for lauching settings for an accessibility service -->
<string name="settings_button">Settings</string>
<!-- Setting interaction category [CHAR LIMIT=35] -->
<string name="touchscreen_gestures_category">Touchscreen gestures</string>
<!-- Title for setting the long-press timeout [CHAR LIMIT=35] -->
<string name="long_press_timeout_selector_title">Touch &amp; hold delay</string>
<!-- Summary for setting the long-press timeout [CHAR LIMIT=85] -->
<string name="long_press_timeout_selector_summary">Delay until a touch is interpreted as a touch &amp; hold</string>
<!-- The default value for the long press timeout. -->
<string name="long_press_timeout_selector_default_value" translatable="false">500</string>
displayed as a dialog message when the user selects to enable script downloading. [CHAR LIMIT=NONE] -->
<string name="accessibility_script_injection_security_warning">Some applications can ask Google
to download scripts to your device that make their content more accessible. Are you sure you
want to allow Google to install accessibility scripts on your device?</string>
<!-- Warning message that the interaction model changes on enabling touch exploration. [CHAR LIMIT=NONE] -->
<string name="accessibility_touch_exploration_warning">Enabling explore by touch
changes the interation model. Enable explore by touch?</string>
<!-- App Fuel Gauge strings -->
<skip />

View File

@@ -159,7 +159,7 @@
<item name="android:widgetLayout">@layout/preference_inputmethod_widget</item>
</style>
<style name="AcessibilityTutorialButton">
<style name="AccessibilityTutorialButton">
<item name="android:layout_width">150dip</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_margin">5dip</item>

View File

@@ -18,48 +18,48 @@
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/accessibility_settings_title">
<CheckBoxPreference
android:key="toggle_large_text_checkbox"
android:title="@string/toggle_large_text_title"
android:persistent="false"/>
<PreferenceCategory android:key="accessibility_services_category"
android:title="@string/accessibility_services_category">
<CheckBoxPreference
android:key="toggle_accessibility_service_checkbox"
android:title="@string/toggle_accessibility_title"
android:persistent="false"
android:order="-10000"/>
<CheckBoxPreference
android:key="toggle_accessibility_script_injection_checkbox"
android:title="@string/accessibility_script_injection_enabled"
android:summary="@string/accessibility_script_injection_enabled_summary"
android:persistent="false"
android:order="10000" />
<PreferenceCategory
android:key="services_category"
android:title="@string/accessibility_services_title">
</PreferenceCategory>
<PreferenceCategory android:key="power_button_category"
android:title="@string/accessibility_power_button_category">
<CheckBoxPreference
android:key="power_button_ends_call"
android:title="@string/accessibility_power_button_ends_call"
android:summary="@string/accessibility_power_button_ends_call_summary"
android:persistent="false" />
</PreferenceCategory>
<PreferenceCategory
android:key="system_category"
android:title="@string/accessibility_system_title">
<PreferenceCategory android:key="touchscreen_gestures_category"
android:title="@string/touchscreen_gestures_category">
<ListPreference android:key="long_press_timeout_list_preference"
android:title="@string/long_press_timeout_selector_title"
android:summary="@string/long_press_timeout_selector_summary"
android:persistent="true"
<CheckBoxPreference
android:key="toggle_large_text_preference"
android:title="@string/accessibility_toggle_large_text_title"
android:persistent="false"/>
<CheckBoxPreference
android:key="toggle_power_button_ends_call_preference"
android:title="@string/accessibility_power_button_ends_call_title"
android:persistent="false">
</CheckBoxPreference>
<PreferenceScreen
android:key="toggle_touch_exploration_preference"
android:title="@string/accessibility_touch_exploration_title"
android:fragment="com.android.settings.AccessibilitySettings$ToggleTouchExplorationFragment" >
<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="warning_message" android:value="@string/accessibility_touch_exploration_warning" />
<extra android:name="settings_title" android:value="@string/accessibility_menu_item_tutorial" />
<extra android:name="settings_component_name" android:value="com.android.settings/com.android.settings.AccessibilityTutorialActivity" />
</PreferenceScreen>
<ListPreference android:key="select_long_press_timeout_preference"
android:title="@string/accessibility_long_press_timeout_title"
android:entries="@array/long_press_timeout_selector_titles"
android:entryValues="@array/long_press_timeout_selector_values"
android:defaultValue="@string/long_press_timeout_selector_default_value"/>
<CheckBoxPreference
android:key="touch_exploration_enabled"
android:title="@string/accessibility_touch_exploration_enabled"
android:persistent="true" />
<Preference
android:key="toggle_script_injection_preference"
android:title="@string/accessibility_script_injection_title"
android:persistent="false" />
</PreferenceCategory>
</PreferenceScreen>

File diff suppressed because it is too large Load Diff

View File

@@ -1,92 +0,0 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings;
import android.content.Context;
import android.content.Intent;
import android.preference.CheckBoxPreference;
import android.util.TypedValue;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.ImageView;
/**
* CheckBox preference that optionally shows an icon for launching a settings
* {@link android.app.Activity}. The settings activity, if intent for launching
* it was provided, can be stared only if the CheckBox in is checked.
*/
public class SettingsCheckBoxPreference extends CheckBoxPreference {
// Integer.MIN_VALUE means not initalized
private static int sDimAlpha = Integer.MIN_VALUE;
private final Intent mSettingsIntent;
/**
* Creates a new instance. The constructor is checking whether the
* settings intent is resolved to an activity and acts accordingly.
*
* @param context Context for accessing resources.
* @param intent Intent to use as settings for the item represented by
* this preference. Pass <code>null</code> if there is no associated
* settings activity.
*/
public SettingsCheckBoxPreference(Context context, Intent intent) {
super(context);
if (sDimAlpha == Integer.MIN_VALUE) {
TypedValue outValue = new TypedValue();
context.getTheme().resolveAttribute(android.R.attr.disabledAlpha, outValue, true);
sDimAlpha = (int) (outValue.getFloat() * 255);
}
if (intent != null
&& !context.getPackageManager().queryIntentActivities(intent, 0).isEmpty()) {
mSettingsIntent = intent;
} else {
mSettingsIntent = null;
}
setWidgetLayoutResource(R.layout.preference_settings_checkbox_widget);
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
ImageView settingsButton = (ImageView) view.findViewById(R.id.settings_button);
if (mSettingsIntent != null) {
CheckBox checkbox = (CheckBox) view.findViewById(com.android.internal.R.id.checkbox);
if (checkbox.isChecked()) {
settingsButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
getContext().startActivity(mSettingsIntent);
}
});
}
settingsButton.setVisibility(View.VISIBLE);
if (checkbox.isChecked() && isEnabled()) {
settingsButton.setAlpha(255);
} else {
settingsButton.setAlpha(sDimAlpha);
}
} else {
settingsButton.setVisibility(View.GONE);
view.findViewById(R.id.divider).setVisibility(View.GONE);
}
}
}