@@ -1199,14 +1199,24 @@ public static class LayoutParams extends LinearLayout.LayoutParams {
11991199 * No effect should be placed on this view. It will scroll 1:1 with the AppBarLayout/scrolling
12001200 * content.
12011201 */
1202- private static final int SCROLL_EFFECT_NONE = 0 ;
1202+ public static final int SCROLL_EFFECT_NONE = 0 ;
12031203
12041204 /**
12051205 * An effect that will "compress" this view as it hits the scroll ceiling (typically the top of
12061206 * the screen). This is a parallax effect that masks this view and decreases its scroll ratio
12071207 * in relation to the AppBarLayout's offset.
12081208 */
1209- private static final int SCROLL_EFFECT_COMPRESS = 1 ;
1209+ public static final int SCROLL_EFFECT_COMPRESS = 1 ;
1210+
1211+ /**
1212+ * The scroll effect to be applied when the AppBarLayout's offset changes.
1213+ *
1214+ * @hide
1215+ */
1216+ @ RestrictTo (LIBRARY_GROUP )
1217+ @ IntDef ({SCROLL_EFFECT_NONE , SCROLL_EFFECT_COMPRESS })
1218+ @ Retention (RetentionPolicy .SOURCE )
1219+ public @interface ScrollEffect {}
12101220
12111221 private ChildScrollEffect scrollEffect ;
12121222
@@ -1219,7 +1229,7 @@ public LayoutParams(Context c, AttributeSet attrs) {
12191229
12201230 int scrollEffectInt =
12211231 a .getInt (R .styleable .AppBarLayout_Layout_layout_scrollEffect , SCROLL_EFFECT_NONE );
1222- setScrollEffect (createScrollEffectFromInt ( scrollEffectInt ) );
1232+ setScrollEffect (scrollEffectInt );
12231233
12241234 if (a .hasValue (R .styleable .AppBarLayout_Layout_layout_scrollInterpolator )) {
12251235 int resId = a .getResourceId (R .styleable .AppBarLayout_Layout_layout_scrollInterpolator , 0 );
@@ -1313,6 +1323,17 @@ public void setScrollEffect(@Nullable ChildScrollEffect scrollEffect) {
13131323 this .scrollEffect = scrollEffect ;
13141324 }
13151325
1326+ /**
1327+ * Set the scroll effect to be applied when the AppBarLayout's offset changes.
1328+ *
1329+ * @param scrollEffect An {@code AppBarLayoutChildScrollEffect} implementation. If
1330+ * {@link #SCROLL_EFFECT_NONE} is passed, the scroll effect will be cleared and no
1331+ * effect will be applied.
1332+ */
1333+ public void setScrollEffect (@ ScrollEffect int scrollEffect ) {
1334+ this .scrollEffect = createScrollEffectFromInt (scrollEffect );
1335+ }
1336+
13161337 /**
13171338 * Set the interpolator to when scrolling the view associated with this {@link LayoutParams}.
13181339 *
0 commit comments