Giter VIP home page Giter VIP logo

preventkeyboardblockutil's Introduction

PreventKeyboardBlockUtil

image

image

目的

当前官方提供的三个软键盘方案,一个会顶起输入框并将布局往上推(SOFT_INPUT_ADJUST_PAN),一个会顶起输入框并挤压布局(SOFT_INPUT_ADJUST_RESIZE),一个直接弹出键盘其他不做任何处理(SOFT_INPUT_ADJUST_NOTHING),而前两个方案最多只能将获得焦点的输入框顶起。本库目的解决此问题,配置简单,欢迎使用。

使用方式

1.在project的build.gradle里配置

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

2.在app的build.gradle里配置

dependencies {
           implementation 'com.github.yoyoyaobin:PreventKeyboardBlockUtil:1.0.8'
   }

3.在你的activity用上

@Override
    protected void onResume() {
        super.onResume();
        PreventKeyboardBlockUtil.getInstance(this).setBtnView(btnView).register();
    }

    @Override
    protected void onPause() {
        super.onPause();
        PreventKeyboardBlockUtil.getInstance(this).unRegister();
    }

其中,setBtnView传入的view是你想要在键盘弹出时置于键盘上的最后一个控件,比如触发登录的按钮。

LICENSE

详见LICENSE

preventkeyboardblockutil's People

Contributors

yoyoyaobin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.