Home | History | Annotate | Download | only in samples
      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.LayoutInflater;
     22 import android.view.View;
     23 import android.view.WindowManager;
     24 import android.widget.LinearLayout;
     25 import android.widget.EditText;
     26 import android.widget.ScrollView;
     27 import android.widget.TextView;
     28 
     29 import com.android.imftest.R;
     30 
     31 /*
     32  * Activity with EditText at the bottom (Pan&Scan)
     33  */
     34 public class BottomEditTextActivityPanScan extends Activity
     35 {
     36     private View mRootView;
     37     private View mDefaultFocusedView;
     38 
     39     @Override
     40     public void onCreate(Bundle savedInstanceState)
     41     {
     42         super.onCreate(savedInstanceState);
     43 
     44         mRootView = new LinearLayout(this);
     45         ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL);
     46 
     47         View view = getLayoutInflater().inflate(R.layout.one_edit_text_activity, ((LinearLayout) mRootView), false);
     48         mDefaultFocusedView = view.findViewById(R.id.dialog_edit_text);
     49         ((LinearLayout) mRootView).addView(view);
     50 
     51         setContentView(mRootView);
     52         this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
     53     }
     54 
     55     public View getRootView() {
     56         return mRootView;
     57     }
     58 
     59     public View getDefaultFocusedView() {
     60         return mDefaultFocusedView;
     61     }
     62 }
     63