summaryrefslogtreecommitdiffstats
path: root/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
commit9066cfe9886ac131c34d59ed0e2d287b0e3c0087 (patch)
treed88beb88001f2482911e3d28e43833b50e4b4e97 /tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
parentd83a98f4ce9cfa908f5c54bbd70f03eec07e7553 (diff)
downloadframeworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.zip
frameworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.tar.gz
frameworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java')
-rw-r--r--tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java52
1 files changed, 52 insertions, 0 deletions
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..b228d34
--- /dev/null
+++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
@@ -0,0 +1,52 @@
+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
+{
+ public static final int NUM_EDIT_TEXTS = 12;
+
+ private View mRootView;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ mRootView = new ScrollView(this);
+
+ LinearLayout layout = new LinearLayout(this);
+ layout.setOrientation(LinearLayout.VERTICAL);
+
+ for (int i=0; i<NUM_EDIT_TEXTS; i++)
+ {
+ final EditText editText = new EditText(this);
+ editText.setText(String.valueOf(i));
+ editText.setId(i);
+ layout.addView(editText);
+ }
+
+ ((ScrollView) mRootView).addView(layout);
+ setContentView(mRootView);
+ this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
+ }
+
+ public View getRootView() {
+ return mRootView;
+ }
+} \ No newline at end of file