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
I faced the same problem and solved it this way.
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) mAppBarLayout.getLayoutParams();
AppBarLayout.Behavior behavior = new AppBarLayout.Behavior();
behavior.setDragCallback(new AppBarLayout.Behavior.DragCallback() {
@Override
public boolean canDrag(AppBarLayout appBarLayout) {
return false;
}
});
params.setBehavior(behavior);
Here's the same solution but in Kotlin:
val appBarLayout = findViewById<AppBarLayout>(R.id.appBar)
val params = appBarLayout.layoutParams as CoordinatorLayout.LayoutParams
val behavior = AppBarLayout.Behavior()
behavior.setDragCallback(object : AppBarLayout.Behavior.DragCallback() {
override fun canDrag(appBarLayout: AppBarLayout): Boolean {
return false
}
})
params.behavior = behavior
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);