Fling smoothly AppBarLayout with NestedScrollView using AppBarLayout.Behavior

后端 未结 2 822
长情又很酷
长情又很酷 2020-12-30 06:33

I have an AppBarLayout and NestedScrollView. I want the NestedScrollView whenever it scroll down, the AppBarLayout should also expand gracefully, without the NestedScrollVie

相关标签:
2条回答
  • 2020-12-30 06:48

    You Should Check for NestedScrollView And NestedScrollingChild

        if (target instanceof NestedScrollView && Math.abs(velocityY) > 8000) {
            consumed = false;
        }
    
    
        if (target instanceof NestedScrollingChild && Math.abs(velocityY) > 8000) {
            consumed = false;
        }
    
    0 讨论(0)
  • 2020-12-30 06:50

    The problem has been solved with the libraries in this repository.

    (https://developer.android.com/topic/libraries/support-library/setup.html)

    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题