Class AbstractSelectionDialog<T>
java.lang.Object
android.app.Fragment
android.app.DialogFragment
com.castlabs.sdk.playerui.dialogs.AbstractSelectionDialog<T>
- Type Parameters:
T
- The source type
- All Implemented Interfaces:
ComponentCallbacks
,ComponentCallbacks2
,DialogInterface.OnCancelListener
,DialogInterface.OnClickListener
,DialogInterface.OnDismissListener
,View.OnCreateContextMenuListener
- Direct Known Subclasses:
AudioTrackSelectionDialogFragment
,ScalingModeSelectionDialogFragment
,SubtitleSelectionDialogFragment
,VideoQualitySelectionDialogFragment
,VideoTrackSelectionDialogFragment
public abstract class AbstractSelectionDialog<T>
extends DialogFragment
implements DialogInterface.OnClickListener
This is a base class for utility selection dialogs that can be used to show and apply a selection
if items. Subclasses can set the player view reference explicitly when instance are created, but
for better compatibility with the fragment system, we encourage you to let the
hosting Activity implement
PlayerViewProvider
. That way dialogs can be recreated by
by the system and will still be able to resolve the player view to apply selections.-
Nested Class Summary
Nested classes/interfaces inherited from class android.app.Fragment
Fragment.InstantiationException, Fragment.SavedState
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The argument key to store if disabling is allowed and an extra item will be displayed at the top of the liststatic final String
The argument key to store the itemsstatic final String
The argument key to store the currently selected itemstatic final String
The argument key for the dialog titleFields inherited from class android.app.DialogFragment
STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf the parent activity implementsPlayerViewProvider
, the provider is used to return the player view, otherwise this returns theIPlayerView
instance that is bound to this dialog.void
onClick
(DialogInterface dialog, int which) onCreateDialog
(Bundle savedInstanceState) void
setPlayerView
(IPlayerView playerView) Set the player view referenceMethods inherited from class android.app.DialogFragment
dismiss, dismissAllowingStateLoss, dump, getDialog, getShowsDialog, getTheme, isCancelable, onActivityCreated, onAttach, onCancel, onCreate, onDestroyView, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, onStart, onStop, setCancelable, setShowsDialog, setStyle, show, show
Methods inherited from class android.app.Fragment
equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onResume, onTrimMemory, onViewCreated, onViewStateRestored, postponeEnterTransition, registerForContextMenu, requestPermissions, 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
-
ARG_TITLE
The argument key for the dialog title- See Also:
-
ARG_ITEMS
The argument key to store the items- See Also:
-
ARG_SELECTED
The argument key to store the currently selected item- See Also:
-
ARG_ALLOW_DISABLE
The argument key to store if disabling is allowed and an extra item will be displayed at the top of the list- See Also:
-
-
Constructor Details
-
AbstractSelectionDialog
public AbstractSelectionDialog()
-
-
Method Details
-
getPlayerView
If the parent activity implementsPlayerViewProvider
, the provider is used to return the player view, otherwise this returns theIPlayerView
instance that is bound to this dialog.- Returns:
- The player view instance
-
setPlayerView
Set the player view reference- Parameters:
playerView
- The player view reference
-
onCreateDialog
- Overrides:
onCreateDialog
in classDialogFragment
-
onClick
- Specified by:
onClick
in interfaceDialogInterface.OnClickListener
-