diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:44:00 -0800 |
commit | d24b8183b93e781080b2c16c487e60d51c12da31 (patch) | |
tree | fbb89154858984eb8e41556da7e9433040d55cd4 /tests/ImfTest | |
parent | f1e484acb594a726fb57ad0ae4cfe902c7f35858 (diff) | |
download | frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.zip frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.gz frameworks_base-d24b8183b93e781080b2c16c487e60d51c12da31.tar.bz2 |
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'tests/ImfTest')
22 files changed, 1121 insertions, 13 deletions
diff --git a/tests/ImfTest/AndroidManifest.xml b/tests/ImfTest/AndroidManifest.xml index 85d6b0c..627ee6d 100755 --- a/tests/ImfTest/AndroidManifest.xml +++ b/tests/ImfTest/AndroidManifest.xml @@ -19,6 +19,134 @@ </intent-filter> </activity> + <activity android:name=".samples.AppAdjustmentBigEditTextNonScrollablePanScan" android:label="Big ET !Scroll Pan/Scan"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.ManyEditTextActivityNoScrollPanScan" android:label="ManyEditTextActivityNoScrollPanScan"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.AppAdjustmentBigEditTextNonScrollableResize" android:label="Big ET !Scroll Resize"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.AppAdjustmentBigEditTextScrollablePanScan" android:label="Big ET Scroll Pan/Scan"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.AppAdjustmentBigEditTextScrollableResize" android:label="Big ET Scroll Resize"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.AppAdjustmentEditTextDialog" android:label="ET Dialog"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.ManyEditTextActivityScrollPanScan" android:label="ManyEditTextActivityScrollPanScan"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.ManyEditTextActivityScrollResize" android:label="ManyEditTextActivityScrollResize"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.BottomEditTextActivityPanScan" android:label="BottomEditTextActivityPanScan"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.BottomEditTextActivityResize" android:label="BottomEditTextActivityResize"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.OneEditTextActivitySelected" android:label="OneEditTextActivitySelected"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.OneEditTextActivityNotSelected" android:label="OneEditTextActivityNotSelected"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.AutoCompleteTextViewActivityPortrait" android:label="AutoCompleteTextViewActivityPortrait" android:screenOrientation="portrait"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.AutoCompleteTextViewActivityLandscape" android:label="AutoCompleteTextViewActivityLandscape" android:screenOrientation="landscape"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.OneEditTextActivityLandscape" android:label="OneEditTextActivityLandscape" android:screenOrientation="landscape"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + + <activity android:name=".samples.DialogActivity" android:label="DialogActivity" android:screenOrientation="portrait"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER" /> + <category android:name="android.intent.category.IMF_TEST" /> + </intent-filter> + </activity> + </application> </manifest> diff --git a/tests/ImfTest/res/layout/dialog_edit_text_no_scroll.xml b/tests/ImfTest/res/layout/dialog_edit_text_no_scroll.xml new file mode 100644 index 0000000..e8ffa1c --- /dev/null +++ b/tests/ImfTest/res/layout/dialog_edit_text_no_scroll.xml @@ -0,0 +1,36 @@ +<?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. +--> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:padding="20dip" + android:orientation="vertical"> + + <View + android:id="@+id/blank" + android:layout_height="0dip" + android:layout_width="fill_parent" + android:layout_weight="1"/> + + <EditText + android:id="@+id/dialog_edit_text" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:scrollHorizontally="true" + android:textAppearance="?android:attr/textAppearanceMedium" /> + +</LinearLayout> diff --git a/tests/ImfTest/res/layout/full_screen_edit_text.xml b/tests/ImfTest/res/layout/full_screen_edit_text.xml new file mode 100755 index 0000000..f22aa2f --- /dev/null +++ b/tests/ImfTest/res/layout/full_screen_edit_text.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* //device/samples/SampleCode/res/layout/baseline_1.xml +** +** Copyright 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. +*/ +--> + +<EditText xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/data" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:minLines="15" + android:gravity="top"/> + diff --git a/tests/ImfTest/res/layout/one_edit_text_activity.xml b/tests/ImfTest/res/layout/one_edit_text_activity.xml new file mode 100755 index 0000000..09925e1 --- /dev/null +++ b/tests/ImfTest/res/layout/one_edit_text_activity.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* //device/samples/SampleCode/res/layout/baseline_1.xml +** +** Copyright 2007, 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. +*/ +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:orientation="vertical" +> + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" + android:baselineAligned="false"> + + <View android:id="@+id/blank" + android:layout_height="0dip" + android:layout_width="fill_parent" + android:layout_weight="1" + /> + + <EditText android:id="@+id/dialog_edit_text" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:scrollHorizontally="true" + android:textAppearance="?android:attr/textAppearanceMedium" + /> + </LinearLayout> + + <View + android:layout_width="fill_parent" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" + /> +</LinearLayout> diff --git a/tests/ImfTest/res/values/strings.xml b/tests/ImfTest/res/values/strings.xml index a56c363..fc87480 100755 --- a/tests/ImfTest/res/values/strings.xml +++ b/tests/ImfTest/res/values/strings.xml @@ -35,5 +35,16 @@ <string name="normal_datetime_edit_text_label">Datetime</string> <string name="date_edit_text_label">Date</string> <string name="time_edit_text_label">Time</string> + <string name="cap_chars_edit_text_label">Cap Chars</string> + <string name="cap_words_edit_text_label">Cap Words</string> + <string name="multiline_edit_text_label">Multiline</string> + <string name="search_edit_text_label">Search (flag)</string> + <string name="cap_sentences_edit_text_label">Cap Sentences</string> + <string name="auto_complete_edit_text_label">Auto Complete</string> + <string name="auto_correct_edit_text_label">Auto Correct</string> + <string name="test_dialog">Test Dialog</string> + <string name="open_dialog_scrollable">open scrollable dialog</string> + <string name="open_dialog_nonscrollable">open nonscrollable dialog</string> + </resources> diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java new file mode 100644 index 0000000..15a29c8 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollablePanScan.java @@ -0,0 +1,35 @@ +package com.android.imftest.samples; + +import com.android.imftest.R; + +import android.app.Activity; +import android.os.Bundle; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.LinearLayout; + +public class AppAdjustmentBigEditTextNonScrollablePanScan extends Activity { + + private LinearLayout mLayout; + + @Override + protected void onCreate(Bundle icicle) { + super.onCreate(icicle); + + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + + mLayout = new LinearLayout(this); + mLayout.setOrientation(LinearLayout.VERTICAL); + mLayout.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mLayout, false); + + mLayout.addView(editText); + + setContentView(mLayout); + } + +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java new file mode 100644 index 0000000..0726823 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextNonScrollableResize.java @@ -0,0 +1,35 @@ +package com.android.imftest.samples; + +import com.android.imftest.R; + +import android.app.Activity; +import android.os.Bundle; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.LinearLayout; + +public class AppAdjustmentBigEditTextNonScrollableResize extends Activity { + + private LinearLayout mLayout; + + @Override + protected void onCreate(Bundle icicle) { + super.onCreate(icicle); + + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + + mLayout = new LinearLayout(this); + mLayout.setOrientation(LinearLayout.VERTICAL); + mLayout.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mLayout, false); + + mLayout.addView(editText); + + setContentView(mLayout); + } + +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollablePanScan.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollablePanScan.java new file mode 100644 index 0000000..50a980b --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollablePanScan.java @@ -0,0 +1,44 @@ +package com.android.imftest.samples; + +import com.android.imftest.R; + +import android.app.Activity; +import android.os.Bundle; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.ScrollView; + +public class AppAdjustmentBigEditTextScrollablePanScan extends Activity { + + private ScrollView mScrollView; + private LinearLayout mLayout; + + @Override + protected void onCreate(Bundle icicle) { + super.onCreate(icicle); + + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + + mScrollView = new ScrollView(this); + mScrollView.setFillViewport(true); + mScrollView.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + mLayout = new LinearLayout(this); + mLayout.setOrientation(LinearLayout.VERTICAL); + mLayout.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mScrollView, false); + + mLayout.addView(editText); + mScrollView.addView(mLayout); + + setContentView(mScrollView); + } + +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollableResize.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollableResize.java new file mode 100644 index 0000000..a256878 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentBigEditTextScrollableResize.java @@ -0,0 +1,44 @@ +package com.android.imftest.samples; + +import com.android.imftest.R; + +import android.app.Activity; +import android.os.Bundle; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.ScrollView; + +public class AppAdjustmentBigEditTextScrollableResize extends Activity { + + private ScrollView mScrollView; + private LinearLayout mLayout; + + @Override + protected void onCreate(Bundle icicle) { + super.onCreate(icicle); + + getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + + mScrollView = new ScrollView(this); + mScrollView.setFillViewport(true); + mScrollView.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + mLayout = new LinearLayout(this); + mLayout.setOrientation(LinearLayout.VERTICAL); + mLayout.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + EditText editText = (EditText) getLayoutInflater().inflate(R.layout.full_screen_edit_text, mScrollView, false); + + mLayout.addView(editText); + mScrollView.addView(mLayout); + + setContentView(mScrollView); + } + +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentEditTextDialog.java b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentEditTextDialog.java new file mode 100644 index 0000000..e82f1d5 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AppAdjustmentEditTextDialog.java @@ -0,0 +1,96 @@ +package com.android.imftest.samples; + +import com.android.imftest.R; + +import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.ScrollView; + +public class AppAdjustmentEditTextDialog extends Activity { + + private static final int SCROLLABLE_DIALOG_ID = 0; + private static final int NONSCROLLABLE_DIALOG_ID = 1; + + private LinearLayout mLayout; + private ScrollView mScrollView; + private LayoutInflater mInflater; + private Button mButton1; + private Button mButton2; + + + @Override + protected void onCreate(Bundle icicle) { + super.onCreate(icicle); + + mLayout = new LinearLayout(this); + mLayout.setOrientation(LinearLayout.VERTICAL); + mLayout.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + mButton1 = new Button(this); + mButton1.setText(R.string.open_dialog_scrollable); + mButton1.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + showDialog(SCROLLABLE_DIALOG_ID); + } + }); + + mButton2 = new Button(this); + mButton2.setText(R.string.open_dialog_nonscrollable); + mButton2.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + showDialog(NONSCROLLABLE_DIALOG_ID); + } + }); + + mLayout.addView(mButton1); + mLayout.addView(mButton2); + + setContentView(mLayout); + } + + @Override + protected Dialog onCreateDialog(int id) { + switch (id) { + case SCROLLABLE_DIALOG_ID: + return createDialog(true); + case NONSCROLLABLE_DIALOG_ID: + return createDialog(false); + } + + return super.onCreateDialog(id); + } + + protected Dialog createDialog(boolean scrollable) { + View layout; + EditText editText; + + if (scrollable) { + layout = new ScrollView(AppAdjustmentEditTextDialog.this); + ((ScrollView) layout).setMinimumHeight(mLayout.getHeight()); + + ((ScrollView) layout).addView(( + LinearLayout) View.inflate(AppAdjustmentEditTextDialog.this, + R.layout.dialog_edit_text_no_scroll, null)); + } else { + layout = View.inflate(AppAdjustmentEditTextDialog.this, + R.layout.dialog_edit_text_no_scroll, null); + } + + Dialog d = new Dialog(AppAdjustmentEditTextDialog.this); + d.setTitle(getString(R.string.test_dialog)); + d.setCancelable(true); + d.setContentView(layout); + return d; + } + +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java new file mode 100644 index 0000000..9638d34 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java @@ -0,0 +1,85 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.app.ActivityManagerNative; +import android.os.Bundle; +import android.os.RemoteException; +import android.provider.MediaStore; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.AutoCompleteTextView; +import android.widget.ArrayAdapter; +import android.content.Intent; +import android.content.pm.ActivityInfo; + +import com.android.internal.R; + +/* + * Activity with AutoCompleteTextView forced to landscape mode + */ +public class AutoCompleteTextViewActivityLandscape extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + setContentView(R.layout.auto_complete_list); + + ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, + android.R.layout.simple_dropdown_item_1line, COUNTRIES); + AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit); + textView.setAdapter(adapter); + } + + static final String[] COUNTRIES = new String[] { + "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", + "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", + "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", + "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", + "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", + "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", + "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", + "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde", + "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", + "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", + "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", + "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic", + "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", + "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland", + "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia", + "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar", + "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", + "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary", + "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", + "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", + "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", + "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", + "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", + "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", + "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", + "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas", + "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", + "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", + "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena", + "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon", + "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal", + "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", + "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea", + "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden", + "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas", + "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", + "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda", + "Ukraine", "United Arab Emirates", "United Kingdom", + "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", + "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara", + "Yemen", "Yugoslavia", "Zambia", "Zimbabwe" + }; +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java new file mode 100644 index 0000000..58651e1 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java @@ -0,0 +1,79 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.AutoCompleteTextView; +import android.widget.ArrayAdapter; + +import com.android.internal.R; + +/* + * Activity with AutoCompleteTextView (Candidate bar should not appear) + */ +public class AutoCompleteTextViewActivityPortrait extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + setContentView(R.layout.auto_complete_list); + + ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, + android.R.layout.simple_dropdown_item_1line, COUNTRIES); + AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit); + textView.setAdapter(adapter); + } + + static final String[] COUNTRIES = new String[] { + "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", + "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", + "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", + "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", + "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", + "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", + "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", + "Cote d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde", + "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", + "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", + "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", + "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic", + "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", + "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland", + "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia", + "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar", + "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", + "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary", + "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", + "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", + "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", + "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", + "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", + "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", + "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", + "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas", + "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", + "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", + "Reunion", "Romania", "Russia", "Rwanda", "Sqo Tome and Principe", "Saint Helena", + "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon", + "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal", + "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", + "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea", + "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden", + "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas", + "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", + "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Virgin Islands", "Uganda", + "Ukraine", "United Arab Emirates", "United Kingdom", + "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", + "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara", + "Yemen", "Yugoslavia", "Zambia", "Zimbabwe" + }; +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java new file mode 100644 index 0000000..d74b9dd --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java @@ -0,0 +1,37 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.EditText; +import android.widget.ScrollView; +import android.widget.TextView; + +import com.android.imftest.R; + +/* + * Activity with EditText at the bottom (Pan&Scan) + */ +public class BottomEditTextActivityPanScan extends Activity +{ + private LayoutInflater mInflater; + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + mInflater = getLayoutInflater(); + + View view = mInflater.inflate(R.layout.one_edit_text_activity, layout, false); + layout.addView(view); + + setContentView(layout); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + } +}
\ No newline at end of file diff --git a/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java new file mode 100644 index 0000000..82da29a --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java @@ -0,0 +1,37 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.EditText; +import android.widget.ScrollView; +import android.widget.TextView; + +import com.android.imftest.R; + +/* + * Activity with EditText at the bottom (Resize) + */ +public class BottomEditTextActivityResize extends Activity +{ + private LayoutInflater mInflater; + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + mInflater = getLayoutInflater(); + + View view = mInflater.inflate(R.layout.one_edit_text_activity, layout, false); + layout.addView(view); + + setContentView(layout); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + } +}
\ No newline at end of file diff --git a/tests/ImfTest/src/com/android/imftest/samples/DialogActivity.java b/tests/ImfTest/src/com/android/imftest/samples/DialogActivity.java new file mode 100644 index 0000000..e49301c --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/DialogActivity.java @@ -0,0 +1,102 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.EditText; +import android.widget.Button; +import android.view.LayoutInflater; +import android.app.Dialog; + +import com.android.internal.R; + +public class DialogActivity extends Activity { + + private static final int DIALOG_WITHOUT_EDITTEXT = 0; + private static final int DIALOG_WITH_EDITTEXT = 1; + + private LinearLayout mLayout; + private LayoutInflater mInflater; + private Button mButton1; + private Button mButton2; + private EditText mEditText; + + + @Override + protected void onCreate(Bundle icicle) + { + super.onCreate(icicle); + + mLayout = new LinearLayout(this); + mLayout.setOrientation(LinearLayout.VERTICAL); + mLayout.setLayoutParams(new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.FILL_PARENT, + ViewGroup.LayoutParams.FILL_PARENT)); + + mButton1 = new Button(this); + mButton1.setText("Dialog WITHOUT EditText");//(R.string.open_dialog_scrollable); + mButton1.setOnClickListener(new View.OnClickListener() + { + public void onClick(View v) + { + showDialog(DIALOG_WITHOUT_EDITTEXT); + } + }); + + mButton2 = new Button(this); + mButton2.setText("Dialog WITH EditText");//(R.string.open_dialog_nonscrollable); + mButton2.setOnClickListener(new View.OnClickListener() + { + public void onClick(View v) + { + showDialog(DIALOG_WITH_EDITTEXT); + } + }); + + mEditText = new EditText(this); + mLayout.addView(mEditText); + mLayout.addView(mButton1); + mLayout.addView(mButton2); + + setContentView(mLayout); + } + + @Override + protected Dialog onCreateDialog(int id) + { + switch (id) + { + case DIALOG_WITHOUT_EDITTEXT: + return createDialog(false); + case DIALOG_WITH_EDITTEXT: + return createDialog(true); + } + + return super.onCreateDialog(id); + } + + protected Dialog createDialog(boolean bEditText) + { + LinearLayout layout; + layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + if(bEditText) + { + EditText editText; + editText = new EditText(this); + layout.addView(editText); + } + + Dialog d = new Dialog(this); + d.setTitle("The DIALOG!!!"); + d.setCancelable(true); + d.setContentView(layout); + return d; + } + + } diff --git a/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java new file mode 100644 index 0000000..b596023 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/EditTextActivityNoScrollPanScan.java @@ -0,0 +1,38 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; + +import com.android.internal.R; + +public class EditTextActivityNoScrollPanScan extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + String string = new String(); + for (int i=0; i<9; i++) + { + final EditText editText = new EditText(this); + editText.setText(string.valueOf(i)); + layout.addView(editText); + } + setContentView(layout); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + } +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java b/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java index f7aaa7b..6c71e86 100755 --- a/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java +++ b/tests/ImfTest/src/com/android/imftest/samples/InputTypeActivity.java @@ -56,43 +56,67 @@ public class InputTypeActivity extends Activity { mParent = mLayout; /* Normal Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_NORMAL, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL, R.string.normal_edit_text_label)); + /* Normal Edit Text w/Cap Chars Flag*/ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS, + R.string.cap_chars_edit_text_label)); + + /* Normal Edit Text w/Cap Words Flag*/ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS, + R.string.cap_words_edit_text_label)); + + /* Normal Edit Text w/Cap Multiline Flag */ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE, + R.string.multiline_edit_text_label)); + + /* Normal Edit Text w/Cap Sentences Flag */ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES, + R.string.cap_sentences_edit_text_label)); + + /* Normal Edit Text w/Auto-complete Flag */ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE, + R.string.auto_complete_edit_text_label)); + + /* Normal Edit Text w/Auto-correct Flag */ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT, + R.string.auto_correct_edit_text_label)); + + /* Normal Edit Text w/Search Flag*/ + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_NORMAL|EditorInfo.TYPE_TEXT_FLAG_SEARCH, + R.string.search_edit_text_label)); + /* Uri Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_URI, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_URI, R.string.uri_edit_text_label)); /* Email Address Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS, R.string.email_address_edit_text_label)); /* Email Subject Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_EMAIL_SUBJECT, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_EMAIL_SUBJECT, R.string.email_subject_edit_text_label)); /* Email Content Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_EMAIL_CONTENT, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_LONG_MESSAGE, R.string.email_content_edit_text_label)); /* Person Name Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_PERSON_NAME, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_PERSON_NAME, R.string.person_name_edit_text_label)); /* Postal Address Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_POSTAL_ADDRESS, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_POSTAL_ADDRESS, R.string.postal_address_edit_text_label)); /* Password Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_PASSWORD, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_PASSWORD, R.string.password_edit_text_label)); - /* Search String Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_SEARCH_STRING, - R.string.search_string_edit_text_label)); - /* Web Edit Text */ - mLayout.addView(buildEntryView(EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT, + mLayout.addView(buildEntryView(EditorInfo.TYPE_CLASS_TEXT|EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT, R.string.web_edit_text_label)); /* Signed Number Edit Text */ diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java new file mode 100644 index 0000000..4cb3af6 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java @@ -0,0 +1,41 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; + +import com.android.internal.R; + +/* + * Full screen of EditTexts (Non-Scrollable, Pan&Scan) + */ +public class ManyEditTextActivityNoScrollPanScan extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + String string = new String(); + for (int i=0; i<9; i++) + { + final EditText editText = new EditText(this); + editText.setText(string.valueOf(i)); + layout.addView(editText); + } + setContentView(layout); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + } +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java new file mode 100644 index 0000000..bd32828 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java @@ -0,0 +1,45 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; + +import com.android.internal.R; + +/* + * Full screen of EditTexts (Scrollable, Pan&Scan) + */ +public class ManyEditTextActivityScrollPanScan extends Activity +{ + private ScrollView mScrollView; + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + mScrollView = new ScrollView(this); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + String string = new String(); + for (int i=0; i<12; i++) + { + final EditText editText = new EditText(this); + editText.setText(string.valueOf(i)); + layout.addView(editText); + } + + mScrollView.addView(layout); + setContentView(mScrollView); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); + } +}
\ No newline at end of file diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java new file mode 100644 index 0000000..eaaa98b --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java @@ -0,0 +1,37 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.widget.EditText; +import android.widget.ScrollView; + +/* + * Full screen of EditTexts (Scrollable, Resize) + */ +public class ManyEditTextActivityScrollResize extends Activity +{ + private ScrollView mScrollView; + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + mScrollView = new ScrollView(this); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + String string = new String(); + for (int i=0; i<12; i++) + { + final EditText editText = new EditText(this); + editText.setText(string.valueOf(i)); + layout.addView(editText); + } + + mScrollView.addView(layout); + setContentView(mScrollView); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); + } +}
\ No newline at end of file diff --git a/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java new file mode 100644 index 0000000..5fef884 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java @@ -0,0 +1,40 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; + +import com.android.internal.R; + +/* + * Activity with non-EditText view selected initially + */ +public class OneEditTextActivityNotSelected extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + final EditText editText = new EditText(this); + final TextView textView = new TextView(this); + textView.setText("The focus is here."); + layout.addView(editText); + layout.addView(textView); + + setContentView(layout); + textView.requestFocus(); + } +} diff --git a/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java new file mode 100644 index 0000000..2fd19e8 --- /dev/null +++ b/tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java @@ -0,0 +1,37 @@ +package com.android.imftest.samples; + +import android.app.Activity; +import android.os.Bundle; +import android.view.KeyEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.LinearLayout; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.Button; +import android.widget.TextView; +import android.widget.ScrollView; + +import com.android.internal.R; + +/* + * Activity with EditText selected initially + */ +public class OneEditTextActivitySelected extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + LinearLayout layout = new LinearLayout(this); + layout.setOrientation(LinearLayout.VERTICAL); + + final EditText editText = new EditText(this); + layout.addView(editText); + + setContentView(layout); + editText.requestFocus(); + } +} |