带弹性的侧滑菜单

作者: 5afd372c86ba | 来源:发表于2017-09-29 10:53 被阅读22次
名称 JPSpringMenu
语言 Android
平台 GitHub
作者 peng8350
链接 点此进入

常规的安卓侧滑菜单大家肯定见过,今天给大家推荐一款带弹性的侧滑菜单,话不多说,看效果图。


效果图

使用方法

  1. 添加依赖
dependencies {
    compile 'com.jpeng:jpspringmenu:$latestVersion'
}
  1. 在Activity中添加
// R.layout.view_menu is your custom menu Layout resourceId 
SpringMenu menu = new SpringMenu(this,R.layout.view_menu);

@Override 
public boolean dispatchTouchEvent(MotionEvent ev) { 
     return menu.dispatchTouchEvent(ev); 
}
  1. 配置menu
    mSpringMenu.setMenuSpringConfig(SpringConfig.fromOrigamiTensionAndFriction(20,3));
    mSpringMenu.setChildSpringConfig(SpringConfig.fromOrigamiTensionAndFriction(20, 5));

    //opened CallBack
    void onMenuOpen();
    //closed CallBack
    void onMenuClose();
    
    /**
     * When the menu is opening or closing,the method will call back(contain dragging arc)
     * @value: 0f-2f,0f indicates that the menu is closed,2f indicates that opening
     * @bouncing: this Boolean value is used to determine whether or not it is in bouncing,
     * when in bouncing,The value is infinitely close to 2f,else is 0f
     */
    void onProgressUpdate(float value,boolean bouncing);

     //Content Page dark effect
     setFadeEnable(boolean);
     
     // distance of Allow the menu to begin dragging
     setDragOffset(float);
     
     setMenuListener(MenuListener);
     
     setDirection(int direction);

相关文章

  • 带弹性的侧滑菜单

    常规的安卓侧滑菜单大家肯定见过,今天给大家推荐一款带弹性的侧滑菜单,话不多说,看效果图。 使用方法 添加依赖 在A...

  • 20- 《A GUIDE TO IOS ANIMATION 2.

    第一个动画-黏性小球 ----- 占位行 ----- 第二个动画-侧滑弹簧菜单 第一部分:侧滑菜单以及弹性动画...

  • Swift-弹性侧滑菜单

    先上一张图片 今天又学习到了一个新的动画效果,就赶快拿出来和大家分享啦。 首先,将我Demo中的LLSlideMe...

  • ios 侧滑菜单与侧滑删除手势冲突问题

    用的侧滑菜单库是:CWLateralSlide 在使用这个库后,侧滑菜单正常, 但是侧滑删除就失效了,这是因为,侧...

  • Android界面双击退出实现

    非常常见的功能 这里额外实现了有侧滑菜单的版本 包含侧滑菜单版本

  • mui侧滑菜单栏

    先创建侧菜单栏页面left.html, 打开侧滑菜单 关闭侧菜单 点击遮罩蒙版关闭侧滑页面不建议使用mask =m...

  • Recyclerview条目点击出现侧滑菜单

    最近一个奇怪的需求,Recyclerview条目点击出现侧滑菜单,侧滑菜单侧滑删除这种需求很常见,轮子也多了去了,...

  • 侧滑菜单

    https://www.jianshu.com/p/01627eb484a7https://www.jianshu...

  • 侧滑菜单

    从blueprint可以看出,NavigationView在布局的外侧 DrawerLayout布局中需要有Nav...

  • Android FrameLayout+ViewDragHelp

    大家好!这篇介绍FrameLayout+ViewDragHelper实现QQ7.1.0侧滑菜单,在QQ侧滑菜单上我...

网友评论

    本文标题:带弹性的侧滑菜单

    本文链接:https://www.haomeiwen.com/subject/zrabextx.html