Comments (10)
是的。这块适配是根据键盘的高度适配的。
from jkeyboardpanelswitch.
那么就是无解了?还想着可以根据面板的高度来适应呢
from jkeyboardpanelswitch.
我不是很理解,你的意思是,你不想要面板适配键盘的高度吗?如果是这样,你把主动调整面板高度部分代码注释掉就行了。
from jkeyboardpanelswitch.
对啊,因为我觉得面板的高度应该根据它的内容来决定,不然当内容很少的时候,但面板的高度还是跟键盘一样高就会显得空白的地方很多
from jkeyboardpanelswitch.
好的,如果你们业务如此,可以先将你使用的面板,你看下里面有一个 refreshHeight
方法(如 KPSwitchPanelFrameLayout#refreshHeight(int):void
),你把里面的ViewUtil.refreshHeight(this, panelHeight);
注释掉应该就可以了。 我会考虑提供这个配置项的。
from jkeyboardpanelswitch.
get,谢谢你的解答
from jkeyboardpanelswitch.
:)
from jkeyboardpanelswitch.
已在 v1.4.6 带上。
from jkeyboardpanelswitch.
thx,已使用,另外我想问一下的是解决冲突的关键代码主要是KeyboardUtil.attach()这一块吧,有没有可能把它放到KPSwitchConflictUtil.attach()这里去解决,毕竟KeyboardUtil.attach()添加到了代码中,却没有进行什么操作,容易让人引起困惑,还不如在KPSwitchConflictUtil.attach()中进行判断它是已经有在代码中添加,有的话就不再设置了,这样的话,当用户有需要监听键盘是否显示的时候才重写KeyboardUtil.attach()方法,这只是我个人的一些想法,再次感谢你...
from jkeyboardpanelswitch.
@zhangjinhuang :) 主要原因是 KeyboardUtil.attach()
这个是必须要的,而KpSwitchConflictUtil.attach()
这个是不必要的,用户可以根据自己的需求分开调用 KpswitchConflictUtil
里面的方法而不需要调用 attach()
,留意下两个方法的注解:
/**
* Attach the action of {@code switchPanelKeyboardBtn} and the {@code focusView} to
* non-layout-conflict.
* <p/>
* You do not have to use this method to attach non-layout-conflict, in other words, you can
* attach the action by yourself with invoke methods manually: {@link #showPanel(View)}、
* {@link #showKeyboard(View, View)}、{@link #hidePanelAndKeyboard(View)}, and in the case of don't
* invoke this method to attach, and if your activity with the fullscreen-theme, please ensure your
* panel layout is {@link View#INVISIBLE} before the keyboard is going to show.
*
* @param panelLayout the layout of panel.
* @param switchPanelKeyboardBtn the view will be used to trigger switching between the panel and
* the keyboard.
* @param focusView the view will be focused or lose the focus.
* @param switchClickListener the click listener is used to listening the click event for
* {@code switchPanelKeyboardBtn}.
*/
public static void attach(final View panelLayout,
/** Nullable **/final View switchPanelKeyboardBtn,
/** Nullable **/final View focusView,
/** Nullable **/final SwitchClickListener switchClickListener)
/**
* Recommend invoked by {@link Activity#onCreate(Bundle)}
* For align the height of the keyboard to {@code target} as much as possible.
* For save the refresh the keyboard height to shared-preferences.
*
* @param activity contain the view
* @param target whose height will be align to the keyboard height.
* @param listener the listener to listen in: keyboard is showing or not.
* @see #saveKeyboardHeight(Context, int)
*/
public static void attach(final Activity activity, IPanelHeightTarget target,
/** Nullable **/OnKeyboardShowingListener listener)
from jkeyboardpanelswitch.
Related Issues (20)
- 4.4中和三方库冲突 HOT 1
- 透明状态栏下,setSystemUiVisibility之后键盘状态监听有问题 HOT 6
- 能否在API上兼容下Dialog HOT 3
- Android9.0 刘海屏 键盘和panel切换时会闪烁 HOT 5
- 遇到一个空指针问题:findViewById(int)' on a null object reference
- 9.0刘海屏上点击输入框,列表中的内容不能被顶上去,但是其他版本系统可以
- 文档没有使用方法,需要自己看代码去尝试,不是很好,建议加上使用方法。 HOT 3
- 点击任何地方键盘都会收起
- 为什么,点击出入法的时候,我的就会把底部聊天布局遮住了,你的也没处理怎么就好了 HOT 1
- ViewPager 嵌套 Fragment , Fragment 中 KPSwitchPanelLinearLayout 不显示
- 支持全屏适配吗? HOT 1
- 老铁们,有没有好的替代品呢 HOT 3
- 看了下很多issues,尝试这个吧。 HOT 3
- Uh
- 这么多年,android R终于有键盘事件了。这个改一改 HOT 1
- 给一下一个地方的修改建议 HOT 1
- 这库还会更新维护了吗
- 面板显示异常问题, HOT 1
- 面板高度问题
- Android9.0 刘海屏机型 无法触发onKeyboardShowing回调 HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jkeyboardpanelswitch.