Example usage for android.graphics.drawable StateListDrawable getIntrinsicWidth

List of usage examples for android.graphics.drawable StateListDrawable getIntrinsicWidth

Introduction

In this page you can find the example usage for android.graphics.drawable StateListDrawable getIntrinsicWidth.

Prototype

@Override
    public int getIntrinsicWidth() 

Source Link

Usage

From source file:android.support.v7.widget.FastScroller.java

FastScroller(RecyclerView recyclerView, StateListDrawable verticalThumbDrawable, Drawable verticalTrackDrawable,
        StateListDrawable horizontalThumbDrawable, Drawable horizontalTrackDrawable, int defaultWidth,
        int scrollbarMinimumRange, int margin) {
    mVerticalThumbDrawable = verticalThumbDrawable;
    mVerticalTrackDrawable = verticalTrackDrawable;
    mHorizontalThumbDrawable = horizontalThumbDrawable;
    mHorizontalTrackDrawable = horizontalTrackDrawable;
    mVerticalThumbWidth = Math.max(defaultWidth, verticalThumbDrawable.getIntrinsicWidth());
    mVerticalTrackWidth = Math.max(defaultWidth, verticalTrackDrawable.getIntrinsicWidth());
    mHorizontalThumbHeight = Math.max(defaultWidth, horizontalThumbDrawable.getIntrinsicWidth());
    mHorizontalTrackHeight = Math.max(defaultWidth, horizontalTrackDrawable.getIntrinsicWidth());
    mScrollbarMinimumRange = scrollbarMinimumRange;
    mMargin = margin;/*from  ww  w .j a va 2 s.c  o  m*/
    mVerticalThumbDrawable.setAlpha(SCROLLBAR_FULL_OPAQUE);
    mVerticalTrackDrawable.setAlpha(SCROLLBAR_FULL_OPAQUE);

    mShowHideAnimator.addListener(new AnimatorListener());
    mShowHideAnimator.addUpdateListener(new AnimatorUpdater());

    attachToRecyclerView(recyclerView);
}