auto import from //depot/cupcake/@136594

This commit is contained in:
The Android Open Source Project
2009-03-05 14:34:39 -08:00
parent afc4ab2ffb
commit 86997beac8
10 changed files with 274 additions and 146 deletions

View File

@@ -149,6 +149,14 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="PhysicalKeyboardSettings"
android:label="@string/builtin_keyboard_settings_title">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="InputMethodsSettings" android:icon="@drawable/app_settings" <activity android:name="InputMethodsSettings" android:icon="@drawable/app_settings"
android:label="@string/input_methods_settings_title" android:label="@string/input_methods_settings_title"
> >
@@ -393,14 +401,6 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="DeviceInfo" android:label="@string/device_info_label">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
<category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>
</activity>
<!-- DeviceInfo adds the user's requested build to stats upload. --> <!-- DeviceInfo adds the user's requested build to stats upload. -->
<receiver android:name=".DeviceInfo$StatsReportReceiver"> <receiver android:name=".DeviceInfo$StatsReportReceiver">
<intent-filter> <intent-filter>

View File

@@ -14,58 +14,63 @@
limitations under the License. limitations under the License.
--> -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent">
android:orientation="vertical"
android:gravity="center_horizontal"
android:paddingBottom="20dip">
<ImageView android:id="@android:id/icon" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="fill_parent"
android:paddingTop="20dip" /> android:orientation="vertical"
android:gravity="center_horizontal"
android:paddingBottom="20dip">
<TextView <ImageView android:id="@android:id/icon"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/incoming_call_volume_title" android:paddingTop="20dip" />
android:paddingTop="20dip"
android:paddingLeft="20dip" <TextView
android:paddingRight="20dip" /> android:layout_width="fill_parent"
android:layout_height="wrap_content"
<!-- Used for the ring volume. This is what the superclass VolumePreference uses. --> android:text="@string/incoming_call_volume_title"
<SeekBar android:id="@*android:id/seekbar" android:paddingTop="20dip"
android:layout_width="fill_parent" android:paddingLeft="20dip"
android:layout_height="wrap_content" android:paddingRight="20dip" />
android:paddingTop="6dip"
android:paddingLeft="20dip"
android:paddingRight="20dip" />
<CheckBox android:id="@+id/same_notification_volume" <!-- Used for the ring volume. This is what the superclass VolumePreference uses. -->
android:layout_width="fill_parent" <SeekBar android:id="@*android:id/seekbar"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:text="@string/checkbox_notification_same_as_incoming_call" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" android:paddingTop="6dip"
android:layout_marginTop="6dip" android:paddingLeft="20dip"
android:layout_marginLeft="20dip" android:paddingRight="20dip" />
android:layout_marginRight="20dip" />
<CheckBox android:id="@+id/same_notification_volume"
<TextView android:id="@+id/notification_volume_title" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/checkbox_notification_same_as_incoming_call"
android:text="@string/notification_volume_title" android:textAppearance="?android:attr/textAppearanceSmall"
android:paddingTop="6dip" android:layout_marginTop="6dip"
android:paddingLeft="20dip" android:layout_marginLeft="20dip"
android:paddingRight="20dip" /> android:layout_marginRight="20dip" />
<!-- Used for the notification volume --> <TextView android:id="@+id/notification_volume_title"
<SeekBar android:id="@+id/notification_volume_seekbar" android:layout_width="fill_parent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:text="@string/notification_volume_title"
android:paddingTop="6dip" android:paddingTop="6dip"
android:paddingLeft="20dip" android:paddingLeft="20dip"
android:paddingRight="20dip" /> android:paddingRight="20dip" />
</LinearLayout> <!-- Used for the notification volume -->
<SeekBar android:id="@+id/notification_volume_seekbar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:paddingLeft="20dip"
android:paddingRight="20dip" />
</LinearLayout>
</ScrollView>

View File

