MCPcopy Index your code
hub / github.com/Jacksgong/JKeyboardPanelSwitch

github.com/Jacksgong/JKeyboardPanelSwitch @v1.6.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.2 ↗ · + Follow
198 symbols 523 edges 26 files 55 documented · 28% updated 5y agov1.6.2 · 2018-10-09★ 4,17361 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Android键盘面板冲突 布局闪动处理方案

Download Build Status

README DOC


起源,之前在微信工作的时候,为了给用户带来更好的基础体验,做了很多尝试,踩了很多输入法的坑,特别是动态调整键盘高度,二级页面是透明背景,魅族早期的Smart bar等, 后来逐一完善了,考虑到拥抱开源,看业界还是有很多应用存在类似问题。就有了这个repo


之前有写过一篇核心思想: Switching between the panel and the keyboard in Wechat


欢迎提交 Pull requests


如何使用

build.gradle中引入:

compile 'cn.dreamtobe.kpswitch:library:1.6.1'

如果你希望引入SNAPSHOT版本,我们也有将SNAPSHOT版本推送到SONATYPE的仓库,因此你可以通过申明下面参库以引入SNAPSHOT版本:

allprojects {
  repositories {
      maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
  }
}

使用引导

可以考虑clone下来跑下项目中的demo,已经用尽量简洁的代码尽量覆盖所有Case了。

基本原理

License

Copyright 2015 Jacks gong.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Extension points exported contracts — how you extend this code

IPanelConflictLayout (Interface)
Created by Jacksgong on 3/30/16. The interface used for the panel's container layout and it used in the case of non- [8 …
library/src/main/java/cn/dreamtobe/kpswitch/IPanelConflictLayout.java
IPanelHeightTarget (Interface)
Created by Jacksgong on 3/26/16. For align the height of the keyboard to panel height as much as possible. @see cn [6 …
library/src/main/java/cn/dreamtobe/kpswitch/IPanelHeightTarget.java
IFSPanelConflictLayout (Interface)
Created by Jacksgong on 3/31/16. The interface used for the panel's container layout and it used in the case of full [8 …
library/src/main/java/cn/dreamtobe/kpswitch/IFSPanelConflictLayout.java
OnKeyboardShowingListener (Interface)
The interface is used to listen the keyboard showing state. @see #attach(Activity, IPanelHeightTarget, OnKeyboardShowin [9 …
library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java
SwitchClickListener (Interface)
This listener is used to listening the click event for a view which is received the click event to switch between Panel [3 …
library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java

Core symbols most depended-on inside this repo

getContext
called by 20
library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java
setVisibility
called by 16
library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchPanelFrameLayout.java
getHeight
called by 8
library/src/main/java/cn/dreamtobe/kpswitch/IPanelHeightTarget.java
hidePanelAndKeyboard
called by 6
library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java
setIgnoreRecommendHeight
called by 5
library/src/main/java/cn/dreamtobe/kpswitch/IPanelConflictLayout.java
onKeyboardShowing
called by 5
library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java
isHandleByPlaceholder
called by 5
library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java
isKeyboardShowing
called by 4
library/src/main/java/cn/dreamtobe/kpswitch/IPanelConflictLayout.java

Shape

Method 168
Class 25
Interface 5

Languages

Java100%

Modules by API surface

library/src/main/java/cn/dreamtobe/kpswitch/util/KeyboardUtil.java19 symbols
library/src/main/java/cn/dreamtobe/kpswitch/util/KPSwitchConflictUtil.java15 symbols
library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchPanelRelativeLayout.java12 symbols
library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchPanelLinearLayout.java12 symbols
library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchPanelFrameLayout.java12 symbols
app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingResolvedActivity.java12 symbols
library/src/main/java/cn/dreamtobe/kpswitch/handler/KPSwitchPanelLayoutHandler.java11 symbols
app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingResolvedFragmentActivity.java11 symbols
app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/MainActivity.java10 symbols
app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingUnresolvedActivity.java10 symbols
app/src/main/java/cn/dreamtobe/kpswitch/demo/activity/ChattingResolvedHandleByPlaceholderActivity.java9 symbols
library/src/main/java/cn/dreamtobe/kpswitch/widget/KPSwitchFSPanelRelativeLayout.java6 symbols

For agents

$ claude mcp add JKeyboardPanelSwitch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page