Giter Club home page Giter Club logo

Comments (10)

Jacksgong avatar Jacksgong commented on June 26, 2024

是的。这块适配是根据键盘的高度适配的。

from jkeyboardpanelswitch.

zhangjinhuang avatar zhangjinhuang commented on June 26, 2024

那么就是无解了?还想着可以根据面板的高度来适应呢

from jkeyboardpanelswitch.

Jacksgong avatar Jacksgong commented on June 26, 2024

我不是很理解,你的意思是,你不想要面板适配键盘的高度吗?如果是这样,你把主动调整面板高度部分代码注释掉就行了。

from jkeyboardpanelswitch.

zhangjinhuang avatar zhangjinhuang commented on June 26, 2024

对啊,因为我觉得面板的高度应该根据它的内容来决定,不然当内容很少的时候,但面板的高度还是跟键盘一样高就会显得空白的地方很多

from jkeyboardpanelswitch.

Jacksgong avatar Jacksgong commented on June 26, 2024

好的,如果你们业务如此,可以先将你使用的面板,你看下里面有一个 refreshHeight 方法(如 KPSwitchPanelFrameLayout#refreshHeight(int):void),你把里面的ViewUtil.refreshHeight(this, panelHeight);注释掉应该就可以了。 我会考虑提供这个配置项的。

from jkeyboardpanelswitch.

zhangjinhuang avatar zhangjinhuang commented on June 26, 2024

get,谢谢你的解答

from jkeyboardpanelswitch.

Jacksgong avatar Jacksgong commented on June 26, 2024

:)

from jkeyboardpanelswitch.

Jacksgong avatar Jacksgong commented on June 26, 2024

已在 v1.4.6 带上。

from jkeyboardpanelswitch.

zhangjinhuang avatar zhangjinhuang commented on June 26, 2024

thx,已使用,另外我想问一下的是解决冲突的关键代码主要是KeyboardUtil.attach()这一块吧,有没有可能把它放到KPSwitchConflictUtil.attach()这里去解决,毕竟KeyboardUtil.attach()添加到了代码中,却没有进行什么操作,容易让人引起困惑,还不如在KPSwitchConflictUtil.attach()中进行判断它是已经有在代码中添加,有的话就不再设置了,这样的话,当用户有需要监听键盘是否显示的时候才重写KeyboardUtil.attach()方法,这只是我个人的一些想法,再次感谢你...

from jkeyboardpanelswitch.

Jacksgong avatar Jacksgong commented on June 26, 2024

@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)

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.