@@ -1324,6 +1324,8 @@ found in the list of installed applications.</string>
<string name="user_dict_settings_add_menu_title">Add</string> <string name="user_dict_settings_add_menu_title">Add</string>
<!-- User dictionary settings. The title of the dialog to add a new word to the user dictionary. --> <!-- User dictionary settings. The title of the dialog to add a new word to the user dictionary. -->
<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. The title of the dialog to edit an existing word in the user dictionary. -->
<string name="user_dict_settings_edit_dialog_title">Edit word</string>
<!-- User dictionary settings. The title of the context menu item to edit the current word --> <!-- User dictionary settings. The title of the context menu item to edit the current word -->
<string name="user_dict_settings_context_menu_edit_title">Edit</string> <string name="user_dict_settings_context_menu_edit_title">Edit</string>
<!-- User dictionary settings. The title of the context menu item to delete the current word --> <!-- User dictionary settings. The title of the context menu item to delete the current word -->
@@ -1369,7 +1371,13 @@ found in the list of installed applications.</string>
<string name="input_methods_settings_title">Text input</string> <string name="input_methods_settings_title">Text input</string>
<string name="input_methods_settings_summary">Manage text input options</string> <string name="input_methods_settings_summary">Manage text input options</string>
<!-- Input Methods Settings localized format string for generating the appropriate "Foo settings" menu label for the Input Method named "Foo" --> <!-- Input Methods Settings localized format string for generating the appropriate "Foo settings" menu label for the Input Method named "Foo" -->
<string name="input_methods_settings_label_format">%s settings</string> <string name="input_methods_settings_label_format"><xliff:g id="ime_name">%1$s</xliff:g> settings</string>
<!-- Summary for on-screen keyboard settings -->
<string name="onscreen_keyboard_settings_summary">On-screen keyboard settings</string>
<!-- Title for built-in keyboard settings -->
<string name="builtin_keyboard_settings_title">Device keyboard</string>
<!-- Summary for built-in keyboard settings -->
<string name="builtin_keyboard_settings_summary">Built-in keyboard settings</string>
<!-- Development Settings. the title for the item to take the user to Development settings. Development settings are settings meant for application developers. --> <!-- Development Settings. the title for the item to take the user to Development settings. Development settings are settings meant for application developers. -->
<string name="development_settings_title">Development</string> <string name="development_settings_title">Development</string>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<CheckBoxPreference
android:key="auto_replace"
android:title="@string/auto_replace"
android:summaryOn="@string/auto_replace_summary"
android:summaryOff="@string/auto_replace_summary"
android:persistent="false"/>
<CheckBoxPreference
android:key="auto_caps"
android:title="@string/auto_caps"
android:summaryOn="@string/auto_caps_summary"
android:summaryOff="@string/auto_caps_summary"
android:persistent="false"/>
<CheckBoxPreference
android:key="auto_punctuate"
android:title="@string/auto_punctuate"
android:summaryOn="@string/auto_punctuate_summary"
android:summaryOff="@string/auto_punctuate_summary"
android:persistent="false"/>
</PreferenceScreen>

View File

