• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.imftest.samples;
18 
19 import android.app.Activity;
20 import android.os.Bundle;
21 import android.view.KeyEvent;
22 import android.view.View;
23 import android.view.ViewGroup;
24 import android.view.WindowManager;
25 import android.widget.LinearLayout;
26 import android.view.inputmethod.InputMethodManager;
27 import android.widget.EditText;
28 import android.widget.Button;
29 import android.widget.TextView;
30 import android.widget.ScrollView;
31 
32 import com.android.internal.R;
33 
34 /*
35  * Full screen of EditTexts (Non-Scrollable, Pan&Scan)
36  */
37 public class ManyEditTextActivityNoScrollPanScan extends Activity
38 {
39     public static final int NUM_EDIT_TEXTS = 9;
40 
41     private View mRootView;
42 
43     @Override
onCreate(Bundle savedInstanceState)44     public void onCreate(Bundle savedInstanceState)
45     {
46         super.onCreate(savedInstanceState);
47 
48         mRootView = new LinearLayout(this);
49         ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
50 
51         for (int i=0; i<NUM_EDIT_TEXTS; i++)
52         {
53             final EditText editText = new EditText(this);
54             editText.setText(String.valueOf(i));
55             editText.setId(i);
56             ((LinearLayout) mRootView).addView(editText);
57         }
58         setContentView(mRootView);
59         this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
60     }
61 
getRootView()62     public View getRootView() {
63         return mRootView;
64     }
65 
66 }
67