{"id":13710432,"url":"https://github.com/masonyc/Xamarin.KeyboardHelper","last_synced_at":"2025-05-06T19:31:02.130Z","repository":{"id":38455163,"uuid":"159392439","full_name":"masonyc/Xamarin.KeyboardHelper","owner":"masonyc","description":"Xamarin.Forms keyboard helper","archived":false,"fork":false,"pushed_at":"2022-07-01T03:51:56.000Z","size":33165,"stargazers_count":99,"open_issues_count":8,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-18T09:55:21.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masonyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-27T20:05:38.000Z","updated_at":"2023-08-22T14:24:48.000Z","dependencies_parsed_at":"2022-08-19T22:20:28.368Z","dependency_job_id":null,"html_url":"https://github.com/masonyc/Xamarin.KeyboardHelper","commit_stats":null,"previous_names":["masonyc/xamarin.enablekeyboardeffect"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masonyc%2FXamarin.KeyboardHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masonyc%2FXamarin.KeyboardHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masonyc%2FXamarin.KeyboardHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masonyc%2FXamarin.KeyboardHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masonyc","download_url":"https://codeload.github.com/masonyc/Xamarin.KeyboardHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252753231,"owners_count":21798937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T23:00:56.091Z","updated_at":"2025-05-06T19:30:57.120Z","avatar_url":"https://github.com/masonyc.png","language":"C#","readme":"# No longer maintained, feel free to fork it.\n\u003cimg src=\"Screenshots/icon.png\" width=\"64px\" \u003e\n\n# Xamarin.KeyboardHelper\n\nThis plugin includes:\n- KeyboardEnableEffect -- allows user to show/hide softkeyboard on Android/iOS platform in Xamarin.Forms\n- SoftKeyboardService -- check softkeyboard display status\n\n# Building Status\n\n\n![CI](https://github.com/masonyc/Xamarin.KeyboardHelper/workflows/CI/badge.svg?branch=master)\n\n# Setup\n\n- Need Xamarin.Forms version 3 or above\n- `Xamarin.KeyboardHelper` Available on NuGet: https://www.nuget.org/packages/Xamarin.KeyboardHelper\n- Install into your platform-specific projects (iOS/Android), and any .NET Standard 2.1 projects required for your app.\n- Add ```\n        xmlns:effects=\"clr-namespace:Xamarin.KeyboardHelper;assembly=Xamarin.KeyboardHelper\"  ```at the top of the xaml file \n  \n## Platform Support\n\n|Platform|Supported|Version|Notes|\n| ------------------- | :-----------: | :------------------: | :------------------: |\n|Xamarin.iOS|Yes|iOS 10+| |\n|Xamarin.Android|Yes|API 19+|Project should [target Android framework 9.0+](https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/android-api-levels?tabs=vswin#framework)|    \n\n# KeyboardEnableEffect\n\n## For Android\n\n```csharp\n        protected override void OnCreate(Bundle savedInstanceState)\n        {\n            base.OnCreate(savedInstanceState);\n            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);\n            \n            //need this line to init effect in android\n            Xamarin.KeyboardHelper.Platform.Droid.Effects.Init(this);\n            \n            LoadApplication(new App());\n        }\n```\n\n## For iOS\n\n```csharp\n        public override bool FinishedLaunching(UIApplication app, NSDictionary options)\n        {\n            global::Xamarin.Forms.Forms.Init();\n            \n            //need this line to init effect in iOS\n            Xamarin.KeyboardHelper.Platform.iOS.Effects.Init();\n            \n            LoadApplication(new App());\n            return base.FinishedLaunching(app, options);\n        }\n```\n\n## Usage\n\n### Show soft keyboard\n\n```csharp\n        \u003cEntry Text=\"Show Keyboard\" effects:KeyboardEffect.EnableKeyboard=\"True\"\u003e\n            \u003cEntry.Effects\u003e\n                \u003ceffects:KeyboardEnableEffect/\u003e\n            \u003c/Entry.Effects\u003e\n        \u003c/Entry\u003e\n```\n\n### Hide soft keyboard\n\n```csharp\n        \u003cEntry Text=\"Hide Keyboard\" effects:KeyboardEffect.EnableKeyboard=\"False\"\u003e\n            \u003cEntry.Effects\u003e\n                \u003ceffects:KeyboardEnableEffect/\u003e\n            \u003c/Entry.Effects\u003e\n        \u003c/Entry\u003e\n```\n\n### Bind boolean property to effect\n\n```csharp\n        \u003cEntry Text=\"Toggle Keyboard\" effects:KeyboardEffect.EnableKeyboard=\"{Binding BooleanBinding}\"\u003e\n            \u003cEntry.Effects\u003e\n                \u003ceffects:KeyboardEnableEffect/\u003e\n            \u003c/Entry.Effects\u003e\n        \u003c/Entry\u003e\n```\n\n### Request focus on control\n\nIn the previous version of the plugin, control that uses the effect will automatically get the focus when view get rendered. In version 2.0.5 and above, control will not automatically get focus anymore, instead if you want to get focus, you have to call the RequestFocus = true in your XAML file.\n\n```csharp\n         \u003cEntry effects:KeyboardEffect.EnableKeyboard=\"False\" effects:KeyboardEffect.RequestFocus=\"True\"\u003e\n                \u003cEntry.Effects\u003e\n                    \u003ceffects:KeyboardEnableEffect /\u003e\n                \u003c/Entry.Effects\u003e\n         \u003c/Entry\u003e\n```\n\n- `RequestFocus=\"True\"` will not show the keyboard if `EnableKeyboard=\"False\"`\n- `Entry.Focus()` will shows the keyboard even if `EnableKeyboard=\"False\"`. but it will be hidden immediately after it is shown.\n- if you do not call Entry.Focus() by code, keyboard will not show up.\n\n##### Then what does `RequestFocus=\"True\"` do ?\n\nCalling `Entry.Focus()` in page ViewIsAppearing will not focus on the entry. `RequestFocus=\"True\"` will do that for you.\n\n# SoftKeyboardService\n\n## Under Page.xaml.cs or view model \n```csharp\n        public MainPage()\n        {\n            InitializeComponent();\n\n            this.Appearing += MainPage_Appearing;\n            this.Disappearing += MainPage_Disappearing;\n        }\n\n        private void MainPage_Disappearing(object sender, EventArgs e)\n        {\n            SoftKeyboard.Current.VisibilityChanged -= Current_VisibilityChanged;\n        }\n        \n        private void MainPage_Appearing(object sender, EventArgs e)\n        {\n            SoftKeyboard.Current.VisibilityChanged += Current_VisibilityChanged;\n        }\n\n        private void Current_VisibilityChanged(SoftKeyboardEventArgs e)\n        {\n            if(e.IsVisible){\n                // do your things\n            }\n            else{\n                // do your things\n            }\n        }\n```\n\n# Demo\n\n### Android\n\n\u003cimg src=\"Screenshots/androidDemo.gif\"\u003e\n\n### iOS\n\n\u003cimg src=\"Screenshots/iosDemo.gif\"\u003e\n\n# Limitations\n\n# v3.0\n- requires android X support\n\n# Contributing\n\nContributions are welcome.  Feel free to file issues and pull requests on the repo and they'll be reviewed as time permits.\n\n# License\nUnder MIT, see LICENSE file.\n","funding_links":[],"categories":["Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasonyc%2FXamarin.KeyboardHelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasonyc%2FXamarin.KeyboardHelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasonyc%2FXamarin.KeyboardHelper/lists"}