Need to disable expand on CollapsingToolbarLayout for certain fragments

前端 未结 14 1359
萌比男神i
萌比男神i 2020-11-28 08:55

I have a AppCompatActivity that controls replacing many fragments. Here is my layout for it.

activity_main.xml



        
14条回答
  •  天命终不由人
    2020-11-28 09:28

    I have used @JasonWyatt's solution and added DragCallback to behavior class to prevent touch and drag CollapsingToolbarLayout to expand it

    private void setDragCallback() {
        setDragCallback(new DragCallback() {
            @Override
            public boolean canDrag(@NonNull AppBarLayout appBarLayout) {
                return mEnabled;
            }
        });
    }
    

提交回复
热议问题