Class DynamicInputUtils

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

public class DynamicInputUtils extends Object
Helper class to perform input operations.
  • Constructor Details

    • DynamicInputUtils

      public DynamicInputUtils()
  • Method Details

    • setFilter

      public static void setFilter(@Nullable View view, @Nullable InputFilter filter)
      Set the input filter for the supplied view.
      Parameters:
      view - The view to be used.
      filter - The input filter to be set.
    • removeFilter

      public static void removeFilter(@Nullable View view, @Nullable InputFilter filter)
      Remove the input filter for the supplied view.
      Parameters:
      view - The view to be used.
      filter - The input filter to be removed.
    • setMaxLength

      public static void setMaxLength(@Nullable View view, int length)
      Set the maximum length input filter for the supplied view.
      Parameters:
      view - The view to be used.
      length - The maximum length to be set.
      See Also:
    • setAllCaps

      public static void setAllCaps(@Nullable View view, boolean allCaps)
      Set the all caps input filter for the supplied view.
      Parameters:
      view - The view to be used.
      allCaps - true to set all caps.
      See Also:
    • applyWindowInsets

      public static void applyWindowInsets(@Nullable View view, boolean left, boolean top, boolean right, boolean bottom, boolean consume)
      Apply window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      left - true to apply the left window inset padding.
      top - true to apply the top window inset padding.
      right - true to apply the right window inset padding.
      bottom - true to apply the bottom window inset padding.
      consume - true to consume the applied window insets.
    • applyWindowInsetsHorizontal

      public static void applyWindowInsetsHorizontal(@Nullable View view, boolean consume)
      Apply horizontal window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsHorizontal

      public static void applyWindowInsetsHorizontal(@Nullable View view)
      Apply horizontal window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      See Also:
    • applyWindowInsetsVertical

      public static void applyWindowInsetsVertical(@Nullable View view, boolean consume)
      Apply vertical window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsVertical

      public static void applyWindowInsetsVertical(@Nullable View view)
      Apply vertical window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      See Also:
    • applyWindowInsetsBottom

      public static void applyWindowInsetsBottom(@Nullable View view, boolean consume)
      Apply bottom window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsBottom

      public static void applyWindowInsetsBottom(@Nullable View view)
      Apply bottom window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      See Also:
    • applyWindowInsetsHorizontalBottom

      public static void applyWindowInsetsHorizontalBottom(@Nullable View view, boolean consume)
      Apply horizontal and bottom window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsHorizontalBottom

      public static void applyWindowInsetsHorizontalBottom(@Nullable View view)
      Apply horizontal and bottom window insets padding for the supplied view.
      Parameters:
      view - The view to set the insets padding.
      See Also:
    • applyWindowInsetsMargin

      public static void applyWindowInsetsMargin(@Nullable View view, boolean left, boolean top, boolean right, boolean bottom, boolean consume)
      Apply window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      left - true to apply the left window inset margin.
      top - true to apply the top window inset margin.
      right - true to apply the right window inset margin.
      bottom - true to apply the bottom window inset margin.
      consume - true to consume the applied window margin.
    • applyWindowInsetsMarginHorizontal

      public static void applyWindowInsetsMarginHorizontal(@Nullable View view, boolean consume)
      Apply horizontal window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsMarginHorizontal

      public static void applyWindowInsetsMarginHorizontal(@Nullable View view)
      Apply horizontal window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      See Also:
    • applyWindowInsetsMarginVertical

      public static void applyWindowInsetsMarginVertical(@Nullable View view, boolean consume)
      Apply vertical window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsMarginVertical

      public static void applyWindowInsetsMarginVertical(@Nullable View view)
      Apply vertical window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      See Also:
    • applyWindowInsetsMarginBottom

      public static void applyWindowInsetsMarginBottom(@Nullable View view, boolean consume)
      Apply bottom window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsMarginBottom

      public static void applyWindowInsetsMarginBottom(@Nullable View view)
      Apply bottom window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      See Also:
    • applyWindowInsetsMarginHorizontalBottom

      public static void applyWindowInsetsMarginHorizontalBottom(@Nullable View view, boolean consume)
      Apply horizontal and bottom window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      consume - true to consume the applied window insets.
      See Also:
    • applyWindowInsetsMarginHorizontalBottom

      public static void applyWindowInsetsMarginHorizontalBottom(@Nullable View view)
      Apply horizontal and bottom window insets margin for the supplied view.
      Parameters:
      view - The view to set the insets margin.
      See Also: