diff options
author | adrianknight89 <adrianknight89@outlook.com> | 2016-11-15 13:30:23 -0600 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-11-15 11:30:23 -0800 |
commit | 04cc360a39505877717d5309d9649422e602c021 (patch) | |
tree | 8f50b8a458aa424cefe05aa736d52eefec965d44 /Xamarin.Forms.Platform.Android | |
parent | bdd14c5434a6eb1c528bb30f65c708bb349256a2 (diff) | |
download | xamarin-forms-04cc360a39505877717d5309d9649422e602c021.tar.gz xamarin-forms-04cc360a39505877717d5309d9649422e602c021.tar.bz2 xamarin-forms-04cc360a39505877717d5309d9649422e602c021.zip |
[Android] Show keyboard on app resume if control has focus (#480)
* show keyboard on resume if control has focus
* refactor
* changed property name
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r-- | Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs index 07e02977..35ddf2da 100644 --- a/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs +++ b/Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs @@ -15,6 +15,7 @@ using Android.Views; using Android.Widget; using Xamarin.Forms.Platform.Android.AppCompat; using Xamarin.Forms.PlatformConfiguration.AndroidSpecific; +using Xamarin.Forms.PlatformConfiguration.AndroidSpecific.AppCompat; using AToolbar = Android.Support.V7.Widget.Toolbar; using AColor = Android.Graphics.Color; using AlertDialog = Android.Support.V7.App.AlertDialog; @@ -232,6 +233,14 @@ namespace Xamarin.Forms.Platform.Android // counterpart to OnPause base.OnResume(); + if (_application.OnThisPlatform().GetShouldPreserveKeyboardOnResume()) + { + if (CurrentFocus != null && (CurrentFocus is EditText || CurrentFocus is TextView || CurrentFocus is SearchView)) + { + CurrentFocus.ShowKeyboard(); + } + } + _previousState = _currentState; _currentState = AndroidApplicationLifecycleState.OnResume; |