Search code examples
androidandroid-studioandroid-support-librarybottom-sheetandroid-layoutparams

AS can't find BottomSheetBehavior_Params, _behavior_peekHeight and _behavior_hideable


I just update my app to Support Library version 24.0.0 and I'm getting some error about BottomSheet Params.
The code:

/**
 * Default constructor for inflating BottomSheetBehaviors from layout.
 *
 * @param context The {@link Context}.
 * @param attrs   The {@link AttributeSet}.
 */
public BottomSheetBehaviorGoogleMapsLike(Context context, AttributeSet attrs) {
    super(context, attrs);
    TypedArray a = context.obtainStyledAttributes(attrs,
            android.support.design.R.styleable.BottomSheetBehavior_Params);
    setPeekHeight(a.getDimensionPixelSize(
            android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_peekHeight, 0));
    setHideable(a.getBoolean(android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_hideable, false));
    a.recycle();
    ViewConfiguration configuration = ViewConfiguration.get(context);
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}

Android Studio can't find:

  • android.support.design.R.styleable.BottomSheetBehavior_Params
  • android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_peekHeight
  • android.support.design.R.styleable.BottomSheetBehavior_Params_behavior_hideable

Any idea where they moved it?


Solution

  • I got it! they change its name. Just change the word Param for Layout.
    Like this: BottomSheetBehavior_Layout_behavior_peekHeight

    More info in official docs