-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,io.purchasely.views.flows.PLYFlowListener
public final class PLYFlowParentFragment extends Fragment implements PLYFlowListener
Parent fragment that manages the flow of Purchasely paywall presentations. It handles navigation between steps, rendering transitions, and displaying the child fragments depending on the transition type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPLYFlowParentFragment.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PLYFlowParentFragment()
-
Method Summary
Modifier and Type Method Description LifecyclegetLifecycle()ViewModelStoregetViewModelStore()CreationExtrasgetDefaultViewModelCreationExtras()ViewModelProvider.FactorygetDefaultViewModelProviderFactory()final SavedStateRegistrygetSavedStateRegistry()UnitonResume()Called when the fragment is resumed. ViewonCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)UnitonViewCreated(View view, Bundle savedInstanceState)Sets up the initial presentation if provided and listens for future flow step requests. UnitonDestroyView()Clears the fragment result listener when the view is destroyed. UnitonNextStepRequest(String actionId, Boolean isConditional, PLYTransition transition)Handles a flow step request initiated from a component action in a presentation. UnitonCloseRequested(Boolean all)Handles the close click event. PLYPresentationViewonPresentationRequest(Context context, PLYPresentationProperties properties)Called when a child fragment requests to fetch the presentation to be displayed. UnitonPresentationReady(PLYPresentation presentation)Called when a presentation is ready to be displayed. -
Methods inherited from class io.purchasely.views.flows.fragments.PLYFlowParentFragment
callStartTransitionListener, createFragmentContainer, dump, equals, findFragmentByWho, generateActivityResultKey, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getAnimatingAway, getArguments, getChildFragmentManager, getContext, getEnterAnim, getEnterTransition, getEnterTransitionCallback, getExitAnim, getExitTransition, getExitTransitionCallback, getFocusedView, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLoaderManager, getNextTransition, getParentFragment, getParentFragmentManager, getPopDirection, getPopEnterAnim, getPopExitAnim, getPostOnViewCreatedAlpha, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getSharedElementSourceNames, getSharedElementTargetNames, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, hasOptionsMenu, hashCode, initState, isAdded, isDetached, isHidden, isInBackStack, isInLayout, isMenuVisible, isPostponed, isRemoving, isResumed, isStateSaved, isVisible, noteStateNotSaved, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, onViewStateRestored, performActivityCreated, performAttach, performConfigurationChanged, performContextItemSelected, performCreate, performCreateOptionsMenu, performCreateView, performDestroy, performDestroyView, performDetach, performGetLayoutInflater, performLowMemory, performMultiWindowModeChanged, performOptionsItemSelected, performOptionsMenuClosed, performPause, performPictureInPictureModeChanged, performPrepareOptionsMenu, performPrimaryNavigationFragmentChanged, performResume, performSaveInstanceState, performStart, performStop, performViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, restoreChildFragmentState, restoreViewState, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setAnimations, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setFocusedView, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setNextTransition, setPopDirection, setPostOnViewCreatedAlpha, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementNames, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getLifecycle
@NonNull() Lifecycle getLifecycle()
-
getViewModelStore
@NonNull() ViewModelStore getViewModelStore()
-
getDefaultViewModelCreationExtras
@NonNull()@CallSuper() CreationExtras getDefaultViewModelCreationExtras()
-
getDefaultViewModelProviderFactory
@NonNull() ViewModelProvider.Factory getDefaultViewModelProviderFactory()
-
getSavedStateRegistry
@NonNull() final SavedStateRegistry getSavedStateRegistry()
-
onResume
Unit onResume()
Called when the fragment is resumed. Used to restore the current flow state when returning from a screen outside the flow. Ensures the flow stays up-to-date when the user navigates back to it.
-
onCreateView
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onViewCreated
Unit onViewCreated(View view, Bundle savedInstanceState)
Sets up the initial presentation if provided and listens for future flow step requests.
-
onDestroyView
Unit onDestroyView()
Clears the fragment result listener when the view is destroyed.
-
onNextStepRequest
Unit onNextStepRequest(String actionId, Boolean isConditional, PLYTransition transition)
Handles a flow step request initiated from a component action in a presentation. The presentation for the next step is resolved internally using the flow and actionId.
- Parameters:
actionId- The action triggering the transition.isConditional- Indicates if the action is conditional.transition- The transition to be applied when navigating to the next step, including animation, background color, and height (if applicable).
-
onCloseRequested
Unit onCloseRequested(Boolean all)
Handles the close click event. If
allis true, the entire flow is closed and the activity finishes otherwise, the event is handled as a back press.- Parameters:
all- If true, the entire flow is closed and the activity finishes.
-
onPresentationRequest
PLYPresentationView onPresentationRequest(Context context, PLYPresentationProperties properties)
Called when a child fragment requests to fetch the presentation to be displayed.
- Parameters:
context- The context of the current activity.properties- The presentation properties to be used for fetching the presentation.
-
onPresentationReady
Unit onPresentationReady(PLYPresentation presentation)
Called when a presentation is ready to be displayed.
- Parameters:
presentation- The PLYPresentation that is ready to be displayed.
-
-
-
-