Savan Luffy
Savan Luffy

Reputation: 450

CoordinatorLayout.DefaultBehaviour deprecated, no other option

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?

Upvotes: 2

Views: 398

Answers (1)

ianhanniballake
ianhanniballake

Reputation: 199805

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.

Upvotes: 3

Related Questions