@@ -29,6 +29,15 @@
<PreferenceCategory android:key="text_category" <PreferenceCategory android:key="text_category"
android:title="@string/text_category" /> android:title="@string/text_category" />
<PreferenceScreen
android:key="hardkeyboard_category"
android:title="@string/builtin_keyboard_settings_title"
android:summary="@string/builtin_keyboard_settings_summary">
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.android.settings"
android:targetClass="com.android.settings.PhysicalKeyboardSettings"/>
</PreferenceScreen>
<PreferenceScreen <PreferenceScreen
android:title="@string/user_dict_settings_title" android:title="@string/user_dict_settings_title"
android:summary="@string/user_dict_settings_summary"> android:summary="@string/user_dict_settings_summary">
@@ -37,26 +46,4 @@
android:targetClass="com.android.settings.UserDictionarySettings" /> android:targetClass="com.android.settings.UserDictionarySettings" />
</PreferenceScreen> </PreferenceScreen>
<PreferenceCategory
android:key="hardkeyboard_category"
android:title="@string/hardkeyboard_category">
<CheckBoxPreference
android:key="auto_replace"
android:title="@string/auto_replace"
android:summaryOn="@string/auto_replace_summary"
android:summaryOff="@string/auto_replace_summary"
android:persistent="false"/>
<CheckBoxPreference
android:key="auto_caps"
android:title="@string/auto_caps"
android:summaryOn="@string/auto_caps_summary"
android:summaryOff="@string/auto_caps_summary"
android:persistent="false"/>
<CheckBoxPreference
android:key="auto_punctuate"
android:title="@string/auto_punctuate"
android:summaryOn="@string/auto_punctuate_summary"
android:summaryOff="@string/auto_punctuate_summary"
android:persistent="false"/>
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -16,7 +16,6 @@
package com.android.settings; package com.android.settings;
import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
@@ -28,37 +27,20 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup; import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen; import android.preference.PreferenceScreen;
import android.provider.Settings; import android.provider.Settings;
import android.provider.Settings.System;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
public class LanguageSettings extends PreferenceActivity { public class LanguageSettings extends PreferenceActivity {
private final String[] mSettingsUiKey = { private boolean mHaveHardKeyboard;
"auto_caps",
"auto_replace",
"auto_punctuate",
};
// Note: Order of this array should correspond to the order of the above array
private final String[] mSettingsSystemId = {
System.TEXT_AUTO_CAPS,
System.TEXT_AUTO_REPLACE,
System.TEXT_AUTO_PUNCTUATE,
};
// Note: Order of this array should correspond to the order of the above array
private final int[] mSettingsDefault = {
1,
1,
1,
};
private List<InputMethodInfo> mInputMethodProperties; private List<InputMethodInfo> mInputMethodProperties;
private List<CheckBoxPreference> mCheckboxes;
final TextUtils.SimpleStringSplitter mStringColonSplitter final TextUtils.SimpleStringSplitter mStringColonSplitter
= new TextUtils.SimpleStringSplitter(':'); = new TextUtils.SimpleStringSplitter(':');
@@ -80,20 +62,15 @@ public class LanguageSettings extends PreferenceActivity {
getPreferenceScreen(). getPreferenceScreen().
removePreference(findPreference("language_category")); removePreference(findPreference("language_category"));
} }
Configuration config = getResources().getConfiguration(); Configuration config = getResources().getConfiguration();
if (config.keyboard != Configuration.KEYBOARD_QWERTY) { if (config.keyboard != Configuration.KEYBOARD_QWERTY) {
getPreferenceScreen().removePreference( getPreferenceScreen().removePreference(
getPreferenceScreen().findPreference("hardkeyboard_category")); getPreferenceScreen().findPreference("hardkeyboard_category"));
} else { } else {
ContentResolver resolver = getContentResolver(); mHaveHardKeyboard = true;
for (int i = 0; i < mSettingsUiKey.length; i++) {
CheckBoxPreference pref = (CheckBoxPreference) findPreference(mSettingsUiKey[i]);
pref.setChecked(System.getInt(resolver, mSettingsSystemId[i],
mSettingsDefault[i]) > 0);
}
} }
mCheckboxes = new ArrayList<CheckBoxPreference>();
onCreateIMM(); onCreateIMM();
} }
@@ -116,18 +93,27 @@ public class LanguageSettings extends PreferenceActivity {
CharSequence label = property.loadLabel(getPackageManager()); CharSequence label = property.loadLabel(getPackageManager());
// Add a check box. // Add a check box.
CheckBoxPreference chkbxPref = new CheckBoxPreference(this); // Don't show the toggle if it's the only keyboard in the system
chkbxPref.setKey(prefKey); if (mHaveHardKeyboard || N > 1) {
chkbxPref.setTitle(label); CheckBoxPreference chkbxPref = new CheckBoxPreference(this);
textCategory.addPreference(chkbxPref); chkbxPref.setKey(prefKey);
chkbxPref.setTitle(label);
textCategory.addPreference(chkbxPref);
mCheckboxes.add(chkbxPref);
}
// If setting activity is available, add a setting screen entry. // If setting activity is available, add a setting screen entry.
if (null != property.getSettingsActivity()) { if (null != property.getSettingsActivity()) {
PreferenceScreen prefScreen = new PreferenceScreen(this, null); PreferenceScreen prefScreen = new PreferenceScreen(this, null);
prefScreen.setKey(property.getSettingsActivity()); prefScreen.setKey(property.getSettingsActivity());
CharSequence settingsLabel = getResources().getString( prefScreen.setTitle(label);
R.string.input_methods_settings_label_format, label); if (N == 1) {
prefScreen.setTitle(settingsLabel); prefScreen.setSummary(getString(R.string.onscreen_keyboard_settings_summary));
} else {
CharSequence settingsLabel = getResources().getString(
R.string.input_methods_settings_label_format, label);
prefScreen.setSummary(settingsLabel);
}
textCategory.addPreference(prefScreen); textCategory.addPreference(prefScreen);
} }
} }
@@ -154,8 +140,11 @@ public class LanguageSettings extends PreferenceActivity {
final String id = mInputMethodProperties.get(i).getId(); final String id = mInputMethodProperties.get(i).getId();
CheckBoxPreference pref = (CheckBoxPreference) findPreference(mInputMethodProperties CheckBoxPreference pref = (CheckBoxPreference) findPreference(mInputMethodProperties
.get(i).getId()); .get(i).getId());
pref.setChecked(enabled.contains(id)); if (pref != null) {
pref.setChecked(enabled.contains(id));
}
} }
updateCheckboxes();
mLastTickedInputMethodId = null; mLastTickedInputMethodId = null;
} }
@@ -173,7 +162,7 @@ public class LanguageSettings extends PreferenceActivity {
final String id = mInputMethodProperties.get(i).getId(); final String id = mInputMethodProperties.get(i).getId();
CheckBoxPreference pref = (CheckBoxPreference) findPreference(id); CheckBoxPreference pref = (CheckBoxPreference) findPreference(id);
boolean hasIt = id.equals(mLastInputMethodId); boolean hasIt = id.equals(mLastInputMethodId);
if (pref.isChecked()) { if ((N == 1 && !mHaveHardKeyboard) || (pref != null && pref.isChecked())) {
if (builder.length() > 0) builder.append(':'); if (builder.length() > 0) builder.append(':');
builder.append(id); builder.append(id);
if (firstEnabled < 0) { if (firstEnabled < 0) {
@@ -200,18 +189,30 @@ public class LanguageSettings extends PreferenceActivity {
Settings.Secure.DEFAULT_INPUT_METHOD, mLastInputMethodId); Settings.Secure.DEFAULT_INPUT_METHOD, mLastInputMethodId);
} }
@Override private void updateCheckboxes() {
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { final int count = mCheckboxes.size();
int nChecked = 0;
// Physical keyboard stuff int iChecked = -1;
for (int i = 0; i < mSettingsUiKey.length; i++) { // See how many are checked and note the only or last checked one
if (mSettingsUiKey[i].equals(preference.getKey())) { for (int i = 0; i < count; i++) {
System.putInt(getContentResolver(), mSettingsSystemId[i], if (mCheckboxes.get(i).isChecked()) {
((CheckBoxPreference)preference).isChecked()? 1 : 0); iChecked = i;
return true; nChecked++;
} }
} }
//
if (nChecked == 1) {
mCheckboxes.get(iChecked).setEnabled(false);
} else {
for (int i = 0; i < count; i++) {
mCheckboxes.get(i).setEnabled(true);
}
}
}
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
// Input Method stuff // Input Method stuff
// Those monkeys kept committing suicide, so we add this property // Those monkeys kept committing suicide, so we add this property
// to disable this functionality // to disable this functionality
@@ -240,7 +241,7 @@ public class LanguageSettings extends PreferenceActivity {
} }
} }
} }
updateCheckboxes();
return super.onPreferenceTreeClick(preferenceScreen, preference); return super.onPreferenceTreeClick(preferenceScreen, preference);
} }

