public abstract class UniversiFragment extends ActionBarFragment
ActionBarFragment implementation that provides Universi context features via
UniversiFragmentDelegate including other features described below.
requestBindData()
need to be called. This method can be invoked from any thread. If data binding request has
been registered, UniversiFragment will invoke onBindData() method whenever its view
hierarchy is already created or waits until it is created.
Marshmallow Android version. Permissions related methods like
checkSelfPermission(String) or supportRequestPermissions(String[], int) can be
invoked regardless of current Android version.ActionBarFragment.ActionModeCallback| Constructor and Description |
|---|
UniversiFragment() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
checkSelfPermission(String permission)
Delegated call to
ContextCompat.checkSelfPermission(Context, String). |
protected boolean |
dismissDialogWithId(int dialogId)
Dismisses a dialog that is provided by the current dialog factory under the specified dialogId.
|
protected boolean |
dismissXmlDialog(int resId)
Dismisses an Xml dialog that has been shown via
showXmlDialog(int, DialogOptions). |
protected DialogController |
getDialogController()
Returns the controller that can be used to show and dismiss dialogs within context of this
fragment.
|
protected DialogFactory |
getDialogFactory()
Returns the current dialog factory specified for this fragment.
|
protected boolean |
isActiveNetworkConnected()
Checks whether the current active network is at this time connected or not.
|
protected boolean |
isNetworkConnected(int networkType)
Checks whether a network with the specified networkType is at this time connected
or no.
|
protected void |
onBindData()
Invoked due to call to
requestBindData() to perform data binding specific for this
fragment instance. |
protected void |
onBindViews(android.view.View rootView,
android.os.Bundle savedInstanceState)
Invoked from
onViewCreated(View, Bundle) to bind all views presented within context
of this fragment. |
void |
onDestroyView() |
void |
onPause() |
void |
onRequestPermissionsResult(int requestCode,
String[] permissions,
int[] grantResults) |
void |
onResume() |
void |
onSaveInstanceState(android.os.Bundle state) |
void |
onViewCreated(android.view.View view,
android.os.Bundle savedInstanceState) |
protected void |
requestBindData()
Requests performing of data binding specific for this fragment via
onBindData(). |
protected void |
setDialogController(DialogController controller)
Sets a controller that should be used to show and dismiss dialogs within context of this fragment.
|
protected void |
setDialogFactory(DialogFactory factory)
Specifies a factory that should provide dialog instances for
DialogController of
this fragment to show. |
protected void |
setDialogXmlFactory(int xmlDialogsSet)
Specifies a factory that should provide dialog instances that can be parsed from an Xml file
with the specified xmlDialogsSet for
DialogController of this fragment. |
boolean |
shouldShowRequestPermissionRationale(String permission) |
protected boolean |
showDialogWithId(int dialogId)
Same as
showDialogWithId(int, DialogOptions) with null options. |
protected boolean |
showDialogWithId(int dialogId,
DialogOptions options)
Shows a dialog that is provided by the current dialog factory under the specified dialogId.
|
protected boolean |
showXmlDialog(int resId)
Same as
showXmlDialog(int, DialogOptions) with null options. |
protected boolean |
showXmlDialog(int resId,
DialogOptions options)
Like
showDialogWithId(int, DialogOptions), but in this case will be used internal
instance of DialogXmlFactory to create (inflate) the desired dialog instance to be
shown. |
protected void |
supportRequestPermissions(String[] permissions,
int requestCode)
Invokes
Fragment.requestPermissions(String[], int) on Android versions above Marshmallow
(including). |
finishActionMode, getActionBar, getActionBarDelegate, getActionMode, getAnnotationHandler, getSupportActionBar, invalidateActionBar, isActionBarAvailable, isInActionMode, onActionModeFinished, onActionModeStarted, onActivityCreated, onBackPress, onCreate, onCreateOptionsMenu, startActionMode, startActionModedispatchBackPress, dispatchViewClick, getContextTheme, inflateTransition, invalidateOptionsMenu, isAttached, isCreated, isDestroyed, isPaused, isStarted, isStopped, isViewCreated, newInstanceWithArguments, onAttach, onCreateView, onDestroy, onDetach, onStart, onStop, onViewClick, runOnUiThreaddump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, 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, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onDestroyOptionsMenu, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onViewStateRestored, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireContext, requireFragmentManager, requireHost, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenuprotected void setDialogController(@Nullable
DialogController controller)
controller - The desired controller. May be null to use the default one.getDialogController()@NonNull protected DialogController getDialogController()
If not specified, instance of DialogController is instantiated by default.
setDialogController(DialogController)protected void setDialogXmlFactory(@XmlRes
int xmlDialogsSet)
DialogController of this fragment.xmlDialogsSet - Resource id of the desired Xml file containing Xml dialogs that the
factory should provide for this fragment. May be 0 to remove the
current one.protected void setDialogFactory(@Nullable
DialogFactory factory)
DialogController of
this fragment to show.factory - The desired factory. May be null to remove the current one.getDialogFactory(),
showDialogWithId(int),
showDialogWithId(int, DialogOptions)@Nullable protected DialogFactory getDialogFactory()
null if no factory has been specified yet.setDialogFactory(DialogFactory)public void onViewCreated(@NonNull
android.view.View view,
@Nullable
android.os.Bundle savedInstanceState)
onViewCreated in class BaseFragmentprotected void onBindViews(@NonNull
android.view.View rootView,
@Nullable
android.os.Bundle savedInstanceState)
onViewCreated(View, Bundle) to bind all views presented within context
of this fragment.rootView - The root view of this fragment.public void onResume()
onResume in class BaseFragmentprotected void requestBindData()
onBindData().
If this fragment has its view hierarchy already created onBindData() will be invoked
immediately, otherwise will wait until onViewCreated(View, Bundle) is invoked.
This method may be invoked also from a background-thread.
@UiThread protected void onBindData()
requestBindData() to perform data binding specific for this
fragment instance.
This is always invoked on the UI thread.
@CheckResult protected boolean isActiveNetworkConnected()
True if active network is connected, false otherwise.ConnectivityManager.getActiveNetworkInfo(),
NetworkInfo.isConnected(),
isNetworkConnected(int)@CheckResult protected boolean isNetworkConnected(int networkType)
networkType - The desired network type to check for connection.True if the requested network is connected, false otherwise.ConnectivityManager.getNetworkInfo(int),
NetworkInfo.isConnected()@CheckResult
protected int checkSelfPermission(@NonNull
String permission)
ContextCompat.checkSelfPermission(Context, String).permission - The desired permission for which to perform check.PackageManager.PERMISSION_GRANTED if you have the
permission, or PackageManager.PERMISSION_DENIED if not.@CheckResult
public boolean shouldShowRequestPermissionRationale(@NonNull
String permission)
shouldShowRequestPermissionRationale in class androidx.fragment.app.Fragmentprotected void supportRequestPermissions(@NonNull
String[] permissions,
int requestCode)
Fragment.requestPermissions(String[], int) on Android versions above Marshmallow
(including).
Calling this method on Android versions before MARSHMALLOW will be ignored.
permissions - The desired set of permissions to request.requestCode - Code to identify this request in onRequestPermissionsResult(int, String[], int[]).public void onRequestPermissionsResult(int requestCode,
@NonNull
String[] permissions,
@NonNull
int[] grantResults)
onRequestPermissionsResult in class androidx.fragment.app.Fragmentprotected boolean showDialogWithId(int dialogId)
showDialogWithId(int, DialogOptions) with null options.protected boolean showDialogWithId(int dialogId,
@Nullable
DialogOptions options)
dialogId - Id of the desired dialog to show.options - Options for the dialog.True if dialog has been shown, false if this fragment is currently
paused or does not have its dialog factory specified.DialogController.newRequest(int),
setDialogFactory(DialogFactory),
dismissDialogWithId(int)protected boolean dismissDialogWithId(int dialogId)
dialogId - Id of the desired dialog to dismiss.True if dialog has been dismissed, false if this fragment is currently
paused or does not have its dialog factory specified.DialogController.newRequest(int),
showDialogWithId(int, DialogOptions)protected boolean showXmlDialog(@XmlRes
int resId)
showXmlDialog(int, DialogOptions) with null options.protected boolean showXmlDialog(@XmlRes
int resId,
@Nullable
DialogOptions options)
showDialogWithId(int, DialogOptions), but in this case will be used internal
instance of DialogXmlFactory to create (inflate) the desired dialog instance to be
shown.resId - Resource id of Xml file containing the desired dialog (its specification) to show.options - Options for the dialog.True if dialog has been successfully inflated and shown, false if
this fragment is currently paused or dialog failed to be inflated.DialogXmlFactory.createDialog(int, DialogOptions),
dismissXmlDialog(int)protected boolean dismissXmlDialog(@XmlRes
int resId)
showXmlDialog(int, DialogOptions).resId - Resource id of Xml file containing the desired dialog (its specification) to dismiss.True if dialog has been dismissed, false if this fragment is currently
paused.showXmlDialog(int, DialogOptions)public void onSaveInstanceState(@NonNull
android.os.Bundle state)
onSaveInstanceState in class androidx.fragment.app.Fragmentpublic void onPause()
onPause in class BaseFragmentpublic void onDestroyView()
onDestroyView in class androidx.fragment.app.Fragment