# AppbarLayoutBehavior **Repository Path**: zhanping/AppbarLayoutBehavior ## Basic Information - **Project Name**: AppbarLayoutBehavior - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AppBarLayoutBehavior 解决AppbarLayout滑动问题的behavior ## 问题描述 1) 快速滑动AppBarLayout会出现回弹; 2) 快速滑动AppBarLayout到折叠状态下,立马下拉会出现抖动现象; 3) 滑动AppBarLayout过程中,无法像RecyclerView那样通过手指按下停止滚动。 ## 如何使用 ### gradle Step 1. Add the JitPack repository in your root build.gradle at the end of repositories: ```groovy allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` Step 2. Add the dependency in your app build.gradle: ```groovy dependencies { // 其中latest-version类似 v1.0.3 implementation 'com.github.yuruiyin:AppbarLayoutBehavior:latest-version' } ``` ### xml ```xml ...... ``` ### 混淆 若使用support库,则需要保证support库中的代码不被混淆,请在proguard-rules.pro中添加如下配置: ```proguard # 保留support下的所有类及内部类 -keep class android.support.**{*;} -dontwarn android.support.v4.** # 保留继承support库的类 -keep public class * extends android.support.v4.** -keep public class * extends android.support.v7.** -keep public class * extends android.support.annotation.** ``` 若已迁移到androidx,则需要添加如下配置: ```proguard -keep class com.google.android.material.** {*;} -keep class androidx.** {*;} -keep public class * extends androidx.** -keep interface androidx.** {*;} -dontwarn com.google.android.material.** -dontnote com.google.android.material.** -dontwarn androidx.** ``` ## 参考 https://blog.csdn.net/vite_s/article/details/78901767