Class DynamicInputUtils

java.lang.Object
com.pranavpandey.android.dynamic.support.util.DynamicInputUtils

public class DynamicInputUtils extends Object
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 Details

    • DynamicInputUtils

      public DynamicInputUtils()
  • Method Details

    • setCursorColor

      public static void setCursorColor(@Nullable TextView textView, @ColorInt int color)
      Set cursor color for the supplied TextView.
      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 the EditText 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

      public static void setColor(@Nullable TextInputLayout textInputLayout, @ColorInt int color)
      Tint the TextInputLayout 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

      public static void setColor(@Nullable AbsSeekBar seekBar, @ColorInt int color)
      Tint the AbsSeekBar thumb drawable according to the supplied color.
      Parameters:
      seekBar - The seek bar to be colorized.
      color - The color to be used.
    • showSoftInput

      public static void showSoftInput(@Nullable EditText editText)
      Show the soft input keyboard and focus it on the supplied EditText.
      Parameters:
      editText - The edit text to show the soft input.
    • hideSoftInput

      public static void hideSoftInput(@Nullable EditText editText)
      Hide the soft input keyboard and remove focus from the supplied EditText.
      Parameters:
      editText - The edit text to clear the focus.