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
Modifier and TypeFieldDescriptionstatic final long
Constant for permission request delay to update the status accordingly.static final int
Constant for permission max count to request all the permissions at once.static final int
Constant for permission request code to open settings screen.protected final Runnable
Runnable to request the permissions.Fields inherited from class androidx.fragment.app.Fragment
mPreviousWho
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Get the permissions to be requested from the supplied arguments.Get the permissions intent from the supplied arguments.void
Initialize the permissions view according to the requested permissions status.static DynamicPermissionsFragment
newInstance
(Intent permissionsIntent) Initialize the new instance of this fragment.void
void
onCreateMenu
(Menu menu, MenuInflater inflater) onCreateView
(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) boolean
onMenuItemSelected
(MenuItem item) void
onResume()
void
onViewCreated
(View view, Bundle savedInstanceState) boolean
Returns 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, 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_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:
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
-
setHasOptionsMenu
public boolean setHasOptionsMenu()Description copied from class:DynamicFragment
Returns whether to set the options menu for this fragment.- Overrides:
setHasOptionsMenu
in classDynamicFragment
- Returns:
true
if set the options menu for this fragment.- See Also:
-
onCreateMenu
- Specified by:
onCreateMenu
in interfaceMenuProvider
- Overrides:
onCreateMenu
in classDynamicFragment
-
onMenuItemSelected
- Specified by:
onMenuItemSelected
in interfaceMenuProvider
- Overrides:
onMenuItemSelected
in classDynamicFragment
-
onResume
public void onResume()- Overrides:
onResume
in 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.
-