diff options
Diffstat (limited to 'tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java')
-rw-r--r-- | tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java index 4cb3af6..54ab57a 100644 --- a/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java +++ b/tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java @@ -20,22 +20,31 @@ import com.android.internal.R; */ 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); + public static final int NUM_EDIT_TEXTS = 9; + + private View mRootView; + + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + + mRootView = new LinearLayout(this); + ((LinearLayout) mRootView).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); + ((LinearLayout) mRootView).addView(editText); + } + setContentView(mRootView); + this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); } + + public View getRootView() { + return mRootView; + } + } |