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.Core | |
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.Core')
-rw-r--r-- | Xamarin.Forms.Core/PlatformConfiguration/AndroidSpecific/AppCompat/Application.cs | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/AndroidSpecific/AppCompat/Application.cs b/Xamarin.Forms.Core/PlatformConfiguration/AndroidSpecific/AppCompat/Application.cs index 8451b957..887fe464 100644 --- a/Xamarin.Forms.Core/PlatformConfiguration/AndroidSpecific/AppCompat/Application.cs +++ b/Xamarin.Forms.Core/PlatformConfiguration/AndroidSpecific/AppCompat/Application.cs @@ -4,9 +4,7 @@ public static class Application { - public static readonly BindableProperty SendDisappearingEventOnPauseProperty = - BindableProperty.Create("SendDisappearingEventOnPause", typeof(bool), - typeof(Application), true); + public static readonly BindableProperty SendDisappearingEventOnPauseProperty = BindableProperty.Create(nameof(SendDisappearingEventOnPause), typeof(bool), typeof(Application), true); public static bool GetSendDisappearingEventOnPause(BindableObject element) { @@ -29,9 +27,7 @@ return config; } - public static readonly BindableProperty SendAppearingEventOnResumeProperty = - BindableProperty.Create("SendAppearingEventOnResume", typeof(bool), - typeof(Application), true); + public static readonly BindableProperty SendAppearingEventOnResumeProperty = BindableProperty.Create(nameof(SendAppearingEventOnResume), typeof(bool), typeof(Application), true); public static bool GetSendAppearingEventOnResume(BindableObject element) { @@ -53,5 +49,28 @@ SetSendAppearingEventOnResume(config.Element, value); return config; } + + public static readonly BindableProperty ShouldPreserveKeyboardOnResumeProperty = BindableProperty.Create(nameof(ShouldPreserveKeyboardOnResume), typeof(bool), typeof(Application), false); + + public static bool GetShouldPreserveKeyboardOnResume(BindableObject element) + { + return (bool)element.GetValue(ShouldPreserveKeyboardOnResumeProperty); + } + + public static void SetShouldPreserveKeyboardOnResume(BindableObject element, bool value) + { + element.SetValue(ShouldPreserveKeyboardOnResumeProperty, value); + } + + public static bool GetShouldPreserveKeyboardOnResume(this IPlatformElementConfiguration<Android, FormsElement> config) + { + return GetShouldPreserveKeyboardOnResume(config.Element); + } + + public static IPlatformElementConfiguration<Android, FormsElement> ShouldPreserveKeyboardOnResume(this IPlatformElementConfiguration<Android, FormsElement> config, bool value) + { + SetShouldPreserveKeyboardOnResume(config.Element, value); + return config; + } } } |