diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:43:58 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-02-10 15:43:58 -0800 |
commit | e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8 (patch) | |
tree | e1440f63420acf2b3808f57738bc600b5d710c1e /samples/SoftKeyboard | |
parent | 5a4d0fa291a7269007701282f32cfda55ce39008 (diff) | |
download | android_development-e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8.tar.gz android_development-e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8.tar.bz2 android_development-e3c5766074e2d6d1dcd60c4dafabce8a0c20d2b8.zip |
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'samples/SoftKeyboard')
3 files changed, 16 insertions, 20 deletions
diff --git a/samples/SoftKeyboard/res/values-land/dimens.xml b/samples/SoftKeyboard/res/values-land/dimens.xml index 1929ae08d..b5f3bc128 100644 --- a/samples/SoftKeyboard/res/values-land/dimens.xml +++ b/samples/SoftKeyboard/res/values-land/dimens.xml @@ -19,5 +19,5 @@ --> <resources> - <dimen name="key_height">46px</dimen> -</resources>
\ No newline at end of file + <dimen name="key_height">46dip</dimen> +</resources> diff --git a/samples/SoftKeyboard/res/values/dimens.xml b/samples/SoftKeyboard/res/values/dimens.xml index cdaf27a2d..caf615cfa 100644 --- a/samples/SoftKeyboard/res/values/dimens.xml +++ b/samples/SoftKeyboard/res/values/dimens.xml @@ -19,7 +19,7 @@ --> <resources> - <dimen name="key_height">50px</dimen> + <dimen name="key_height">50dip</dimen> <dimen name="candidate_font_height">16sp</dimen> <dimen name="candidate_vertical_padding">6sp</dimen> </resources>
\ No newline at end of file diff --git a/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java b/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java index d26b1730d..cc1174aa6 100644 --- a/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java +++ b/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java @@ -27,6 +27,7 @@ import android.view.View; import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; +import android.view.inputmethod.InputMethodManager; import java.util.ArrayList; import java.util.List; @@ -73,11 +74,19 @@ public class SoftKeyboard extends InputMethodService private String mWordSeparators; /** - * Helper function to generate the various keyboard layouts used by the - * input method. Takes care of regenerating the layouts if the width - * of the input method changes. + * Main initialization of the input method component. Be sure to call + * to super class. + */ + @Override public void onCreate() { + super.onCreate(); + mWordSeparators = getResources().getString(R.string.word_separators); + } + + /** + * This is the point where you can do all of your UI initialization. It + * is called after creation and any configuration change. */ - private void makeKeyboards() { + @Override public void onInitializeInterface() { if (mQwertyKeyboard != null) { // Configuration changes can happen after the keyboard gets recreated, // so we need to be able to re-build the keyboards if the available @@ -92,25 +101,12 @@ public class SoftKeyboard extends InputMethodService } /** - * Main initialization of the input method component. Be sure to call - * to super class. - */ - @Override public void onCreate() { - super.onCreate(); - makeKeyboards(); - mWordSeparators = getResources().getString(R.string.word_separators); - } - - /** * Called by the framework when your view for creating input needs to * be generated. This will be called the first time your input method * is displayed, and every time it needs to be re-created such as due to * a configuration change. */ @Override public View onCreateInputView() { - // We call makeKeyboards() here to regenerate them if needed due to - // a configuration change. - makeKeyboards(); mInputView = (KeyboardView) getLayoutInflater().inflate( R.layout.input, null); mInputView.setOnKeyboardActionListener(this); |