Skip to content
仿iOS输入法点击输入框以外区域 自动隐藏软键盘轻量级库 , Imitation iOS automatic hidden soft keyboard
Branch: master
Clone or download
Latest commit 74bda66 Aug 28, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo gradle version Aug 28, 2018
gradle/wrapper gradle version Aug 28, 2018
hidekeyboard update version Aug 28, 2018
show update demo Jun 22, 2017
.gitignore ignore Nov 2, 2016
LICENSE license Sep 27, 2016
READEME_CN.md update version Aug 28, 2018
README.md update version Aug 28, 2018
build.gradle gradle version Aug 28, 2018
gradle.properties Initial commit Sep 27, 2016
gradlew Initial commit Sep 27, 2016
gradlew.bat Initial commit Sep 27, 2016
settings.gradle Initial commit Sep 27, 2016

README.md

Hidekeyboard

Abstract

Modelled on the iOS implementation click on the input box area, soft keyboard hide, a super easy to use library of lightweight.

Chinese Documents

点击查看中文文档

Gif

1

Demo

Download Demo

Usage

Step 1

Gradle

dependencies {
    compile 'com.yinglan.keyboard:hidekeyboard:1.2.0'
}

Step 2

In Java Code

The main method
		HideUtil.init(context);

OR

		HideUtil.init(context,viewgroup);

OR

  //Forced hidden keyboard
		HideUtil.hideSoftKeyboard(activity);

OR

  //Forced hidden keyboard
		HideUtil.hideSoftKeyboard(view);

OR

  //Forced hidden keyboard
		HideUtil.hideDialogSoftKeyboard(dialog);
USE
{
	 @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
         HideUtil.init(this);
     }
}

OR

{
	 @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
         ViewGroup viewGroup = (ViewGroup) findViewById(R.id.activity_main);
         HideUtil.init(this,viewGroup);
     }
}

OR

view.findViewById(R.id.view).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HideUtil.hideSoftKeyboard(getActivity());
            }
        });

FAQ

	The library implementation uses the top layer layout android.R.id.content the OnTouchListener listener, rewrite the monitor to be noted.

License

The work done has been licensed under Apache License 2.0. The license file can be found here. You can find out more about the license at:

http://www.apache.org/licenses/LICENSE-2.0

You can’t perform that action at this time.