Class InterfaceUtilities

java.lang.Object
com.example.skeddly.ui.utility.InterfaceUtilities

public class InterfaceUtilities extends Object
Some useful UI functions for showing UI elements.
  • Field Details

    • calendarConstraints

      public static final com.google.android.material.datepicker.CalendarConstraints calendarConstraints
    • underlineSpan

      public static final android.text.style.UnderlineSpan underlineSpan
    • timeFormatter

      public static final DateTimeFormatter timeFormatter
    • dateFormatter

      public static final DateTimeFormatter dateFormatter
  • Constructor Details

    • InterfaceUtilities

      public InterfaceUtilities(androidx.fragment.app.FragmentManager fragmentManager)
  • Method Details

    • setupDatePicker

      public void setupDatePicker(android.view.View view, com.google.android.material.datepicker.MaterialPickerOnPositiveButtonClickListener<Long> callback)
      Setup a date picker and call you back when the user has finished picking the date
      Parameters:
      view - The view that should have the click associated with
      callback - The callback function that should be ran
    • setupTimePicker

      public void setupTimePicker(android.view.View view, MaterialTimePickerCallback callback)
      Setup a time picker and call you back when the user has finished picking the time
      Parameters:
      view - The view that should have the click associated with
      callback - The callback function that should be ran
    • underlineString

      public static android.text.SpannableString underlineString(String string)
      Underline the given string and return it as a SpannableString
      Parameters:
      string - The string to underline
      Returns:
      The given string, but underlined as a SpannableString
    • convertDpToPx

      public static float convertDpToPx(android.content.Context context, float dp)
      Converts dp to px
      Parameters:
      context - Context
      dp - Density pixels
      Returns:
      float pixels