FL
Size: a a a
FL
👊
S
👊
QH
シ
👊
👊
QH
シ
public class CustomScrollBarRecyclerView extends RecyclerView { private int scrollBarColor = Color.RED; public CustomScrollBarRecyclerView(Context context) { super(context); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void setScrollBarColor(@ColorInt int scrollBarColor) { this.scrollBarColor = scrollBarColor; } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawHorizontalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawVerticalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } }
シ
QH
public class CustomScrollBarRecyclerView extends RecyclerView { private int scrollBarColor = Color.RED; public CustomScrollBarRecyclerView(Context context) { super(context); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void setScrollBarColor(@ColorInt int scrollBarColor) { this.scrollBarColor = scrollBarColor; } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawHorizontalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawVerticalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } }
シ
👊
シ
QH
👊
シ
👊
public class CustomScrollBarRecyclerView extends RecyclerView { private int scrollBarColor = Color.RED; public CustomScrollBarRecyclerView(Context context) { super(context); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void setScrollBarColor(@ColorInt int scrollBarColor) { this.scrollBarColor = scrollBarColor; } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawHorizontalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawVerticalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } }
👊
public class CustomScrollBarRecyclerView extends RecyclerView { private int scrollBarColor = Color.RED; public CustomScrollBarRecyclerView(Context context) { super(context); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs) { super(context, attrs); } public CustomScrollBarRecyclerView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public void setScrollBarColor(@ColorInt int scrollBarColor) { this.scrollBarColor = scrollBarColor; } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawHorizontalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } /** * Called by Android {@link android.view.View#onDrawScrollBars(Canvas)} **/ protected void onDrawVerticalScrollBar(Canvas canvas, Drawable scrollBar, int l, int t, int r, int b) { scrollBar.setColorFilter(scrollBarColor, PorterDuff.Mode.SRC_ATOP); scrollBar.setBounds(l, t, r, b); scrollBar.draw(canvas); } }