From 71c4f663003821b94d48b567dba5317f37b6da9f Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 22 Feb 2016 15:45:22 +0100 Subject: [PATCH] Fix showing keyboard in tablets --- app/src/main/AndroidManifest.xml | 2 +- .../org/solovyev/android/calculator/EditorFragment.java | 6 ++++++ app/src/main/res/layout/cpp_app_editor.xml | 8 +++----- app/src/main/res/values/styles.xml | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3cc19714..0cc1970e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -39,7 +39,7 @@ android:clearTaskOnLaunch="true" android:label="@string/c_app_name" android:launchMode="singleTop" - android:windowSoftInputMode="adjustPan"> + android:windowSoftInputMode="stateHidden|adjustPan"> diff --git a/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java b/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java index ff657841..bae8ba17 100644 --- a/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java @@ -57,6 +57,12 @@ public class EditorFragment extends BaseFragment { return view; } + @Override + public void onResume() { + super.onResume(); + editorView.requestFocus(); + } + @Override public void onDestroyView() { editor.clearView(editorView); diff --git a/app/src/main/res/layout/cpp_app_editor.xml b/app/src/main/res/layout/cpp_app_editor.xml index 2a9413ec..9e8fb289 100644 --- a/app/src/main/res/layout/cpp_app_editor.xml +++ b/app/src/main/res/layout/cpp_app_editor.xml @@ -21,11 +21,9 @@ ~ Email: se.solovyev@gmail.com ~ Site: http://se.solovyev.org --> - \ No newline at end of file + a:padding="@dimen/cpp_editor_padding" /> \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 392952ac..14cbeee7 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -67,6 +67,7 @@ @dimen/cpp_min_editor_text_size ?attr/cpp_text_color textMultiLine|textNoSuggestions + vertical