Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

InterpolateOnScrollPositionChangeHelper

public class InterpolateOnScrollPositionChangeHelper
extends Object

java.lang.Object
   ↳ com.google.android.material.shape.InterpolateOnScrollPositionChangeHelper


Helper class to handle shape interpolation when shaped views enter or exit the window.

Summary

Public constructors

InterpolateOnScrollPositionChangeHelper(View shapedView, MaterialShapeDrawable materialShapeDrawable, ScrollView containingScrollView)

Instantiate a scroll position helper.

Public methods

void setContainingScrollView(ScrollView containingScrollView)

Set the ScrollView which contains the View being interpolated.

void setMaterialShapeDrawable(MaterialShapeDrawable materialShapeDrawable)

Set the MaterialShapeDrawable which will be interpolated.

void startListeningForScrollChanges(ViewTreeObserver viewTreeObserver)

Start listening for scroll changes and interpolating based on position.

void stopListeningForScrollChanges(ViewTreeObserver viewTreeObserver)

Stop listening for scroll changes and interpolating based on position.

void updateInterpolationForScreenPosition()

Updates the MaterialShapeDrawable's interpolation based on the View's position in the containing ScrollView.

Inherited methods

Public constructors

InterpolateOnScrollPositionChangeHelper

public InterpolateOnScrollPositionChangeHelper (View shapedView, 
                MaterialShapeDrawable materialShapeDrawable, 
                ScrollView containingScrollView)

Instantiate a scroll position helper.

Parameters
shapedView View: the View whose background is a MaterialShapeDrawable and which is scrolled in and out of view.

materialShapeDrawable MaterialShapeDrawable: the MaterialShapeDrawable which will be interpolated.

containingScrollView ScrollView: the ScrollView that contains shapedView.

Public methods

setContainingScrollView

public void setContainingScrollView (ScrollView containingScrollView)

Set the ScrollView which contains the View being interpolated.

setMaterialShapeDrawable

public void setMaterialShapeDrawable (MaterialShapeDrawable materialShapeDrawable)

Set the MaterialShapeDrawable which will be interpolated.

Parameters
materialShapeDrawable MaterialShapeDrawable: the desired drawable.

startListeningForScrollChanges

public void startListeningForScrollChanges (ViewTreeObserver viewTreeObserver)

Start listening for scroll changes and interpolating based on position.

Parameters
viewTreeObserver ViewTreeObserver: {@link ViewTreeObserver belonging to the {@link View} being interpolated.

stopListeningForScrollChanges

public void stopListeningForScrollChanges (ViewTreeObserver viewTreeObserver)

Stop listening for scroll changes and interpolating based on position.

Parameters
viewTreeObserver ViewTreeObserver: {@link ViewTreeObserver belonging to the {@link View} being interpolated.

updateInterpolationForScreenPosition

public void updateInterpolationForScreenPosition ()

Updates the MaterialShapeDrawable's interpolation based on the View's position in the containing ScrollView.