Package com.example.skeddly.ui.utility
Class InterfaceUtilities
java.lang.Object
com.example.skeddly.ui.utility.InterfaceUtilities
Some useful UI functions for showing UI elements.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.android.material.datepicker.CalendarConstraintsstatic final DateTimeFormatterstatic final DateTimeFormatterstatic final android.text.style.UnderlineSpan -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatconvertDpToPx(android.content.Context context, float dp) Converts dp to pxvoidsetupDatePicker(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 datevoidsetupTimePicker(android.view.View view, MaterialTimePickerCallback callback) Setup a time picker and call you back when the user has finished picking the timestatic android.text.SpannableStringunderlineString(String string) Underline the given string and return it as a SpannableString
-
Field Details
-
calendarConstraints
public static final com.google.android.material.datepicker.CalendarConstraints calendarConstraints -
underlineSpan
public static final android.text.style.UnderlineSpan underlineSpan -
timeFormatter
-
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 withcallback- The callback function that should be ran
-
setupTimePicker
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 withcallback- The callback function that should be ran
-
underlineString
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- Contextdp- Density pixels- Returns:
- float pixels
-