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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidhideSoftInput(EditText editText) Hide the soft input keyboard and remove focus from the suppliedEditText.static voidsetColor(AbsSeekBar seekBar, int color) Tint theAbsSeekBarthumb drawable according to the supplied color.static voidTint theEditTextby changing its cursor, hint, etc.static voidsetColor(TextInputLayout textInputLayout, int color) Tint theTextInputLayoutby changing its label and focus colors according to the supplied color.static voidsetCursorColor(TextView textView, int color) Set cursor color for the suppliedTextView.static voidshowSoftInput(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 theEditTextby 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 theTextInputLayoutby 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 theAbsSeekBarthumb 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.
-