Kenny Root | 15a4d2f | 2010-03-11 18:20:12 -0800 | [diff] [blame] | 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 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 17 | package com.android.imftest.samples; |
| 18 | |
| 19 | import com.android.imftest.R; |
| 20 | |
| 21 | import android.app.Activity; |
| 22 | import android.os.Bundle; |
| 23 | import android.view.View; |
| 24 | import android.view.ViewGroup; |
| 25 | import android.view.WindowManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.widget.LinearLayout; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 27 | |
| 28 | public class BigEditTextActivityNonScrollableResize extends Activity { |
| 29 | |
| 30 | private View mRootView; |
| 31 | private View mDefaultFocusedView; |
| 32 | |
| 33 | @Override |
| 34 | protected void onCreate(Bundle icicle) { |
| 35 | super.onCreate(icicle); |
| 36 | |
| 37 | getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); |
| 38 | |
| 39 | mRootView = new LinearLayout(this); |
| 40 | ((LinearLayout) mRootView).setOrientation(LinearLayout.VERTICAL); |
| 41 | mRootView.setLayoutParams(new ViewGroup.LayoutParams( |
Romain Guy | 980a938 | 2010-01-08 15:06:28 -0800 | [diff] [blame] | 42 | ViewGroup.LayoutParams.MATCH_PARENT, |
| 43 | ViewGroup.LayoutParams.MATCH_PARENT)); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | |
| 45 | View view = getLayoutInflater().inflate( |
| 46 | R.layout.full_screen_edit_text, ((LinearLayout) mRootView), false); |
| 47 | |
| 48 | ((LinearLayout) mRootView).addView(view); |
| 49 | |
| 50 | mDefaultFocusedView = view.findViewById(R.id.data); |
| 51 | |
| 52 | setContentView(mRootView); |
| 53 | } |
| 54 | |
| 55 | public View getRootView() { |
| 56 | return mRootView; |
| 57 | } |
| 58 | |
| 59 | public View getDefaultFocusedView() { |
| 60 | return mDefaultFocusedView; |
| 61 | } |
| 62 | |
| 63 | } |