Panning google map in CoordinatorLayout causes recyclerview to scroll in android design support library 23.0.1

前端 未结 3 1734
温柔的废话
温柔的废话 2021-02-04 08:19

The map is in a collapsingToolbarLayout which is nested in an appBarLayout. In versions 22.2.0 and 22.2.1 of the android design support library, I could pan around the map inde

3条回答
  •  [愿得一人]
    2021-02-04 09:10

    The same you asked was reported as a Bug

    After that AppBarLayout.Behavior.DragCallback came to existence. This was you can disable or drag events inside container.

        AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appbar_layout);
            CoordinatorLayout.LayoutParams params = 
                    (CoordinatorLayout.LayoutParams) appBarLayout.getLayoutParams();
            AppBarLayout.Behavior behavior = new AppBarLayout.Behavior();
            behavior.setDragCallback(new AppBarLayout.Behavior.DragCallback() {
                @Override
                public boolean canDrag(AppBarLayout appBarLayout) {
                    return false;
                }
            });
    params.setBehavior(behavior);
    

提交回复
热议问题