View File

@@ -0,0 +1,83 @@
/*
* Copyright (C) 2009 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.ContentResolver;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.provider.Settings.System;
public class PhysicalKeyboardSettings extends PreferenceActivity {
private final String[] mSettingsUiKey = {
"auto_caps",
"auto_replace",
"auto_punctuate",
};
// Note: Order of this array should correspond to the order of the above array
private final String[] mSettingsSystemId = {
System.TEXT_AUTO_CAPS,
System.TEXT_AUTO_REPLACE,
System.TEXT_AUTO_PUNCTUATE,
};
// Note: Order of this array should correspond to the order of the above array
private final int[] mSettingsDefault = {
1,
1,
1,
};
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.keyboard_settings);
}
@Override
protected void onResume() {
super.onResume();
ContentResolver resolver = getContentResolver();
for (int i = 0; i < mSettingsUiKey.length; i++) {
CheckBoxPreference pref = (CheckBoxPreference) findPreference(mSettingsUiKey[i]);
pref.setChecked(System.getInt(resolver, mSettingsSystemId[i],
mSettingsDefault[i]) > 0);
}
}
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
// Physical keyboard stuff
for (int i = 0; i < mSettingsUiKey.length; i++) {
if (mSettingsUiKey[i].equals(preference.getKey())) {
System.putInt(getContentResolver(), mSettingsSystemId[i],
((CheckBoxPreference)preference).isChecked()? 1 : 0);
return true;
}
}
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
}

View File

@@ -560,7 +560,7 @@ public class RadioInfo extends Activity {
// Get the toggle-data-on-boot menu item in the right state. // Get the toggle-data-on-boot menu item in the right state.
item = menu.findItem(MENU_ITEM_TOGGLE_DATA_ON_BOOT); item = menu.findItem(MENU_ITEM_TOGGLE_DATA_ON_BOOT);
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication()); SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
boolean value = sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false); boolean value = sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false);
if (value) { if (value) {
item.setTitle(R.string.radioInfo_menu_enableDataOnBoot); item.setTitle(R.string.radioInfo_menu_enableDataOnBoot);
@@ -584,7 +584,7 @@ public class RadioInfo extends Activity {
private void updateQxdmState(Boolean newQxdmStatus) { private void updateQxdmState(Boolean newQxdmStatus) {
SharedPreferences sp = SharedPreferences sp =
PreferenceManager.getDefaultSharedPreferences(this.getApplication()); PreferenceManager.getDefaultSharedPreferences(phone.getContext());
mQxdmLogEnabled = sp.getBoolean("qxdmstatus", false); mQxdmLogEnabled = sp.getBoolean("qxdmstatus", false);
// This is called from onCreate, onResume, and the handler when the status // This is called from onCreate, onResume, and the handler when the status
// is updated. // is updated.
@@ -602,14 +602,14 @@ public class RadioInfo extends Activity {
} }
private void setCiphPref(boolean value) { private void setCiphPref(boolean value) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication()); SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(GSMPhone.CIPHERING_KEY, value); editor.putBoolean(GSMPhone.CIPHERING_KEY, value);
editor.commit(); editor.commit();
} }
private boolean getCiphPref() { private boolean getCiphPref() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication()); SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
boolean ret = sp.getBoolean(GSMPhone.CIPHERING_KEY, true); boolean ret = sp.getBoolean(GSMPhone.CIPHERING_KEY, true);
return ret; return ret;
} }
@@ -1044,7 +1044,7 @@ public class RadioInfo extends Activity {
}; };
private void toggleDataDisabledOnBoot() { private void toggleDataDisabledOnBoot() {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication()); SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
SharedPreferences.Editor editor = sp.edit(); SharedPreferences.Editor editor = sp.edit();
boolean value = sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false); boolean value = sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false);
editor.putBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, !value); editor.putBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, !value);

View File

@@ -1,5 +1,5 @@
/** /**
* Copyright (C) 2007 Google Inc. * Copyright (C) 2009 Google Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * 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 * use this file except in compliance with the License. You may obtain a copy
@@ -136,7 +136,7 @@ public class UserDictionarySettings extends ListActivity {
@Override @Override
protected void onListItemClick(ListView l, View v, int position, long id) { protected void onListItemClick(ListView l, View v, int position, long id) {
showAddOrEditDialog(getWord(position)); openContextMenu(v);
} }
@Override @Override
@@ -145,8 +145,10 @@ public class UserDictionarySettings extends ListActivity {
AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo; AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo;
menu.setHeaderTitle(getWord(adapterMenuInfo.position)); menu.setHeaderTitle(getWord(adapterMenuInfo.position));
menu.add(0, CONTEXT_MENU_EDIT, 0, R.string.user_dict_settings_context_menu_edit_title); menu.add(0, CONTEXT_MENU_EDIT, 0,
menu.add(0, CONTEXT_MENU_DELETE, 0, R.string.user_dict_settings_context_menu_delete_title); R.string.user_dict_settings_context_menu_edit_title);
menu.add(0, CONTEXT_MENU_DELETE, 0,
R.string.user_dict_settings_context_menu_delete_title);
} }
@Override @Override
@@ -203,7 +205,9 @@ public class UserDictionarySettings extends ListActivity {
| InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE); | InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setTitle(R.string.user_dict_settings_add_dialog_title) .setTitle(mDialogEditingWord != null
? R.string.user_dict_settings_edit_dialog_title
: R.string.user_dict_settings_add_dialog_title)
.setView(content) .setView(content)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
@@ -216,10 +220,12 @@ public class UserDictionarySettings extends ListActivity {
}}) }})
.create(); .create();
} }
@Override @Override
protected void onPrepareDialog(int id, Dialog d) { protected void onPrepareDialog(int id, Dialog d) {
AlertDialog dialog = (AlertDialog) d; AlertDialog dialog = (AlertDialog) d;
d.setTitle(mDialogEditingWord != null
? R.string.user_dict_settings_edit_dialog_title
: R.string.user_dict_settings_add_dialog_title);
EditText editText = (EditText) dialog.findViewById(R.id.edittext); EditText editText = (EditText) dialog.findViewById(R.id.edittext);
editText.setText(mDialogEditingWord); editText.setText(mDialogEditingWord);
} }

View File

@@ -24,6 +24,7 @@ import android.content.DialogInterface;
import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.Bundle; import android.os.Bundle;
import android.text.InputType;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.format.Formatter; import android.text.format.Formatter;
import android.text.method.PasswordTransformationMethod; import android.text.method.PasswordTransformationMethod;
@@ -589,11 +590,9 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
private void setShowPassword(boolean showPassword) { private void setShowPassword(boolean showPassword) {
if (mPasswordEdit != null) { if (mPasswordEdit != null) {
// Toggle password mPasswordEdit.setInputType(InputType.TYPE_CLASS_TEXT |
mPasswordEdit.setTransformationMethod( (showPassword ? InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
showPassword ? : InputType.TYPE_TEXT_VARIATION_PASSWORD));
null :
PasswordTransformationMethod.getInstance());
} }
} }