Class DynamicShapeUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicShapeUtils
Helper class to perform shape operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DrawablegetCornerDrawable(float cornerRadius, int color, boolean topOnly) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.static DrawablegetCornerDrawable(float cornerRadius, int color, boolean topOnly, boolean adjustCorner) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.static DrawablegetCornerDrawableWithStroke(float cornerRadius, int color, boolean topOnly) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.static DrawablegetCornerDrawableWithStroke(float cornerRadius, int color, boolean topOnly, boolean adjustCorner) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.static DrawablegetCornerDrawableWithStroke(float cornerRadius, int color, boolean topOnly, boolean adjustCorner, float strokeSize, int strokeColor) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.static DrawablegetCornerDrawableWithStroke(float cornerRadius, int color, boolean topOnly, int strokeColor) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.static intgetListSelectorRes(float cornerSize) Returns the list selector resource according to the supplied corner size.static intgetOverlayDimRes(float cornerSize) Returns the dim overlay resource according to the supplied corner size.static intgetOverlayEndRes(float cornerSize) Returns the overlay end resource according to the supplied corner size.static intgetOverlayRes(float cornerSize) Returns the overlay resource according to the supplied corner size.static intgetOverlayStartRes(float cornerSize) Returns the overlay start resource according to the supplied corner size.static intgetSlideCornerSize(float cornerSize) Returns the corner size for the slider according to the supplied corner size.static intgetTabIndicatorRes(float cornerSize) Returns the tab indicator resource according to the supplied corner size.
-
Constructor Details
-
DynamicShapeUtils
public DynamicShapeUtils()
-
-
Method Details
-
getSlideCornerSize
Returns the corner size for the slider according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The corner size for the slider according to the supplied corner size.
-
getOverlayRes
Returns the overlay resource according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The overlay resource according to the supplied corner size.
-
getOverlayStartRes
Returns the overlay start resource according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The overlay start resource according to the supplied corner size.
-
getOverlayEndRes
Returns the overlay end resource according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The overlay end resource according to the supplied corner size.
-
getOverlayDimRes
Returns the dim overlay resource according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The dim overlay resource according to the supplied corner size.
-
getTabIndicatorRes
Returns the tab indicator resource according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The tab indicator resource according to the supplied corner size.
-
getListSelectorRes
Returns the list selector resource according to the supplied corner size.- Parameters:
cornerSize- The corner size to be considered in dips.- Returns:
- The list selector resource according to the supplied corner size.
-
getCornerDrawable
@NonNull public static Drawable getCornerDrawable(float cornerRadius, @ColorInt int color, boolean topOnly, boolean adjustCorner) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.- Parameters:
cornerRadius- The corner size in dip for the drawable.color- The color for the drawable.topOnly-trueto round the top corners only.adjustCorner-trueto automatically adjust the corner radius.- Returns:
- The
MaterialShapeDrawabledrawable according to the supplied parameters.
-
getCornerDrawable
@NonNull public static Drawable getCornerDrawable(float cornerRadius, @ColorInt int color, boolean topOnly) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.- Parameters:
cornerRadius- The corner size in dip for the drawable.color- The color for the drawable.topOnly-trueto round the top corners only.- Returns:
- The
MaterialShapeDrawabledrawable according to the supplied parameters.
-
getCornerDrawableWithStroke
@NonNull public static Drawable getCornerDrawableWithStroke(float cornerRadius, @ColorInt int color, boolean topOnly, boolean adjustCorner, float strokeSize, @ColorInt int strokeColor) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.- Parameters:
cornerRadius- The corner size in dip for the drawable.color- The color for the drawable.topOnly-trueto round the top corners only.adjustCorner-trueto automatically adjust the corner radius.strokeSize- The sizegreater than 0in dip to enable the stroke.strokeColor- The color for the stroke.- Returns:
- The
MaterialShapeDrawabledrawable according to the supplied parameters.
-
getCornerDrawableWithStroke
@NonNull public static Drawable getCornerDrawableWithStroke(float cornerRadius, @ColorInt int color, boolean topOnly, boolean adjustCorner) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.- Parameters:
cornerRadius- The corner size in dip for the drawable.color- The color for the drawable.topOnly-trueto round the top corners only.adjustCorner-trueto automatically adjust the corner radius.- Returns:
- The
MaterialShapeDrawabledrawable according to the supplied parameters.
-
getCornerDrawableWithStroke
@NonNull public static Drawable getCornerDrawableWithStroke(float cornerRadius, @ColorInt int color, boolean topOnly, @ColorInt int strokeColor) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.- Parameters:
cornerRadius- The corner size in dip for the drawable.color- The color for the drawable.topOnly-trueto round the top corners only.strokeColor- The color for the stroke.- Returns:
- The
MaterialShapeDrawabledrawable according to the supplied parameters.
-
getCornerDrawableWithStroke
@NonNull public static Drawable getCornerDrawableWithStroke(float cornerRadius, @ColorInt int color, boolean topOnly) Returns aMaterialShapeDrawabledrawable according to the supplied parameters.- Parameters:
cornerRadius- The corner size in dip for the drawable.color- The color for the drawable.topOnly-trueto round the top corners only.- Returns:
- The
MaterialShapeDrawabledrawable according to the supplied parameters.
-