Skip to content

android监听软键盘打开关闭并实时获取高度,任意view跟随软键盘进行平移

License

Notifications You must be signed in to change notification settings

rockscy/uicontroll

Repository files navigation

uicontroll

android keybaord软键盘解决方案,监听软键盘打开关闭并实时获取高度,任意view跟随软键盘进行平移

效果

使用

android studio

allprojects {
 repositories {
     maven { url "https://dl.bintray.com/rockscy94/maven/" }
 }
}

implementation 'com.rock.uicontroll:uicontroll:1.0.1'

Api详解

  • 注册(appliation中调用onCreate中调用)

    SystemUiControll.getInstence().register(this);
  • 设置任意view跟随软键盘进行平移(可传入多个view)

     SystemUiControll.getInstence().setAutoMoveView(view);
  • 打开关闭软键盘

  •  SystemUiControll.getInstence().showOrHideKeyBoard(editText);
  • 自行监听软键盘高度变化

  •   SystemUiControll.getInstence().setKeyBoardListener(new KeyboardListener() {
            @Override
            public void onKeyBoardAnimStart() {
                Log.i(TAG, "key baord anim start");
            }
    
            @Override
            public void onKeyBoardHeightChange(int height) {
                Log.i(TAG, "key baord height: " + height);
            }
    
            @Override
            public void onKeyBoardAnimEnd() {
                Log.i(TAG, "key baord anim end");
            }
        });

联系我

  • QQ 617913246(问题交流)

About

android监听软键盘打开关闭并实时获取高度,任意view跟随软键盘进行平移

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages