Class DynamicSplashFragment
java.lang.Object
androidx.fragment.app.Fragment
com.pranavpandey.android.dynamic.support.fragment.DynamicFragment
com.pranavpandey.android.dynamic.support.splash.fragment.DynamicSplashFragment
- All Implemented Interfaces:
ComponentCallbacks
,SharedPreferences.OnSharedPreferenceChangeListener
,View.OnCreateContextMenuListener
,ActivityResultCaller
,MenuProvider
,HasDefaultViewModelProviderFactory
,LifecycleOwner
,ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,DynamicLifecycle
,DynamicSearchListener
,DynamicTransitionListener
,DynamicProductFlavor
A fragment to display splash before launching the main activity.
It will be used internally by the DynamicSplashActivity
.
-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
Fragment.InstantiationException, Fragment.SavedState
-
Field Summary
Fields inherited from class androidx.fragment.app.Fragment
mPreviousWho
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the background color for this fragment.Returns the enter transition used by his listener.Returns the exit transition used by his listener.Returns listener to implement the splash screen and to get various callbacks while showing the splash.DynamicTask<?,
?, ?> Returns the dynamic task to perform any background operation while showing the splash.getView()
Returns the view used by this fragment.boolean
Checks whether the splash task is running or notstatic DynamicSplashFragment
newInstance
(int layoutRes) Initialize the new instance of this fragment.void
onCreateView
(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) void
onViewCreated
(View view, Bundle savedInstanceState) void
setOnSplashListener
(DynamicSplashListener dynamicSplashListener) Set the listener to implement the splash screen and to get various callbacks while showing the splash.void
show()
Start the splash background task.void
show
(boolean stop) Start the splash background task.void
stop()
Stop the splash background task.Methods inherited from class com.pranavpandey.android.dynamic.support.fragment.DynamicFragment
finishActivity, getBooleanFromArguments, getCheckedMenuItemId, getDynamicActivity, getDynamicReenterTransition, getDynamicReturnTransition, getHostMenu, getIntFromArguments, getNavigationViewId, getParcelableFromArguments, getPostponeTransitionView, getProductFlavor, getSavedInstanceState, getStringFromArguments, getStringFromArguments, getSubtitle, getSystemActivity, getTextWatcher, getTitle, invalidateHostMenu, isAppCompatActivity, isEnableMenu, isForceMenuIcons, isHasMenuProvider, isOnSharedPreferenceChangeListener, isSearchViewExpanded, isSearchViewListenerListener, isSupportActionBar, onAddActivityHeader, onAddMenuProvider, onAdjustEnterReturnTransition, onAdjustExitReenterTransition, onApplyTransitions, onCreateMenu, onDestroy, onDynamicPause, onDynamicResume, onFindView, onMenuClosed, onMenuItemSelected, onPause, onPrepareMenu, onRemoveProvider, onResume, onSaveInstanceState, onSearchViewCollapsed, onSearchViewExpanded, onSharedPreferenceChanged, onStart, onStartActivityException, postponeEnterTransition, setHasOptionsMenu, setHostMenuItemVisible, setMenuVisibility, setResult, setResult, setResult, setResult, startActivity, startActivity, startActivityForResult, startActivityForResult, startMotionActivity, startMotionActivityForResult, startPostponedEnterTransition
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, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onStop, onViewStateRestored, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startIntentSenderForResult, toString, unregisterForContextMenu
-
Constructor Details
-
DynamicSplashFragment
public DynamicSplashFragment()
-
-
Method Details
-
newInstance
Initialize the new instance of this fragment.- Parameters:
layoutRes
- The layout resource for this fragment.- Returns:
- An instance of
DynamicSplashFragment
.
-
onCreate
- Overrides:
onCreate
in classDynamicFragment
-
onCreateView
@Nullable public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) - Overrides:
onCreateView
in classFragment
-
onViewCreated
- Overrides:
onViewCreated
in classDynamicFragment
-
getDynamicEnterTransition
Description copied from interface:DynamicTransitionListener
Returns the enter transition used by his listener.- Specified by:
getDynamicEnterTransition
in interfaceDynamicTransitionListener
- Overrides:
getDynamicEnterTransition
in classDynamicFragment
- Returns:
- The enter transition used by his listener.
- See Also:
-
getDynamicExitTransition
Description copied from interface:DynamicTransitionListener
Returns the exit transition used by his listener.- Specified by:
getDynamicExitTransition
in interfaceDynamicTransitionListener
- Overrides:
getDynamicExitTransition
in classDynamicFragment
- Returns:
- The exit transition used by his listener.
- See Also:
-
getBackgroundColor
Returns the background color for this fragment.- Returns:
- The background color for this fragment.
-
show
public void show(boolean stop) Start the splash background task.- Parameters:
stop
-true
to stop and restart the splash task.
-
show
public void show()Start the splash background task.- See Also:
-
stop
public void stop()Stop the splash background task. -
getSplashTask
Returns the dynamic task to perform any background operation while showing the splash.- Returns:
- The dynamic task to perform any background operation while showing the splash.
-
getView
Returns the view used by this fragment. -
isSplashTaskRunning
public boolean isSplashTaskRunning()Checks whether the splash task is running or not- Returns:
true
if the splash task is running.
-
getOnSplashListener
Returns listener to implement the splash screen and to get various callbacks while showing the splash.- Returns:
- The listener to implement the splash screen.
-