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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns 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.booleanChecks whether the splash task is running or notstatic DynamicSplashFragmentnewInstance(int layoutRes) Initialize the new instance of this fragment.voidonCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) voidonViewCreated(View view, Bundle savedInstanceState) voidsetOnSplashListener(DynamicSplashListener dynamicSplashListener) Set the listener to implement the splash screen and to get various callbacks while showing the splash.voidshow()Start the splash background task.voidshow(boolean stop) Start the splash background task.voidstop()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, startPostponedEnterTransitionMethods 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:
onCreatein classDynamicFragment
-
onCreateView
@Nullable public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) - Overrides:
onCreateViewin classFragment
-
onViewCreated
- Overrides:
onViewCreatedin classDynamicFragment
-
getDynamicEnterTransition
Description copied from interface:DynamicTransitionListenerReturns the enter transition used by his listener.- Specified by:
getDynamicEnterTransitionin interfaceDynamicTransitionListener- Overrides:
getDynamicEnterTransitionin classDynamicFragment- Returns:
- The enter transition used by his listener.
- See Also:
-
getDynamicExitTransition
Description copied from interface:DynamicTransitionListenerReturns the exit transition used by his listener.- Specified by:
getDynamicExitTransitionin interfaceDynamicTransitionListener- Overrides:
getDynamicExitTransitionin 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-trueto 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:
trueif 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.
-