CoordinatorLayout.DefaultBehaviour deprecated, no other option

Viewed 199

So according to android documentation, defaultBehaviour is deprecated and AttachedBehaviour should be used instead.

However:

attachedbehaviour

does not "exist" in android. I always receive the Annotation type expected error.

My import is: import androidx.coordinatorlayout.widget.CoordinatorLayout;

Am I using the wrong import?

1 Answers

AttachedBehavior is an interface, not an annotation.

Therefore your CustomLinearLayout must implement AttachedBehavior and override the getBehavior() method to return an instance of your MoveUpwardBehavior class.

Related