Class AngularNativeFragment
-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.view.View.OnCreateContextMenuListener,androidx.activity.contextaware.ContextAware,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,io.github.angularwave.android.core.bridge.BridgeDestination,io.github.angularwave.android.navigation.destinations.AngularNativeDestination
public abstract class AngularNativeFragment extends Fragment implements AngularNativeDestination
The base class from which all "standard" native Fragments (non-dialogs) in a WebNavigation-driven app should extend from.
For web fragments, refer to AngularNativeWebFragment.
-
-
Field Summary
Fields Modifier and Type Field Description private final Navigatornavigatorpublic final StringmPreviousWhoprivate final Lifecyclelifecycleprivate final ViewModelStoreviewModelStoreprivate final ViewModelProvider.FactorydefaultViewModelProviderFactoryprivate final CreationExtrasdefaultViewModelCreationExtrasprivate final SavedStateRegistrysavedStateRegistryprivate final Fragmentfragmentprivate final Stringlocationprivate final HashMap<String, Object>pathPropertiesprivate final AngularNativeFragmentViewModelfragmentViewModelprivate final BooleanisActiveprivate final BooleanisModal
-
Constructor Summary
Constructors Constructor Description AngularNativeFragment()
-
Method Summary
Modifier and Type Method Description NavigatorgetNavigator()Gets the navigator instance associated with this destination. UnitonCreate(Bundle savedInstanceState)UnitonViewCreated(View view, Bundle savedInstanceState)final UnitonActivityCreated(Bundle savedInstanceState)This is marked finalto prevent further use, as it's now deprecated in AndroidX's Fragment implementation.final UnitonActivityResult(Integer requestCode, Integer resultCode, Intent intent)This is marked finalto prevent further use, as it's now deprecated in AndroidX's Fragment implementation.UnitonStart()UnitonStop()UnitprepareNavigation(Function0<Unit> onReady)UnitonStartAfterModalResult(SessionModalResult result)Called when the Fragment has been started again after receiving a modal result. UnitonStartAfterDialogCancel()Called when the Fragment has been started again after a dialog has been dismissed/canceled and no result is passed back. UnitonBeforeNavigation()Called before any navigation action takes places. Unitrefresh(Boolean displayProgress)Refresh the destination's contents. ToolbartoolbarForNavigation()Gets the Toolbar instance in your Fragment's view for use with navigation. final AngularNativeFragmentDelegatedelegate()Gets the delegate instance that handles the Fragment's lifecycle events. -
Methods inherited from class androidx.fragment.app.Fragment
addOnContextAvailableListener, 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, hasOptionsMenu, hashCode, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onViewStateRestored, peekAvailableContext, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, removeOnContextAvailableListener, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, 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 -
Methods inherited from class io.github.angularwave.android.navigation.destinations.AngularNativeDestination
activityPermissionResultLauncher, activityResultLauncher, bridgeWebViewIsReady, cancelNativeActivity, cancelNativePermission, customNavigationOptions, customNavigatorForNavigation, customRouteDecision, getFragment, getFragmentViewModel, getLocation, getPathProperties, isActive, isModal, launchNativeActivity, launchNativePermission, shouldObserveTitleChanges -
Methods inherited from class io.github.angularwave.android.core.bridge.BridgeDestination
onBridgeComponentInitialized -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getNavigator
Navigator getNavigator()
Gets the navigator instance associated with this destination.
-
onViewCreated
Unit onViewCreated(View view, Bundle savedInstanceState)
-
onActivityCreated
final Unit onActivityCreated(Bundle savedInstanceState)
This is marked
finalto prevent further use, as it's now deprecated in AndroidX's Fragment implementation.Use onViewCreated for code touching the Fragment's view and onCreate for other initialization.
-
onActivityResult
final Unit onActivityResult(Integer requestCode, Integer resultCode, Intent intent)
This is marked
finalto prevent further use, as it's now deprecated in AndroidX's Fragment implementation.Use registerForActivityResult with the appropriate androidx.activity.result.contract.ActivityResultContract and its callback.
WebNavigation provides the AngularNativeDestination.activityResultLauncher interface to obtain registered result launchers from any destination.
-
prepareNavigation
Unit prepareNavigation(Function0<Unit> onReady)
-
onStartAfterModalResult
Unit onStartAfterModalResult(SessionModalResult result)
Called when the Fragment has been started again after receiving a modal result. Will navigate if the result indicates it should.
-
onStartAfterDialogCancel
Unit onStartAfterDialogCancel()
Called when the Fragment has been started again after a dialog has been dismissed/canceled and no result is passed back.
-
onBeforeNavigation
Unit onBeforeNavigation()
Called before any navigation action takes places. This is a useful place for state cleanup in your Fragment if necessary.
-
refresh
Unit refresh(Boolean displayProgress)
Refresh the destination's contents.
- Parameters:
displayProgress- Whether progress should be displayed while refreshing.
-
toolbarForNavigation
Toolbar toolbarForNavigation()
Gets the Toolbar instance in your Fragment's view for use with navigation. The title in the Toolbar will automatically be updated if a title is available. By default, WebNavigation will look for a Toolbar with resource ID
R.id.toolbar. Override to provide a Toolbar instance with a different ID.
-
delegate
final AngularNativeFragmentDelegate delegate()
Gets the delegate instance that handles the Fragment's lifecycle events.
-
-
-
-