Class PTRFragment
-
- 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
public abstract class PTRFragment extends Fragment
Base class for Pointr fragments
Handles the Pointr SDK related flow and safely calls the lifecycle method considering the Pointr SDKs lifecycle.
-
-
Field Summary
Fields Modifier and Type Field Description public final String
mPreviousWho
private final SavedStateRegistry
savedStateRegistry
-
Constructor Summary
Constructors Constructor Description PTRFragment(Integer layoutResourceId)
-
Method Summary
Modifier and Type Method Description View
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Unit
onViewCreated(View view, Bundle savedInstanceState)
Unit
onResume()
Unit
onStop()
final Unit
hideKeyboard()
helper method to easily hide the soft keyboard final Unit
showKeyboard(EditText et)
helper method to easily show the soft keyboard final Unit
toast(@StringRes() Integer stringResId)
helper method to easily show a toast final Unit
toast(String text)
helper method to easily show a toast final Integer
getColor(@ColorRes() Integer colorResId)
helper method to easily retrieve a color resource -
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, hasOptionsMenu, hashCode, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PTRFragment
PTRFragment(Integer layoutResourceId)
-
-
Method Detail
-
onCreateView
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onViewCreated
Unit onViewCreated(View view, Bundle savedInstanceState)
-
hideKeyboard
final Unit hideKeyboard()
helper method to easily hide the soft keyboard
-
showKeyboard
final Unit showKeyboard(EditText et)
helper method to easily show the soft keyboard
- Parameters:
et
- the EditText that should gain the keyboard focus
-
toast
final Unit toast(@StringRes() Integer stringResId)
helper method to easily show a toast
- Parameters:
stringResId
- resource id of the text to toast
-
toast
final Unit toast(String text)
helper method to easily show a toast
- Parameters:
text
- the text to toast
-
-
-
-