Class DynamicSliderDialog
java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
androidx.appcompat.app.AppCompatDialogFragment
com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicDialogFragment
com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicSliderDialog
- All Implemented Interfaces:
ComponentCallbacks
,DialogInterface.OnCancelListener
,DialogInterface.OnDismissListener
,SharedPreferences.OnSharedPreferenceChangeListener
,View.OnCreateContextMenuListener
,ActivityResultCaller
,HasDefaultViewModelProviderFactory
,LifecycleOwner
,ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,DynamicProductFlavor
- Direct Known Subclasses:
DynamicSizeDialog
A
DynamicDialogFragment
to provide value picker functionality
via DynamicSliderPreference
.-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
Fragment.InstantiationException, Fragment.SavedState
-
Field Summary
Fields inherited from class com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicDialogFragment
ADS_DEFAULT_BUTTON_COLOR
Fields inherited from class androidx.fragment.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL
Fields inherited from class androidx.fragment.app.Fragment
mPreviousWho
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetIcon()
Get the icon used by the slider preference.int
Get the interval used by the slider preference.int
Returns the layout resource for this dialog.int
getMax()
Get the maximum value used by the slider preference.int
getMin()
Get the minimum value used by the slider preference.Get the slider change listener used by this dialog.int
getProgressFromValue
(int value) Returns the slider progress according to the supplied value.Get the slider preference used by this dialog.Get the summary used by the slider preference.getTitle()
Get the title used by the slider preference.getUnit()
Get the unit used by the slider preference.int
getValue()
Get the current value of the slider preference.int
Returns the preference value according to the slider progress.Get the value listener used by this dialog.static DynamicSliderDialog
Initialize the new instance of this fragment.protected DynamicDialog.Builder
onCustomiseBuilder
(DynamicDialog.Builder dialogBuilder, Bundle savedInstanceState) Override this method to customise the dynamic dialog builder before creating the dialog.void
onSaveInstanceState
(Bundle outState) Set the icon used by the slider preference.setInterval
(int interval) Set the interval used by the slider preference.setMax
(int max) Set the maximum value used by the slider preference.setMin
(int min) Set the minimum value used by the slider preference.setOnSliderChangeListener
(DynamicSliderChangeListener<Slider> onSliderChangeListener) Set the slider change listener used by this dialog.setSummary
(String summary) Set the summary used by the slider preference.Set the title used by the slider preference.Set the unit used by the slider preference.setValue
(int value) Set the current value of the slider preference.Set the current value of the slider preference.setValueListener
(DynamicValueListener<Integer> valueListener) Set the value listener used by this dialog.void
showDialog
(FragmentActivity fragmentActivity) Show this dialog fragment and attach it to the supplied activity.Methods inherited from class com.pranavpandey.android.dynamic.support.dialog.fragment.DynamicDialogFragment
finishActivity, getBooleanFromArguments, getBuilder, getButtonColor, getDynamicDialog, getNegativeButtonText, getNeutralButtonText, getOnCancelListener, getOnDismissListener, getOnKeyListener, getOnShowListener, getParcelableFromArguments, getPositiveButtonText, getProductFlavor, getStringFromArguments, isAutoDismiss, isCancelable, isOnSharedPreferenceChangeListener, onCancel, onCreate, onCreateDialog, onCustomiseDialog, onDestroyView, onDismiss, onPause, onResume, onSharedPreferenceChanged, setAutoDismiss, setBuilder, setButtonColor, setIsCancelable, setNegativeButtonText, setNeutralButtonText, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setPositiveButtonText, setResult, setResult, setResult, setResult, showDialog
Methods inherited from class androidx.appcompat.app.AppCompatDialogFragment
setupDialog
Methods inherited from class androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, dismissNow, getDialog, getShowsDialog, getTheme, onActivityCreated, onAttach, onDetach, onGetLayoutInflater, onStart, onStop, onViewStateRestored, requireComponentDialog, requireDialog, setCancelable, setShowsDialog, setStyle, show, show, showNow
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
Field Details
-
TAG
Tag for this dialog fragment.- See Also:
-
-
Constructor Details
-
DynamicSliderDialog
public DynamicSliderDialog()
-
-
Method Details
-
newInstance
Initialize the new instance of this fragment.- Returns:
- An instance of
DynamicSliderDialog
.
-
getLayoutRes
Description copied from class:DynamicDialogFragment
Returns the layout resource for this dialog.- Overrides:
getLayoutRes
in classDynamicDialogFragment
- Returns:
- The layout resource for this dialog.
-
showDialog
Description copied from class:DynamicDialogFragment
Show this dialog fragment and attach it to the supplied activity.- Overrides:
showDialog
in classDynamicDialogFragment
- Parameters:
fragmentActivity
- The fragment activity to attach this dialog fragment.
-
onSaveInstanceState
- Overrides:
onSaveInstanceState
in classDialogFragment
-
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
Get the title used by the slider preference.- Returns:
- The title used by the slider preference.
-
setTitle
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
Get the summary used by the slider preference.- Returns:
- The summary used by the slider preference.
-
setSummary
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
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
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
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
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
Get the slider change listener used by this dialog.- Returns:
- The slider change listener used by this dialog.
-
getValueListener
Get the value listener used by this dialog.- Returns:
- The value listener used by this dialog.
-
getValue
public int getValue()Get the current value of the slider preference.- Returns:
- The current value of the slider preference.
-
setValue
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
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
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.
-