Class DynamicPermissionsFragment
java.lang.Object
androidx.fragment.app.Fragment
com.pranavpandey.android.dynamic.support.fragment.DynamicFragment
com.pranavpandey.android.dynamic.support.permission.fragment.DynamicPermissionsFragment
- All Implemented Interfaces:
ComponentCallbacks,SharedPreferences.OnSharedPreferenceChangeListener,View.OnCreateContextMenuListener,ActivityResultCaller,MenuProvider,HasDefaultViewModelProviderFactory,LifecycleOwner,ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,DynamicLifecycle,DynamicSearchListener,DynamicTransitionListener,DynamicProductFlavor
Base fragment class to show a list of required permissions in a recycler view. It will be used
internally by the
DynamicPermissionsActivity to request or manage permissions.-
Nested Class Summary
Nested classes/interfaces inherited from class androidx.fragment.app.Fragment
Fragment.InstantiationException, Fragment.SavedState -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longConstant for permission request delay to update the status accordingly.static final intConstant for permission max count to request all the permissions at once.static final intConstant for permission request code to open settings screen.protected final RunnableRunnable to request the permissions.Fields inherited from class androidx.fragment.app.Fragment
mPreviousWho -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Get the permissions to be requested from the supplied arguments.Get the permissions intent from the supplied arguments.voidInitialize the permissions view according to the requested permissions status.static DynamicPermissionsFragmentnewInstance(Intent permissionsIntent) Initialize the new instance of this fragment.voidvoidonCreateMenu(Menu menu, MenuInflater inflater) onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) booleanonMenuItemSelected(MenuItem item) voidonResume()voidonViewCreated(View view, Bundle savedInstanceState) booleanReturns whether to set the options menu for this fragment.Methods inherited from class com.pranavpandey.android.dynamic.support.fragment.DynamicFragment
finishActivity, getBooleanFromArguments, getCheckedMenuItemId, getDynamicActivity, getDynamicEnterTransition, getDynamicExitTransition, 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, onDestroy, onDynamicPause, onDynamicResume, onFindView, onMenuClosed, onPause, onPrepareMenu, onRemoveProvider, onSaveInstanceState, onSearchViewCollapsed, onSearchViewExpanded, onSharedPreferenceChanged, onStart, onStartActivityException, postponeEnterTransition, 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, 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_PERMISSIONS_REQUEST_CODE
public static final int ADS_PERMISSIONS_REQUEST_CODEConstant for permission request code to open settings screen.- See Also:
-
ADS_PERMISSIONS_DANGEROUS_MAX_COUNT
public static final int ADS_PERMISSIONS_DANGEROUS_MAX_COUNTConstant for permission max count to request all the permissions at once.- See Also:
-
ADS_PERMISSION_REQUEST_DELAY
public static final long ADS_PERMISSION_REQUEST_DELAYConstant for permission request delay to update the status accordingly.- See Also:
-
mPermissionsRunnable
Runnable to request the permissions.
-
-
Constructor Details
-
DynamicPermissionsFragment
public DynamicPermissionsFragment()
-
-
Method Details
-
newInstance
Initialize the new instance of this fragment.- Parameters:
permissionsIntent- The intent with all the requested permissions and action.- Returns:
- An instance of
DynamicPermissionsFragment.
-
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
-
setHasOptionsMenu
public boolean setHasOptionsMenu()Description copied from class:DynamicFragmentReturns whether to set the options menu for this fragment.- Overrides:
setHasOptionsMenuin classDynamicFragment- Returns:
trueif set the options menu for this fragment.- See Also:
-
onCreateMenu
- Specified by:
onCreateMenuin interfaceMenuProvider- Overrides:
onCreateMenuin classDynamicFragment
-
onMenuItemSelected
- Specified by:
onMenuItemSelectedin interfaceMenuProvider- Overrides:
onMenuItemSelectedin classDynamicFragment
-
onResume
public void onResume()- Overrides:
onResumein classDynamicFragment
-
initPermissions
public void initPermissions()Initialize the permissions view according to the requested permissions status. -
getPermissionsIntent
Get the permissions intent from the supplied arguments.- Returns:
- The permissions intent from the supplied arguments.
-
getPermissions
Get the permissions to be requested from the supplied arguments.- Returns:
- The permissions to be requested from the supplied arguments.
-