auto import from //depot/cupcake/@136594
This commit is contained in:
@@ -149,6 +149,14 @@
|
||||
</intent-filter>
|
||||
</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"
|
||||
android:label="@string/input_methods_settings_title"
|
||||
>
|
||||
@@ -393,14 +401,6 @@
|
||||
</intent-filter>
|
||||
</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. -->
|
||||
<receiver android:name=".DeviceInfo$StatsReportReceiver">
|
||||
<intent-filter>
|
||||
|
@@ -14,58 +14,63 @@
|
||||
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_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingBottom="20dip">
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<ImageView android:id="@android:id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dip" />
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingBottom="20dip">
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/incoming_call_volume_title"
|
||||
android:paddingTop="20dip"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingRight="20dip" />
|
||||
|
||||
<!-- Used for the ring volume. This is what the superclass VolumePreference uses. -->
|
||||
<SeekBar android:id="@*android:id/seekbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingRight="20dip" />
|
||||
<ImageView android:id="@android:id/icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="20dip" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/incoming_call_volume_title"
|
||||
android:paddingTop="20dip"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingRight="20dip" />
|
||||
|
||||
<CheckBox android:id="@+id/same_notification_volume"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkbox_notification_same_as_incoming_call"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_marginTop="6dip"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_marginRight="20dip" />
|
||||
|
||||
<TextView android:id="@+id/notification_volume_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/notification_volume_title"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingRight="20dip" />
|
||||
<!-- Used for the ring volume. This is what the superclass VolumePreference uses. -->
|
||||
<SeekBar android:id="@*android:id/seekbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingRight="20dip" />
|
||||
|
||||
<CheckBox android:id="@+id/same_notification_volume"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/checkbox_notification_same_as_incoming_call"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:layout_marginTop="6dip"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_marginRight="20dip" />
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<TextView android:id="@+id/notification_volume_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/notification_volume_title"
|
||||
android:paddingTop="6dip"
|
||||
android:paddingLeft="20dip"
|
||||
android:paddingRight="20dip" />
|
||||
|
||||
<!-- 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>
|
@@ -1324,6 +1324,8 @@ found in the list of installed applications.</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. -->
|
||||
<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 -->
|
||||
<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 -->
|
||||
@@ -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_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" -->
|
||||
<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. -->
|
||||
<string name="development_settings_title">Development</string>
|
||||
|
39
res/xml/keyboard_settings.xml
Normal file
39
res/xml/keyboard_settings.xml
Normal 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>
|
@@ -29,6 +29,15 @@
|
||||
<PreferenceCategory android:key="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
|
||||
android:title="@string/user_dict_settings_title"
|
||||
android:summary="@string/user_dict_settings_summary">
|
||||
@@ -37,26 +46,4 @@
|
||||
android:targetClass="com.android.settings.UserDictionarySettings" />
|
||||
</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>
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.settings;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
@@ -28,37 +27,20 @@ import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.System;
|
||||
import android.text.TextUtils;
|
||||
import android.view.inputmethod.InputMethodInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
public class LanguageSettings 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,
|
||||
};
|
||||
private boolean mHaveHardKeyboard;
|
||||
|
||||
// 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<CheckBoxPreference> mCheckboxes;
|
||||
|
||||
final TextUtils.SimpleStringSplitter mStringColonSplitter
|
||||
= new TextUtils.SimpleStringSplitter(':');
|
||||
@@ -80,20 +62,15 @@ public class LanguageSettings extends PreferenceActivity {
|
||||
getPreferenceScreen().
|
||||
removePreference(findPreference("language_category"));
|
||||
}
|
||||
|
||||
|
||||
Configuration config = getResources().getConfiguration();
|
||||
if (config.keyboard != Configuration.KEYBOARD_QWERTY) {
|
||||
getPreferenceScreen().removePreference(
|
||||
getPreferenceScreen().findPreference("hardkeyboard_category"));
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
mHaveHardKeyboard = true;
|
||||
}
|
||||
|
||||
mCheckboxes = new ArrayList<CheckBoxPreference>();
|
||||
onCreateIMM();
|
||||
}
|
||||
|
||||
@@ -116,18 +93,27 @@ public class LanguageSettings extends PreferenceActivity {
|
||||
CharSequence label = property.loadLabel(getPackageManager());
|
||||
|
||||
// Add a check box.
|
||||
CheckBoxPreference chkbxPref = new CheckBoxPreference(this);
|
||||
chkbxPref.setKey(prefKey);
|
||||
chkbxPref.setTitle(label);
|
||||
textCategory.addPreference(chkbxPref);
|
||||
// Don't show the toggle if it's the only keyboard in the system
|
||||
if (mHaveHardKeyboard || N > 1) {
|
||||
CheckBoxPreference chkbxPref = new CheckBoxPreference(this);
|
||||
chkbxPref.setKey(prefKey);
|
||||
chkbxPref.setTitle(label);
|
||||
textCategory.addPreference(chkbxPref);
|
||||
mCheckboxes.add(chkbxPref);
|
||||
}
|
||||
|
||||
// If setting activity is available, add a setting screen entry.
|
||||
if (null != property.getSettingsActivity()) {
|
||||
PreferenceScreen prefScreen = new PreferenceScreen(this, null);
|
||||
prefScreen.setKey(property.getSettingsActivity());
|
||||
CharSequence settingsLabel = getResources().getString(
|
||||
R.string.input_methods_settings_label_format, label);
|
||||
prefScreen.setTitle(settingsLabel);
|
||||
prefScreen.setTitle(label);
|
||||
if (N == 1) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -154,8 +140,11 @@ public class LanguageSettings extends PreferenceActivity {
|
||||
final String id = mInputMethodProperties.get(i).getId();
|
||||
CheckBoxPreference pref = (CheckBoxPreference) findPreference(mInputMethodProperties
|
||||
.get(i).getId());
|
||||
pref.setChecked(enabled.contains(id));
|
||||
if (pref != null) {
|
||||
pref.setChecked(enabled.contains(id));
|
||||
}
|
||||
}
|
||||
updateCheckboxes();
|
||||
mLastTickedInputMethodId = null;
|
||||
}
|
||||
|
||||
@@ -173,7 +162,7 @@ public class LanguageSettings extends PreferenceActivity {
|
||||
final String id = mInputMethodProperties.get(i).getId();
|
||||
CheckBoxPreference pref = (CheckBoxPreference) findPreference(id);
|
||||
boolean hasIt = id.equals(mLastInputMethodId);
|
||||
if (pref.isChecked()) {
|
||||
if ((N == 1 && !mHaveHardKeyboard) || (pref != null && pref.isChecked())) {
|
||||
if (builder.length() > 0) builder.append(':');
|
||||
builder.append(id);
|
||||
if (firstEnabled < 0) {
|
||||
@@ -200,18 +189,30 @@ public class LanguageSettings extends PreferenceActivity {
|
||||
Settings.Secure.DEFAULT_INPUT_METHOD, mLastInputMethodId);
|
||||
}
|
||||
|
||||
@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;
|
||||
private void updateCheckboxes() {
|
||||
final int count = mCheckboxes.size();
|
||||
int nChecked = 0;
|
||||
int iChecked = -1;
|
||||
// See how many are checked and note the only or last checked one
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (mCheckboxes.get(i).isChecked()) {
|
||||
iChecked = i;
|
||||
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
|
||||
// Those monkeys kept committing suicide, so we add this property
|
||||
// to disable this functionality
|
||||
@@ -240,7 +241,7 @@ public class LanguageSettings extends PreferenceActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateCheckboxes();
|
||||
return super.onPreferenceTreeClick(preferenceScreen, preference);
|
||||
}
|
||||
|
||||
|
83
src/com/android/settings/PhysicalKeyboardSettings.java
Normal file
83
src/com/android/settings/PhysicalKeyboardSettings.java
Normal 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);
|
||||
}
|
||||
|
||||
}
|
@@ -560,7 +560,7 @@ public class RadioInfo extends Activity {
|
||||
|
||||
// Get the toggle-data-on-boot menu item in the right state.
|
||||
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);
|
||||
if (value) {
|
||||
item.setTitle(R.string.radioInfo_menu_enableDataOnBoot);
|
||||
@@ -584,7 +584,7 @@ public class RadioInfo extends Activity {
|
||||
|
||||
private void updateQxdmState(Boolean newQxdmStatus) {
|
||||
SharedPreferences sp =
|
||||
PreferenceManager.getDefaultSharedPreferences(this.getApplication());
|
||||
PreferenceManager.getDefaultSharedPreferences(phone.getContext());
|
||||
mQxdmLogEnabled = sp.getBoolean("qxdmstatus", false);
|
||||
// This is called from onCreate, onResume, and the handler when the status
|
||||
// is updated.
|
||||
@@ -602,14 +602,14 @@ public class RadioInfo extends Activity {
|
||||
}
|
||||
|
||||
private void setCiphPref(boolean value) {
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication());
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putBoolean(GSMPhone.CIPHERING_KEY, value);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
private boolean getCiphPref() {
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication());
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
|
||||
boolean ret = sp.getBoolean(GSMPhone.CIPHERING_KEY, true);
|
||||
return ret;
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ public class RadioInfo extends Activity {
|
||||
};
|
||||
|
||||
private void toggleDataDisabledOnBoot() {
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this.getApplication());
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(phone.getContext());
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
boolean value = sp.getBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, false);
|
||||
editor.putBoolean(GSMPhone.DATA_DISABLED_ON_BOOT_KEY, !value);
|
||||
|
@@ -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
|
||||
* use this file except in compliance with the License. You may obtain a copy
|
||||
@@ -136,7 +136,7 @@ public class UserDictionarySettings extends ListActivity {
|
||||
|
||||
@Override
|
||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||
showAddOrEditDialog(getWord(position));
|
||||
openContextMenu(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,8 +145,10 @@ public class UserDictionarySettings extends ListActivity {
|
||||
|
||||
AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo;
|
||||
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_DELETE, 0, R.string.user_dict_settings_context_menu_delete_title);
|
||||
menu.add(0, CONTEXT_MENU_EDIT, 0,
|
||||
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
|
||||
@@ -203,7 +205,9 @@ public class UserDictionarySettings extends ListActivity {
|
||||
| InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
|
||||
|
||||
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)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
@@ -216,10 +220,12 @@ public class UserDictionarySettings extends ListActivity {
|
||||
}})
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPrepareDialog(int id, Dialog 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.setText(mDialogEditingWord);
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ import android.content.DialogInterface;
|
||||
import android.net.wifi.WifiInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.Formatter;
|
||||
import android.text.method.PasswordTransformationMethod;
|
||||
@@ -589,11 +590,9 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
||||
|
||||
private void setShowPassword(boolean showPassword) {
|
||||
if (mPasswordEdit != null) {
|
||||
// Toggle password
|
||||
mPasswordEdit.setTransformationMethod(
|
||||
showPassword ?
|
||||
null :
|
||||
PasswordTransformationMethod.getInstance());
|
||||
mPasswordEdit.setInputType(InputType.TYPE_CLASS_TEXT |
|
||||
(showPassword ? InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
|
||||
: InputType.TYPE_TEXT_VARIATION_PASSWORD));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user