1 package com.android.imftest.samples; 2 3 import com.android.imftest.R; 4 5 import android.app.Activity; 6 import android.os.Bundle; 7 import android.view.View; 8 import android.view.ViewGroup; 9 import android.view.WindowManager; 10 import android.widget.EditText; 11 import android.widget.LinearLayout; 12 import android.widget.ScrollView; 13 14 public class BigEditTextActivityScrollablePanScan extends Activity { 15 16 private View mRootView; 17 private View mDefaultFocusedView; 18 private LinearLayout mLayout; 19 20 @Override onCreate(Bundle icicle)21 protected void onCreate(Bundle icicle) { 22 super.onCreate(icicle); 23 24 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); 25 26 mRootView = new ScrollView(this); 27 ((ScrollView) mRootView).setFillViewport(true); 28 mRootView.setLayoutParams(new ViewGroup.LayoutParams( 29 ViewGroup.LayoutParams.FILL_PARENT, 30 ViewGroup.LayoutParams.FILL_PARENT)); 31 32 mLayout = new LinearLayout(this); 33 mLayout.setOrientation(LinearLayout.VERTICAL); 34 mLayout.setLayoutParams(new ViewGroup.LayoutParams( 35 ViewGroup.LayoutParams.FILL_PARENT, 36 ViewGroup.LayoutParams.FILL_PARENT)); 37 38 View view = getLayoutInflater().inflate( 39 R.layout.full_screen_edit_text, ((ScrollView) mRootView), false); 40 41 mLayout.addView(view); 42 43 ((ScrollView) mRootView).addView(mLayout); 44 mDefaultFocusedView = view.findViewById(R.id.data); 45 46 setContentView(mRootView); 47 } 48 getRootView()49 public View getRootView() { 50 return mRootView; 51 } 52 getDefaultFocusedView()53 public View getDefaultFocusedView() { 54 return mDefaultFocusedView; 55 } 56 57 } 58