Class DynamicScrollUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicScrollUtils
Helper class to set
EdgeEffect
or glow color and scroll bar color for the supported
views dynamically by using reflection. It will be used to match the color with the app's theme.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.android.material.internal.NavigationMenuView
Returns the navigation menu view associated with the supplied navigation view.static void
setEdgeEffectColor
(AbsListView view, int color) Set the edge effect or glow color for the list view.static void
setEdgeEffectColor
(HorizontalScrollView view, int color) Set the edge effect or glow color for the horizontal scroll view.static void
setEdgeEffectColor
(ScrollView view, int color) Set the edge effect or glow color for the scroll view.static void
setEdgeEffectColor
(NestedScrollView view, int color) Set the edge effect or glow color for the nested scroll view.static void
setEdgeEffectColor
(RecyclerView view, int color) Set the edge effect or glow color for the recycler view.static void
setEdgeEffectColor
(RecyclerView view, int color, RecyclerView.OnScrollListener scrollListener) Set the edge effect or glow color for the recycler view.static void
setEdgeEffectColor
(ViewPager view, int color) Set the edge effect or glow color for the view pager.static void
setEdgeEffectColor
(NavigationView view, int color) Set the edge effect or glow color for the navigation view.static void
setEdgeEffectColor
(Object edgeEffect, int color) Set color of the supplied edge effect object.static void
setScrollBarColor
(View view, int color) Set the scroll bar color for the view.static void
setScrollBarColor
(View view, int color, boolean drawable, float cornerSize) Set the scroll bar color for the view.static void
setScrollBarColor
(NavigationView view, int color) Set the scroll bar color for the navigation view.static void
setSelectorColor
(AbsListView view, int color, int background) Set the selector color for the list view.static void
setSubHeaderColor
(NavigationView view, int color) Set the sub header color for the view.static <T> void
tint
(T view, int contrastWithColor) Tint view according to the supplied contrast with color.
-
Constructor Details
-
DynamicScrollUtils
public DynamicScrollUtils()
-
-
Method Details
-
setEdgeEffectColor
Set the edge effect or glow color for the list view.- Parameters:
view
- The list view to be used.color
- The color to be set.
-
setEdgeEffectColor
Set the edge effect or glow color for the recycler view.- Parameters:
view
- The recycler view to be used.color
- The color to be set.
-
setEdgeEffectColor
public static void setEdgeEffectColor(@Nullable RecyclerView view, @ColorInt int color, @Nullable RecyclerView.OnScrollListener scrollListener) Set the edge effect or glow color for the recycler view.- Parameters:
view
- The recycler view to be used.color
- The color to be set.scrollListener
- The scroll listener to set the color on over scroll.
-
setEdgeEffectColor
Set the edge effect or glow color for the scroll view.- Parameters:
view
- The scroll view to be used.color
- The color to be set.
-
setEdgeEffectColor
Set the edge effect or glow color for the horizontal scroll view.- Parameters:
view
- The horizontal scroll view to be used.color
- The color to be set.
-
setEdgeEffectColor
Set the edge effect or glow color for the nested scroll view.- Parameters:
view
- The nested scroll view to be used.color
- The color to be set.
-
setEdgeEffectColor
Set the edge effect or glow color for the view pager.- Parameters:
view
- The view pager to be used.color
- The color to be set.
-
setEdgeEffectColor
Set color of the supplied edge effect object.- Parameters:
edgeEffect
- The edge effect object to be used.color
- The color to be set.
-
setScrollBarColor
public static void setScrollBarColor(@Nullable View view, @ColorInt int color, boolean drawable, float cornerSize) Set the scroll bar color for the view.- Parameters:
view
- The view to be used.color
- The color to be set.drawable
-true
to set the thumb drawable.cornerSize
- The corner size to be considered in dips.
-
setScrollBarColor
Set the scroll bar color for the view.- Parameters:
view
- The view to be used.color
- The color to be set.- See Also:
-
setSelectorColor
public static void setSelectorColor(@Nullable AbsListView view, @ColorInt int color, @ColorInt int background) Set the selector color for the list view.- Parameters:
view
- The list view to be used.color
- The selector color to be set.background
- The background color to be used.
-
tint
Tint view according to the supplied contrast with color.- Type Parameters:
T
- The type of the view.- Parameters:
view
- The scrollable to be tinted.contrastWithColor
- The contrast with color to be considered.- See Also:
-
setEdgeEffectColor(AbsListView, int)
setEdgeEffectColor(RecyclerView, int)
setEdgeEffectColor(ScrollView, int)
setEdgeEffectColor(HorizontalScrollView, int)
setEdgeEffectColor(NestedScrollView, int)
setEdgeEffectColor(ViewPager, int)
setEdgeEffectColor(NavigationView, int)
setScrollBarColor(NavigationView, int)
setScrollBarColor(View, int)
setSelectorColor(AbsListView, int, int)