summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:58 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:58 -0800
commite3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8 (patch)
treee1440f63420acf2b3808f57738bc600b5d710c1e /apps
parent5a4d0fa291a7269007701282f32cfda55ce39008 (diff)
downloadandroid_development-e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8.tar.gz
android_development-e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8.tar.bz2
android_development-e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8.zip
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'apps')
-rw-r--r--apps/Fallback/res/values-ko/strings.xml21
-rw-r--r--apps/Fallback/res/values-nb/strings.xml21
-rw-r--r--apps/SpareParts/res/values/strings.xml4
-rw-r--r--apps/SpareParts/res/xml/spare_parts.xml6
-rw-r--r--apps/SpareParts/src/com/android/spare_parts/SpareParts.java10
-rw-r--r--apps/Term/AndroidManifest.xml3
-rw-r--r--apps/Term/src/com/android/term/Term.java121
7 files changed, 184 insertions, 2 deletions
diff --git a/apps/Fallback/res/values-ko/strings.xml b/apps/Fallback/res/values-ko/strings.xml
new file mode 100644
index 000000000..1e98e2031
--- /dev/null
+++ b/apps/Fallback/res/values-ko/strings.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="appTitle">"Fallback"</string>
+ <string name="title">"지원되지 않는 작업"</string>
+ <string name="error">"이 작업은 현재 지원되지 않습니다."</string>
+</resources>
diff --git a/apps/Fallback/res/values-nb/strings.xml b/apps/Fallback/res/values-nb/strings.xml
new file mode 100644
index 000000000..6fed6609a
--- /dev/null
+++ b/apps/Fallback/res/values-nb/strings.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="appTitle">"Fallback"</string>
+ <string name="title">"Ustøttet handling"</string>
+ <string name="error">"Denne handlingen er ikke støttet nå."</string>
+</resources>
diff --git a/apps/SpareParts/res/values/strings.xml b/apps/SpareParts/res/values/strings.xml
index 8565a52ef..7c776d83a 100644
--- a/apps/SpareParts/res/values/strings.xml
+++ b/apps/SpareParts/res/values/strings.xml
@@ -30,6 +30,10 @@
<string name="summary_transition_animations">Speed of animations moving between screens</string>
<string name="dialog_title_transition_animations">Select transition speed</string>
+ <string name="title_fancy_ime_animations">Fancy input animations</string>
+ <string name="summary_on_fancy_ime_animations">Use fancier animations for input method windows</string>
+ <string name="summary_off_fancy_ime_animations">Use normal animations for input method windows</string>
+
<string name="title_font_size">Font size</string>
<string name="summary_font_size">Overall size of fonts</string>
<string name="dialog_title_font_size">Select font size</string>
diff --git a/apps/SpareParts/res/xml/spare_parts.xml b/apps/SpareParts/res/xml/spare_parts.xml
index ce673e340..860889600 100644
--- a/apps/SpareParts/res/xml/spare_parts.xml
+++ b/apps/SpareParts/res/xml/spare_parts.xml
@@ -37,6 +37,12 @@
android:entryValues="@array/entryvalues_animations"
android:dialogTitle="@string/dialog_title_transition_animations" />
+ <CheckBoxPreference
+ android:key="fancy_ime_animations"
+ android:title="@string/title_fancy_ime_animations"
+ android:summaryOn="@string/summary_on_fancy_ime_animations"
+ android:summaryOff="@string/summary_off_fancy_ime_animations"/>
+
<ListPreference
android:key="font_size"
android:title="@string/title_font_size"
diff --git a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
index 9de9a457c..facaf6947 100644
--- a/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
+++ b/apps/SpareParts/src/com/android/spare_parts/SpareParts.java
@@ -42,6 +42,7 @@ public class SpareParts extends PreferenceActivity
private static final String WINDOW_ANIMATIONS_PREF = "window_animations";
private static final String TRANSITION_ANIMATIONS_PREF = "transition_animations";
+ private static final String FANCY_IME_ANIMATIONS_PREF = "fancy_ime_animations";
private static final String FONT_SIZE_PREF = "font_size";
private static final String END_BUTTON_PREF = "end_button";
private static final String ACCELEROMETER_PREF = "accelerometer";
@@ -51,6 +52,7 @@ public class SpareParts extends PreferenceActivity
private ListPreference mWindowAnimationsPref;
private ListPreference mTransitionAnimationsPref;
+ private CheckBoxPreference mFancyImeAnimationsPref;
private ListPreference mFontSizePref;
private ListPreference mEndButtonPref;
private CheckBoxPreference mAccelerometerPref;
@@ -69,6 +71,7 @@ public class SpareParts extends PreferenceActivity
mWindowAnimationsPref.setOnPreferenceChangeListener(this);
mTransitionAnimationsPref = (ListPreference) prefSet.findPreference(TRANSITION_ANIMATIONS_PREF);
mTransitionAnimationsPref.setOnPreferenceChangeListener(this);
+ mFancyImeAnimationsPref = (CheckBoxPreference) prefSet.findPreference(FANCY_IME_ANIMATIONS_PREF);
mFontSizePref = (ListPreference) prefSet.findPreference(FONT_SIZE_PREF);
mFontSizePref.setOnPreferenceChangeListener(this);
mEndButtonPref = (ListPreference) prefSet.findPreference(END_BUTTON_PREF);
@@ -83,6 +86,9 @@ public class SpareParts extends PreferenceActivity
private void updateToggles() {
try {
+ mFancyImeAnimationsPref.setChecked(Settings.System.getInt(
+ getContentResolver(),
+ Settings.System.FANCY_IME_ANIMATIONS, 0) != 0);
mAccelerometerPref.setChecked(Settings.System.getInt(
getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION, 0) != 0);
@@ -181,6 +187,10 @@ public class SpareParts extends PreferenceActivity
Settings.System.putInt(getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION,
mAccelerometerPref.isChecked() ? 1 : 0);
+ } else if (FANCY_IME_ANIMATIONS_PREF.equals(key)) {
+ Settings.System.putInt(getContentResolver(),
+ Settings.System.FANCY_IME_ANIMATIONS,
+ mFancyImeAnimationsPref.isChecked() ? 1 : 0);
} else if (MAPS_COMPASS_PREF.equals(key)) {
try {
Context c = createPackageContext("com.google.android.apps.maps", 0);
diff --git a/apps/Term/AndroidManifest.xml b/apps/Term/AndroidManifest.xml
index 8975fa4ea..7084d2c2c 100644
--- a/apps/Term/AndroidManifest.xml
+++ b/apps/Term/AndroidManifest.xml
@@ -4,7 +4,8 @@
<activity android:name="Term"
android:theme="@style/Theme"
android:launchMode="singleInstance"
- android:configChanges="keyboard|keyboardHidden|orientation">
+ android:configChanges="keyboard|keyboardHidden|orientation"
+ android:windowSoftInputMode="adjustResize|stateVisible">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.TEST" />
diff --git a/apps/Term/src/com/android/term/Term.java b/apps/Term/src/com/android/term/Term.java
index 55cee3c2b..a621ffd51 100644
--- a/apps/Term/src/com/android/term/Term.java
+++ b/apps/Term/src/com/android/term/Term.java
@@ -48,6 +48,12 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
+import android.view.inputmethod.CompletionInfo;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.ExtractedText;
+import android.view.inputmethod.ExtractedTextRequest;
+import android.view.inputmethod.InputConnection;
+import android.view.inputmethod.InputMethodManager;
import java.io.FileDescriptor;
import java.io.FileInputStream;
@@ -177,6 +183,9 @@ public class Term extends Activity {
mKeyListener = new TermKeyListener();
+ mEmulatorView.setFocusable(true);
+ mEmulatorView.requestFocus();
+
updatePrefs();
}
@@ -2583,7 +2592,6 @@ class EmulatorView extends View implements GestureDetector.OnGestureListener {
private FileOutputStream mTermOut;
private ByteQueue mByteQueue;
- private final static int MAX_BYTES_PER_UPDATE = 4 * 1024;
/**
* Used to temporarily hold data received from the remote process. Allocated
@@ -2643,6 +2651,117 @@ class EmulatorView extends View implements GestureDetector.OnGestureListener {
invalidate();
}
+ @Override
+ public boolean onCheckIsTextEditor() {
+ return true;
+ }
+
+ @Override
+ public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
+ return new InputConnection(){
+
+ public boolean beginBatchEdit() {
+ return true;
+ }
+
+ public boolean clearMetaKeyStates(int states) {
+ return true;
+ }
+
+ public boolean commitCompletion(CompletionInfo text) {
+ return true;
+ }
+
+ public boolean commitText(CharSequence text, int newCursorPosition) {
+ sendText(text);
+ return true;
+ }
+
+ public boolean deleteSurroundingText(int leftLength, int rightLength) {
+ return true;
+ }
+
+ public boolean endBatchEdit() {
+ return true;
+ }
+
+ public boolean finishComposingText() {
+ return true;
+ }
+
+ public int getCursorCapsMode(int reqModes) {
+ return 0;
+ }
+
+ public ExtractedText getExtractedText(ExtractedTextRequest request,
+ int flags) {
+ return null;
+ }
+
+ public CharSequence getTextAfterCursor(int n, int flags) {
+ return null;
+ }
+
+ public CharSequence getTextBeforeCursor(int n, int flags) {
+ return null;
+ }
+
+ public boolean hideStatusIcon() {
+ return true;
+ }
+
+ public boolean performContextMenuAction(int id) {
+ return true;
+ }
+
+ public boolean performPrivateCommand(String action, Bundle data) {
+ return true;
+ }
+
+ public boolean sendKeyEvent(KeyEvent event) {
+ switch(event.getKeyCode()) {
+ case KeyEvent.KEYCODE_ENTER:
+ sendChar('\r');
+ break;
+ case KeyEvent.KEYCODE_DEL:
+ sendChar(127);
+ break;
+ }
+ return true;
+ }
+
+ public boolean setComposingText(CharSequence text, int newCursorPosition) {
+ return true;
+ }
+
+ public boolean setSelection(int start, int end) {
+ return true;
+ }
+
+ public boolean showStatusIcon(String packageName, int resId) {
+ return true;
+ }
+
+ private void sendChar(int c) {
+ try {
+ mTermOut.write(c);
+ } catch (IOException ex) {
+
+ }
+ }
+ private void sendText(CharSequence text) {
+ int n = text.length();
+ try {
+ for(int i = 0; i < n; i++) {
+ char c = text.charAt(i);
+ mTermOut.write(c);
+ }
+ } catch (IOException e) {
+ }
+ }
+ };
+ }
+
public boolean getKeypadApplicationMode() {
return mEmulator.getKeypadApplicationMode();
}