diff options
author | Narayan Kamath <narayan@google.com> | 2011-08-18 17:55:41 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2011-08-23 18:10:01 +0100 |
commit | 0cfbb0f10aca100795169891c9a152d56390a3cf (patch) | |
tree | 89144b4be486a697e1622c40f3c9b8efc318285c /res | |
parent | 5b5c906b39a03260bab4ce253b90fe8b2752483e (diff) | |
download | packages_apps_Settings-0cfbb0f10aca100795169891c9a152d56390a3cf.zip packages_apps_Settings-0cfbb0f10aca100795169891c9a152d56390a3cf.tar.gz packages_apps_Settings-0cfbb0f10aca100795169891c9a152d56390a3cf.tar.bz2 |
Implement the new TTS settings UI.
bug:5149036
Change-Id: I81a9786d20be3e9bf87550d6a0cc04191409600c
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/preference_tts_engine.xml | 89 | ||||
-rw-r--r-- | res/values/arrays.xml | 34 | ||||
-rw-r--r-- | res/values/strings.xml | 11 | ||||
-rw-r--r-- | res/xml/language_settings.xml | 2 | ||||
-rw-r--r-- | res/xml/tts_engine_settings.xml | 34 | ||||
-rw-r--r-- | res/xml/tts_settings.xml | 67 |
6 files changed, 159 insertions, 78 deletions
diff --git a/res/layout/preference_tts_engine.xml b/res/layout/preference_tts_engine.xml new file mode 100644 index 0000000..3cbdff4 --- /dev/null +++ b/res/layout/preference_tts_engine.xml @@ -0,0 +1,89 @@ +<?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:minHeight="?android:attr/listPreferredItemHeight" + android:gravity="center_vertical"> + <LinearLayout + android:id="@+id/tts_engine_pref" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_weight="1" + android:gravity="center_vertical" + android:clickable="true" + android:focusable="true" + android:background="?android:attr/selectableItemBackground"> + <RadioButton + android:id="@+id/tts_engine_radiobutton" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_marginLeft="10dip" + android:layout_marginRight="4dip" + android:layout_gravity="center_vertical" + android:orientation="vertical" + android:clickable="true" /> + <RelativeLayout + android:id="@+id/tts_engine_pref_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="15dip" + android:layout_marginRight="6dip" + android:layout_marginTop="6dip" + android:layout_marginBottom="6dip" + android:layout_weight="1"> + <TextView + android:id="@android:id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:singleLine="true" + android:textAppearance="?android:attr/textAppearanceMedium" + android:ellipsize="marquee" + android:fadingEdge="horizontal"/> + <TextView + android:id="@android:id/summary" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@android:id/title" + android:layout_alignLeft="@android:id/title" + android:visibility="gone" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textSize="13sp" + android:textColor="?android:attr/textColorSecondary" + android:maxLines="4" /> + </RelativeLayout> + </LinearLayout> + <View + android:layout_width="2dip" + android:layout_height="match_parent" + android:layout_marginTop="5dip" + android:layout_marginBottom="5dip" + android:background="@android:drawable/divider_horizontal_dark" /> + <ImageView + android:id="@+id/tts_engine_settings" + android:layout_width="wrap_content" + android:layout_height="fill_parent" + android:paddingLeft="15dip" + android:paddingRight="?android:attr/scrollbarSize" + android:src="@drawable/ic_sysbar_quicksettings" + android:contentDescription="@string/tts_engine_settings_button" + android:layout_gravity="center" + android:clickable="true" + android:focusable="true" + android:background="?android:attr/selectableItemBackground" /> +</LinearLayout> diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 09d94de..b2bd9c5 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -201,40 +201,20 @@ <item>150</item> </string-array> - <!-- Default language choices --> - <string-array name="tts_lang_entries"> - <item>American English</item> - <item>British English</item> - <item>French</item> - <item>German</item> - <item>Italian</item> - <item>Spanish</item> - </string-array> - <!-- Do not translate. --> - <string-array name="tts_lang_values"> - <item>eng-USA</item> - <item>eng-GBR</item> - <item>fra-FRA</item> - <item>deu-DEU</item> - <item>ita-ITA</item> - <item>spa-ESP</item> - </string-array> <!-- Do not translate. --> - <string-array name="tts_demo_strings"> - <item>This is an example of speech synthesis in English.</item> + <string-array name="tts_demo_strings" translatable="false"> <item>This is an example of speech synthesis in English.</item> <item>Voici un échantillon de synthèse vocale en français.</item> <item>Dies ist ein Beispiel für Sprachsynthese in Deutsch.</item> <item>Questo è un esempio di sintesi vocale in italiano.</item> <item>Este es un ejemplo de síntesis de voz en español.</item> </string-array> - <!-- Do not translate. --> - <string-array name="tts_engine_entries"> - <item>Pico TTS</item> - </string-array> - <!-- Do not translate. --> - <string-array name="tts_engine_values"> - <item>com.svox.pico</item> + <string-array name="tts_demo_string_langs" translatable="false"> + <item>eng</item> + <item>fra</item> + <item>deu</item> + <item>ita</item> + <item>esp</item> </string-array> diff --git a/res/values/strings.xml b/res/values/strings.xml index 7e73bca..cdc631e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2978,8 +2978,6 @@ found in the list of installed applications.</string> <string name="tts_install_data_summary">Install the voice data required for speech synthesis</string> <!-- On main TTS Settings screen, summary for when required speech synthesis data alrady installed on SD card --> <string name="tts_data_installed_summary">Voices required for speech synthesis already properly installed</string> - <!-- Text spoken by the TTS engine for demonstration purposes --> - <string name="tts_demo">This is an example of speech synthesis.</string> <!-- Text spoken by the TTS engine when TTS settings (other than language) have been changed --> <string name="tts_settings_changed_demo">Your settings have changed. This is an example of how they sound.</string> <!-- Error screen when a selected TTS engine can't run because it's missing components --> @@ -3026,6 +3024,15 @@ found in the list of installed applications.</string> to warn the user that this engine cannot be used before the checkbox for that engine in TTS settings is checked. --> <string name="tts_notif_engine_install_message">Enable new engine before use</string> + <!-- [CHAR LIMIT=150] Text for screen readers / accessibility programs for + the image that launches the TTS engine settings when clicked. --> + <string name="tts_engine_settings_button">Launch engine settings</string> + <!-- [CHAR LIMIT=50] The text for the settings section that users to set a + preferred text to speech engine --> + <string name="tts_engine_preference_section_title">Preferred engine</string> + <!-- [CHAR LIMIT=50] Title of the settings section that displays general preferences + that are applicable to all engines, such as the speech rate --> + <string name="tts_general_section_title">General</string> <!-- Power Control Widget --> <string name="gadget_title">Power Control</string> diff --git a/res/xml/language_settings.xml b/res/xml/language_settings.xml index f696187..1598939 100644 --- a/res/xml/language_settings.xml +++ b/res/xml/language_settings.xml @@ -83,7 +83,7 @@ android:title="@string/voice_output_category" > <PreferenceScreen android:key="tts_settings" - android:fragment="com.android.settings.TextToSpeechSettings" + android:fragment="com.android.settings.tts.TextToSpeechSettings" android:title="@string/tts_settings_title" /> </PreferenceCategory> diff --git a/res/xml/tts_engine_settings.xml b/res/xml/tts_engine_settings.xml new file mode 100644 index 0000000..03414e8 --- /dev/null +++ b/res/xml/tts_engine_settings.xml @@ -0,0 +1,34 @@ +<?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. +--> + +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title=""> + <ListPreference + android:key="tts_default_lang" + android:title="@string/tts_default_lang_title" + android:summary="@string/tts_default_lang_summary" + android:persistent="false" /> + + <Preference + android:key="tts_engine_settings" + android:persistent="false" + android:title="@string/tts_engine_settings_title" /> + + <Preference + android:key="tts_install_data" + android:persistent="false" + android:title="@string/tts_install_data_title" + android:summary="@string/tts_install_data_summary" /> +</PreferenceScreen> diff --git a/res/xml/tts_settings.xml b/res/xml/tts_settings.xml index ecccc10..2b145d1 100644 --- a/res/xml/tts_settings.xml +++ b/res/xml/tts_settings.xml @@ -17,53 +17,24 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/tts_settings_title"> - <Preference - android:key="tts_play_example" + <!-- The contents of this category are filled in by the Java code + based on the list of available engines. --> + <PreferenceCategory android:key="tts_engine_preference_section" + android:title="@string/tts_engine_preference_section_title" /> + + <PreferenceCategory android:key="tts_general_section" + android:title="@string/tts_general_section_title"> + <ListPreference + android:key="tts_default_rate" + android:title="@string/tts_default_rate_title" + android:summary="@string/tts_default_rate_summary" android:persistent="false" - android:title="@string/tts_play_example_title" - android:summary="@string/tts_play_example_summary" /> - - <PreferenceCategory - android:title="@string/tts_default_settings_section"> - <ListPreference - android:key="tts_default_synth" - android:title="@string/tts_default_synth_title" - android:summary="@string/tts_default_synth_summary" - android:persistent="false" - android:entries="@array/tts_engine_entries" - android:entryValues="@array/tts_engine_values" /> - - <ListPreference - android:key="tts_default_rate" - android:title="@string/tts_default_rate_title" - android:summary="@string/tts_default_rate_summary" - android:persistent="false" - android:entries="@array/tts_rate_entries" - android:entryValues="@array/tts_rate_values" /> - - <ListPreference - android:key="tts_default_lang" - android:title="@string/tts_default_lang_title" - android:summary="@string/tts_default_lang_summary" - android:persistent="false" - android:entries="@array/tts_lang_entries" - android:entryValues="@array/tts_lang_values" /> - - </PreferenceCategory> - - <PreferenceCategory android:key="tts_engine_settings_section" - android:title="@string/tts_engine_settings_section"> - <Preference - android:key="tts_engine_settings" - android:persistent="false" - android:title="@string/tts_engine_settings_title" /> - - <Preference - android:key="tts_install_data" - android:persistent="false" - android:title="@string/tts_install_data_title" - android:summary="@string/tts_install_data_summary" /> - </PreferenceCategory> - - + android:entries="@array/tts_rate_entries" + android:entryValues="@array/tts_rate_values" /> + </PreferenceCategory> + + <Preference android:key="tts_play_example" + android:persistent="false" + android:title="@string/tts_play_example_title" + android:summary="@string/tts_play_example_summary" /> </PreferenceScreen> |