All Implemented Interfaces:
ComponentCallbacks, DialogInterface.OnCancelListener, DialogInterface.OnDismissListener, SharedPreferences.OnSharedPreferenceChangeListener, View.OnCreateContextMenuListener, ActivityResultCaller, HasDefaultViewModelProviderFactory, LifecycleOwner, ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner, DynamicProductFlavor
Direct Known Subclasses:
DynamicSizeDialog

public class DynamicSliderDialog extends DynamicDialogFragment
A DynamicDialogFragment to provide value picker functionality via DynamicSliderPreference.
  • Field Details

  • Constructor Details

    • DynamicSliderDialog

      public DynamicSliderDialog()
  • Method Details

    • newInstance

      @NonNull public static DynamicSliderDialog newInstance()
      Initialize the new instance of this fragment.
      Returns:
      An instance of DynamicSliderDialog.
    • getLayoutRes

      @LayoutRes public int getLayoutRes()
      Description copied from class: DynamicDialogFragment
      Returns the layout resource for this dialog.
      Overrides:
      getLayoutRes in class DynamicDialogFragment
      Returns:
      The layout resource for this dialog.
    • onCustomiseBuilder

      @NonNull protected DynamicDialog.Builder onCustomiseBuilder(@NonNull DynamicDialog.Builder dialogBuilder, @Nullable Bundle savedInstanceState)
      Description copied from class: DynamicDialogFragment
      Override this method to customise the dynamic dialog builder before creating the dialog.
      Overrides:
      onCustomiseBuilder in class DynamicDialogFragment
      Parameters:
      dialogBuilder - The current builder to be customised.
      savedInstanceState - The saved state of the fragment to restore it later.
      Returns:
      The customised dynamic dialog builder.
    • showDialog

      public void showDialog(@NonNull FragmentActivity fragmentActivity)
      Description copied from class: DynamicDialogFragment
      Show this dialog fragment and attach it to the supplied activity.
      Overrides:
      showDialog in class DynamicDialogFragment
      Parameters:
      fragmentActivity - The fragment activity to attach this dialog fragment.
    • onSaveInstanceState

      public void onSaveInstanceState(@NonNull Bundle outState)
      Overrides:
      onSaveInstanceState in class DialogFragment
    • getIcon

      @Nullable public Drawable getIcon()
      Get the icon used by the slider preference.
      Returns:
      The icon used by the slider preference.
    • setIcon

      Set the icon used by the slider preference.
      Parameters:
      icon - The icon to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getTitle

      @Nullable public String getTitle()
      Get the title used by the slider preference.
      Returns:
      The title used by the slider preference.
    • setTitle

      @NonNull public DynamicSliderDialog setTitle(@Nullable String title)
      Set the title used by the slider preference.
      Parameters:
      title - The title to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getSummary

      @Nullable public String getSummary()
      Get the summary used by the slider preference.
      Returns:
      The summary used by the slider preference.
    • setSummary

      @NonNull public DynamicSliderDialog setSummary(@Nullable String summary)
      Set the summary used by the slider preference.
      Parameters:
      summary - The summary to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getMin

      public int getMin()
      Get the minimum value used by the slider preference.
      Returns:
      The minimum value used by the slider preference.
    • setMin

      @NonNull public DynamicSliderDialog setMin(int min)
      Set the minimum value used by the slider preference.
      Parameters:
      min - The minimum value to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getMax

      public int getMax()
      Get the maximum value used by the slider preference.
      Returns:
      The maximum value used by the slider preference.
    • setMax

      @NonNull public DynamicSliderDialog setMax(int max)
      Set the maximum value used by the slider preference.
      Parameters:
      max - The maximum value to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getInterval

      public int getInterval()
      Get the interval used by the slider preference.
      Returns:
      The interval used by the slider preference.
    • setInterval

      @NonNull public DynamicSliderDialog setInterval(int interval)
      Set the interval used by the slider preference.
      Parameters:
      interval - The interval to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getUnit

      @Nullable public String getUnit()
      Get the unit used by the slider preference.
      Returns:
      The unit used by the slider preference.
    • setUnit

      Set the unit used by the slider preference.
      Parameters:
      unit - The unit to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getOnSliderChangeListener

      @Nullable public DynamicSliderChangeListener<Slider> getOnSliderChangeListener()
      Get the slider change listener used by this dialog.
      Returns:
      The slider change listener used by this dialog.
    • setOnSliderChangeListener

      @NonNull public DynamicSliderDialog setOnSliderChangeListener(@Nullable DynamicSliderChangeListener<Slider> onSliderChangeListener)
      Set the slider change listener used by this dialog.
      Parameters:
      onSliderChangeListener - The slider change listener to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getValueListener

      @Nullable public DynamicValueListener<Integer> getValueListener()
      Get the value listener used by this dialog.
      Returns:
      The value listener used by this dialog.
    • setValueListener

      @NonNull public DynamicSliderDialog setValueListener(@Nullable DynamicValueListener<Integer> valueListener)
      Set the value listener used by this dialog.
      Parameters:
      valueListener - The slider change listener to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getValue

      public int getValue()
      Get the current value of the slider preference.
      Returns:
      The current value of the slider preference.
    • setValue

      @NonNull public DynamicSliderDialog setValue(int value)
      Set the current value of the slider preference.
      Parameters:
      value - The current value to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • setValue

      @NonNull public DynamicSliderDialog setValue(@NonNull Point value)
      Set the current value of the slider preference.
      Parameters:
      value - The current value to be set.
      Returns:
      The DynamicSliderDialog object to allow for chaining of calls to set methods.
    • getSliderPreference

      @Nullable public DynamicSliderPreference getSliderPreference()
      Get the slider preference used by this dialog.
      Returns:
      The slider preference used by this dialog.
    • getProgressFromValue

      public int getProgressFromValue(int value)
      Returns the slider progress according to the supplied value.
      Parameters:
      value - The value to be converted into slider progress.
      Returns:
      The slider progress according to the supplied value.
    • getValueFromProgress

      public int getValueFromProgress()
      Returns the preference value according to the slider progress.
      Returns:
      The preference value according to the slider progress.