Class DynamicInputUtils
java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicInputUtils
Helper class to tint the various input widgets like
EditText
, etc. dynamically
by using reflection. It will be used to match the color with the app's theme.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
hideSoftInput
(EditText editText) Hide the soft input keyboard and remove focus from the suppliedEditText
.static void
setColor
(AbsSeekBar seekBar, int color) Tint theAbsSeekBar
thumb drawable according to the supplied color.static void
Tint theEditText
by changing its cursor, hint, etc.static void
setColor
(TextInputLayout textInputLayout, int color) Tint theTextInputLayout
by changing its label and focus colors according to the supplied color.static void
setCursorColor
(TextView textView, int color) Set cursor color for the suppliedTextView
.static void
showSoftInput
(EditText editText) Show the soft input keyboard and focus it on the suppliedEditText
.
-
Constructor Details
-
DynamicInputUtils
public DynamicInputUtils()
-
-
Method Details
-
setCursorColor
Set cursor color for the suppliedTextView
.- Parameters:
textView
- The text view to set the cursor color.color
- The color for the cursor.
-
setColor
public static void setColor(@Nullable EditText editText, @ColorInt int background, @ColorInt int color) Tint theEditText
by changing its cursor, hint, etc. colors according to the supplied color.- Parameters:
editText
- The edit text to be colorized.background
- The background color to be used.color
- The color to be used.
-
setColor
Tint theTextInputLayout
by changing its label and focus colors according to the supplied color.- Parameters:
textInputLayout
- The text input layout to be colorized.color
- The color to be used.
-
setColor
Tint theAbsSeekBar
thumb drawable according to the supplied color.- Parameters:
seekBar
- The seek bar to be colorized.color
- The color to be used.
-
showSoftInput
Show the soft input keyboard and focus it on the suppliedEditText
.- Parameters:
editText
- The edit text to show the soft input.
-
hideSoftInput
Hide the soft input keyboard and remove focus from the suppliedEditText
.- Parameters:
editText
- The edit text to clear the focus.
-