Merge "Change the "manage dictionaries" button to "less options""

This commit is contained in:
Jean Chalard
2011-12-19 01:27:14 -08:00
committed by Android (Google) Code Review
3 changed files with 24 additions and 18 deletions

View File

@@ -99,27 +99,27 @@
android:text="@string/cancel" android:text="@string/cancel"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="onClickCancel" /> android:onClick="onClickCancel" />
<Button android:id="@+id/user_dictionary_settings_add_dialog_options" <Button android:id="@+id/user_dictionary_settings_add_dialog_more_options"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_weight="1" android:layout_weight="1"
android:maxLines="2" android:maxLines="2"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:textSize="14sp" android:textSize="14sp"
android:text="@string/user_dict_settings_add_dialog_options" android:text="@string/user_dict_settings_add_dialog_more_options"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="onClickOptions" /> android:onClick="onClickMoreOptions" />
<Button android:id="@+id/user_dictionary_settings_add_dialog_manage" <Button android:id="@+id/user_dictionary_settings_add_dialog_less_options"
android:layout_width="0dip" android:layout_width="0dip"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_weight="1" android:layout_weight="1"
android:maxLines="2" android:maxLines="2"
style="?android:attr/buttonBarButtonStyle" style="?android:attr/buttonBarButtonStyle"
android:textSize="14sp" android:textSize="14sp"
android:text="@string/user_dict_settings_add_dialog_manage" android:text="@string/user_dict_settings_add_dialog_less_options"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
android:onClick="onClickManage" /> android:onClick="onClickLessOptions" />
<Button android:layout_width="0dip" <Button android:layout_width="0dip"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_weight="1" android:layout_weight="1"

View File

@@ -2602,9 +2602,9 @@
<!-- User dictionary settings. The title of the dialog to add a new word to the user dictionary. [CHAR LIMIT=25] --> <!-- User dictionary settings. The title of the dialog to add a new word to the user dictionary. [CHAR LIMIT=25] -->
<string name="user_dict_settings_add_dialog_title">Add to dictionary</string> <string name="user_dict_settings_add_dialog_title">Add to dictionary</string>
<!-- User dictionary settings. Text on the dialog button to pop more options for adding a word. [CHAR LIMIT=15] --> <!-- User dictionary settings. Text on the dialog button to pop more options for adding a word. [CHAR LIMIT=15] -->
<string name="user_dict_settings_add_dialog_options">Options</string> <string name="user_dict_settings_add_dialog_more_options">More options</string>
<!-- User dictionary settings. Text on the dialog button to show the full user dictionary interface. [CHAR LIMIT=15] --> <!-- User dictionary settings. Text on the dialog button mask advanced options. [CHAR LIMIT=15] -->
<string name="user_dict_settings_add_dialog_manage">Manage entries</string> <string name="user_dict_settings_add_dialog_less_options">Less options</string>
<!-- User dictionary settings. Text on the dialog button to confirm adding a word. [CHAR LIMIT=15] --> <!-- User dictionary settings. Text on the dialog button to confirm adding a word. [CHAR LIMIT=15] -->
<string name="user_dict_settings_add_dialog_confirm">OK</string> <string name="user_dict_settings_add_dialog_confirm">OK</string>
<!-- User dictionary settings. Label to put before the shortcut field (once a shortcut is registered, the user can type the shortcut and get the word it points to in the suggestions). [CHAR LIMIT=25] --> <!-- User dictionary settings. Label to put before the shortcut field (once a shortcut is registered, the user can type the shortcut and get the word it points to in the suggestions). [CHAR LIMIT=25] -->

View File

@@ -88,12 +88,6 @@ public class UserDictionaryAddWordActivity extends Activity
finish(); finish();
} }
public void onClickManage(final View v) {
final Intent intent = new Intent(v.getContext(), UserDictionarySettings.class);
startActivity(intent);
finish();
}
public void onClickConfirm(final View v) { public void onClickConfirm(final View v) {
if (MODE_EDIT == mMode && !TextUtils.isEmpty(mOldWord)) { if (MODE_EDIT == mMode && !TextUtils.isEmpty(mOldWord)) {
UserDictionarySettings.deleteWord(mOldWord, this.getContentResolver()); UserDictionarySettings.deleteWord(mOldWord, this.getContentResolver());
@@ -154,12 +148,14 @@ public class UserDictionaryAddWordActivity extends Activity
} }
} }
public void onClickOptions(final View v) { public void onClickMoreOptions(final View v) {
final View moreOptionsView = final View moreOptionsView =
findViewById(R.id.user_dict_settings_add_dialog_shortcut_interface); findViewById(R.id.user_dict_settings_add_dialog_shortcut_interface);
moreOptionsView.setVisibility(View.VISIBLE); moreOptionsView.setVisibility(View.VISIBLE);
findViewById(R.id.user_dictionary_settings_add_dialog_options).setVisibility(View.GONE); findViewById(R.id.user_dictionary_settings_add_dialog_more_options)
findViewById(R.id.user_dictionary_settings_add_dialog_manage).setVisibility(View.VISIBLE); .setVisibility(View.GONE);
findViewById(R.id.user_dictionary_settings_add_dialog_less_options)
.setVisibility(View.VISIBLE);
final Set<String> locales = UserDictionaryList.getUserDictionaryLocalesList(this); final Set<String> locales = UserDictionaryList.getUserDictionaryLocalesList(this);
// Remove our locale if it's in, because we're always gonna put it at the top // Remove our locale if it's in, because we're always gonna put it at the top
@@ -190,6 +186,16 @@ public class UserDictionaryAddWordActivity extends Activity
localeSpinner.setOnItemSelectedListener(this); localeSpinner.setOnItemSelectedListener(this);
} }
public void onClickLessOptions(final View v) {
final View moreOptionsView =
findViewById(R.id.user_dict_settings_add_dialog_shortcut_interface);
moreOptionsView.setVisibility(View.GONE);
findViewById(R.id.user_dictionary_settings_add_dialog_more_options)
.setVisibility(View.VISIBLE);
findViewById(R.id.user_dictionary_settings_add_dialog_less_options)
.setVisibility(View.GONE);
}
@Override @Override
public void onItemSelected(final AdapterView<?> parent, final View view, final int pos, public void onItemSelected(final AdapterView<?> parent, final View view, final int pos,
final long id) { final long id) {