Change the interface for user dictionary multiple locales.

The user dictionary interface now works the following way:
* Locale gathering
- The current locale is always considered as present, even if
there are no words for it in the user dictionary.
- Any locale for which at least one word is registered is
considered present.
- A null locale is considered a valid locale meaning "all
languages".
- If no words are present at all, since the current locale is
always considered present, the system will consider there is
exactly one locale present - and allow editing this user
dictionary.

* Options display
- If only one locale is present, the interface is the same as
for Honeycomb: display a "User dictionary" PreferenceScreen
that brings up the dictionary editor interface.
- If there are several locales present, then the user
dictionary option will jump to a screen that will display a
list of available locales.

* Word insertion
- Inserting a word will always use the locale of the currently
displayed dictionary. If it is the "all languages" null
pseudo-locale, that will still hold and the word will be added
to this pseudo-locale.

It is worthy to note that the "All languages" locale is only
accessible if for some reason there are already words with a
null locale in the database before this is installed. For
example, if an application has inserted some words that way,
or if the user inserted words with a previous version of the
settings application.
On a freshly flashed device, barring the use of third-party
application that would add such words, it is not possible to
access the "all languages" locale any more because there is
no interface to do it, though it works if such words are
inside.

Bug: 3479738
Change-Id: Iba323e5aeb3f4f575896903a4e8bef6ffb3ea306
This commit is contained in:
Jean Chalard
2011-05-12 15:06:16 +09:00
parent 309f385794
commit 71ad1f4e3e
6 changed files with 233 additions and 73 deletions

View File

@@ -2393,8 +2393,10 @@ found in the list of installed applications.</string>
<!-- User dictionary settings --><skip />
<!-- User dictionary settings, The titlebar text of the User dictionary settings screen. -->
<string name="user_dict_settings_titlebar">User dictionary</string>
<!-- User dictionary settings, The title of the list item to go into the User dictionary settings screen. -->
<string name="user_dict_settings_title">User dictionary</string>
<!-- User dictionary settings, The title of the list item to go into the User dictionary settings screen when there is only one user dictionary. -->
<string name="user_dict_single_settings_title">User dictionary</string>
<!-- User dictionary settings, The title of the list item to go into the User dictionary list when there are several user dictionaries. -->
<string name="user_dict_multiple_settings_title">Manage user dictionaries</string>
<!-- User dictionary settings. The summary of the listem item to go into the User dictionary settings screen. -->
<string name="user_dict_settings_summary">""</string>
<!-- User dictionary settings. The title of the menu item to add a new word to the user dictionary. -->
@@ -2411,6 +2413,8 @@ found in the list of installed applications.</string>
<string name="user_dict_settings_empty_text" product="tablet">You do not have any words in the user dictionary. You can add a word by touching the Add ( + ) button.</string>
<!-- User dictionary settings. The text to show when there are no user-defined words in the dictionary [CHAR LIMIT=200] -->
<string name="user_dict_settings_empty_text" product="default">You do not have any words in the user dictionary. You can add a word through the menu.</string>
<!-- User dictionary settings. The text to show to describe the dictionary common to all languages -->
<string name="user_dict_settings_all_languages">All languages</string>
<!-- This is for diagnostics screen. The title of a screen with various items realted to launching screens that will giev the user info. For example, it contains "Phone information" and "Battery information" -->
<string name="testing">Testing</string>