Class DynamicTutorialFragment
java.lang.Object
androidx.fragment.app.Fragment
com.pranavpandey.android.dynamic.support.fragment.DynamicFragment
com.pranavpandey.android.dynamic.support.tutorial.fragment.DynamicTutorialFragment
- All Implemented Interfaces:
ComponentCallbacks
,SharedPreferences.OnSharedPreferenceChangeListener
,View.OnCreateContextMenuListener
,ActivityResultCaller
,MenuProvider
,HasDefaultViewModelProviderFactory
,LifecycleOwner
,ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,ViewPager.OnPageChangeListener
,DynamicLifecycle
,DynamicSearchListener
,DynamicTransitionListener
,Tutorial<DynamicTutorial,
,DynamicTutorialFragment> DynamicProductFlavor
public class DynamicTutorialFragment
extends DynamicFragment
implements Tutorial<DynamicTutorial,DynamicTutorialFragment>
A
DynamicTutorialFragment
with an image, title, subtitle and description that
will be used with the DynamicTutorialActivity
.-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
Fragment.InstantiationException, Fragment.SavedState
Nested classes/interfaces inherited from interface com.pranavpandey.android.dynamic.support.tutorial.Tutorial
Tutorial.Motion<T,
V> -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Fragment argument key to set the dynamic tutorial.static final String
Tutorial key to maintain its state.Fields inherited from class androidx.fragment.app.Fragment
mPreviousWho
Fields inherited from interface com.pranavpandey.android.dynamic.support.tutorial.Tutorial
ADS_NAME_TUTORIAL, ADS_NAME_TUTORIAL_IMAGE, ADS_NAME_TUTORIAL_SUBTITLE, ADS_NAME_TUTORIAL_TITLE, ADS_TUTORIAL_WELCOME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the tutorial view or fragment.Returns the card view of this fragment.int
getColor()
Returns the color used by this tutorial.Returns the text view to show the tutorial description.Returns the enter transition used by his listener.Returns the exit transition used by his listener.Returns the image view to show the tutorial image.Returns the root view of this fragment.Returns the scroll view to show the scrolling content.Returns the text view to show the tutorial subtitle.int
Returns the tint color used by this tutorial.Returns the text view to show the tutorial title.Returns the tutorial object.int
Returns the id for this tutorial.static DynamicTutorialFragment
newInstance
(DynamicTutorial dynamicTutorial) Function to initialize this fragment.void
onColorChanged
(int color, int tintColor) This method will be called when there is a change in the colors of the activity.void
onCreateView
(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) void
onPageScrolled
(int position, float positionOffset, int positionOffsetPixels) void
onPageScrollStateChanged
(int state) void
onPageSelected
(int position) void
onSaveInstanceState
(Bundle outState) void
onSetPadding
(int left, int top, int right, int bottom) This method will be called on setting the padding of the tutorial.void
onViewCreated
(View view, Bundle savedInstanceState) 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, 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, getView, 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
-
Field Details
-
ADS_ARGS_TUTORIAL
Fragment argument key to set the dynamic tutorial.- See Also:
-
ADS_STATE_TUTORIAL
Tutorial key to maintain its state.- See Also:
-
-
Constructor Details
-
DynamicTutorialFragment
public DynamicTutorialFragment()
-
-
Method Details
-
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:
-
onSaveInstanceState
- Overrides:
onSaveInstanceState
in classDynamicFragment
-
onPageScrolled
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) - Specified by:
onPageScrolled
in interfaceViewPager.OnPageChangeListener
-
onPageSelected
public void onPageSelected(int position) - Specified by:
onPageSelected
in interfaceViewPager.OnPageChangeListener
-
onPageScrollStateChanged
public void onPageScrollStateChanged(int state) - Specified by:
onPageScrollStateChanged
in interfaceViewPager.OnPageChangeListener
-
getTutorialId
public int getTutorialId()Description copied from interface:Tutorial
Returns the id for this tutorial.- Specified by:
getTutorialId
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Returns:
- The id of this tutorial.
-
getTutorial
Description copied from interface:Tutorial
Returns the tutorial object.- Specified by:
getTutorial
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Returns:
- The tutorial object.
-
createTutorial
Description copied from interface:Tutorial
Returns the tutorial view or fragment.- Specified by:
createTutorial
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Returns:
- The tutorial view or fragment.
-
getColor
Description copied from interface:Tutorial
Returns the color used by this tutorial.- Specified by:
getColor
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Returns:
- The color used by this tutorial.
-
getTintColor
Description copied from interface:Tutorial
Returns the tint color used by this tutorial.- Specified by:
getTintColor
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Returns:
- The tint color used by this tutorial.
-
onColorChanged
Description copied from interface:Tutorial
This method will be called when there is a change in the colors of the activity.Implement this method to update any views during the transition.
- Specified by:
onColorChanged
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Parameters:
color
- The color used by the tutorial.tintColor
- The tint color used by this tutorial.
-
onSetPadding
public void onSetPadding(int left, int top, int right, int bottom) Description copied from interface:Tutorial
This method will be called on setting the padding of the tutorial.Implement this method to update any views according to the container.
- Specified by:
onSetPadding
in interfaceTutorial<DynamicTutorial,
DynamicTutorialFragment> - Parameters:
left
- The left padding supplied by the container.top
- The top padding supplied by the container.right
- The right padding supplied by the container.bottom
- The bottom padding supplied by the container.
-
getRootView
Returns the root view of this fragment.- Returns:
- The root view of this fragment.
-
getImageView
Returns the image view to show the tutorial image.- Returns:
- The image view to show the tutorial image.
-
getScrollView
Returns the scroll view to show the scrolling content.- Returns:
- The scroll view to show the scrolling content.
-
getCardView
Returns the card view of this fragment.- Returns:
- The card view of this fragment.
-
getTitleView
Returns the text view to show the tutorial title.- Returns:
- The text view to show the tutorial title.
-
getSubtitleView
Returns the text view to show the tutorial subtitle.- Returns:
- The text view to show the tutorial subtitle.
-
getDescriptionView
Returns the text view to show the tutorial description.- Returns:
- The text view to show the tutorial description.