-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.DialogInterface.OnCancelListener,android.content.DialogInterface.OnDismissListener,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner
public abstract class SheetFragment extends DialogFragment
This class is the base of all types of sheets. You can implement this class in your own and build your own custom sheet with the already existing features which the base class offers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSheetFragment.Companion
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SheetFragment()
-
Method Summary
Modifier and Type Method Description StringgetDialogTag()ContextgetWindowContext()UnitsetWindowContext(Context windowContext)final Unitstyle(SheetStyle style)Set sheet style. UnitsetStyle(Integer style, Integer theme)Override style to switch between sheet & dialog style. final UnitcancelableOutside(Boolean cancelable)Set if sheet is cancelable outside. final UnitnavigationBarColor(@ColorInt() Integer color)Set the color of the navigation bar. final UnitnavigationBarColorRes(@ColorRes() Integer colorRes)Set the color of the navigation bar. final Unitdraggable(Boolean draggable)Set if bottom-sheet is draggable. final Unitbehavior(Integer behavior)Set the BottomSheetBehavior state. final UnitpeekHeight(Integer peekHeight)Set the peek height. final UnitcornerFamily(Integer cornerFamily)Set the CornerFamily. final UnitcornerRadius(Float cornerRadiusInDp)Set the corner radius in dp. final UnitcornerRadius(@DimenRes() Integer cornerRadiusInDpRes)Set the corner radius in dp. final UnitborderWidth(Float strokeWidthDp)Set the border stroke width final UnitborderWidth(@DimenRes() Integer strokeWidthDpRes)Set the border stroke width final UnitborderColor(Integer strokeColor)Set the border stroke color around the sheet. IntegergetTheme()Override theme to allow auto switch between day & night design. UnitonViewCreated(View view, Bundle savedInstanceState)final IntegergetActualCornerFamily()final FloatgetActualCornerRadius()DialogonCreateDialog(Bundle savedInstanceState)UnitsetupDialog(Dialog dialog, Integer style)UnitonStart()UnitonResume()final Unitshow()Show the sheet. -
Methods inherited from class com.maxkeppeler.sheets.core.SheetFragment
createFragmentContainer, dismiss, dismissAllowingStateLoss, getDialog, getShowsDialog, isCancelable, onAttach, onCancel, onCreate, onDestroyView, onDetach, onDismiss, onFindViewById, onGetLayoutInflater, onHasView, onSaveInstanceState, onStop, onViewStateRestored, performCreateView, requireDialog, setCancelable, setShowsDialog, show, show, showNow -
Methods inherited from class androidx.fragment.app.DialogFragment
callStartTransitionListener, dump, equals, findFragmentByWho, generateActivityResultKey, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getAnimatingAway, getAnimator, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterAnim, getEnterTransition, getEnterTransitionCallback, getExitAnim, getExitTransition, getExitTransitionCallback, getFocusedView, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getNextTransition, getParentFragment, getParentFragmentManager, getPopDirection, getPopEnterAnim, getPopExitAnim, getPostOnViewCreatedAlpha, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getSharedElementSourceNames, getSharedElementTargetNames, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, initState, isAdded, isDetached, isHidden, isHideReplaced, isInBackStack, isInLayout, isMenuVisible, isPostponed, isRemoving, isRemovingParent, isResumed, isStateSaved, isVisible, noteStateNotSaved, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, performActivityCreated, performAttach, performConfigurationChanged, performContextItemSelected, performCreate, performCreateOptionsMenu, performDestroy, performDestroyView, performDetach, performGetLayoutInflater, performLowMemory, performMultiWindowModeChanged, performOptionsItemSelected, performOptionsMenuClosed, performPause, performPictureInPictureModeChanged, performPrepareOptionsMenu, performPrimaryNavigationFragmentChanged, performResume, performSaveInstanceState, performStart, performStop, performViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, restoreChildFragmentState, restoreViewState, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setAnimatingAway, setAnimations, setAnimator, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setFocusedView, setHasOptionsMenu, setHideReplaced, setInitialSavedState, setMenuVisibility, setNextTransition, setOnStartEnterTransitionListener, setPopDirection, setPostOnViewCreatedAlpha, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementNames, 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
-
-
Method Detail
-
getDialogTag
String getDialogTag()
-
getWindowContext
Context getWindowContext()
-
setWindowContext
Unit setWindowContext(Context windowContext)
-
style
final Unit style(SheetStyle style)
Set sheet style.
-
setStyle
Unit setStyle(Integer style, Integer theme)
Override style to switch between sheet & dialog style.
-
cancelableOutside
final Unit cancelableOutside(Boolean cancelable)
Set if sheet is cancelable outside.
-
navigationBarColor
final Unit navigationBarColor(@ColorInt() Integer color)
Set the color of the navigation bar.
-
navigationBarColorRes
final Unit navigationBarColorRes(@ColorRes() Integer colorRes)
Set the color of the navigation bar.
-
draggable
final Unit draggable(Boolean draggable)
Set if bottom-sheet is draggable. Only works with SheetStyle.BOTTOM_SHEET.
-
peekHeight
final Unit peekHeight(Integer peekHeight)
Set the peek height.
-
cornerFamily
final Unit cornerFamily(Integer cornerFamily)
Set the CornerFamily. Overrides the style default.
-
cornerRadius
final Unit cornerRadius(Float cornerRadiusInDp)
Set the corner radius in dp. Overrides the style default.
-
cornerRadius
final Unit cornerRadius(@DimenRes() Integer cornerRadiusInDpRes)
Set the corner radius in dp. Overrides the style default.
-
borderWidth
final Unit borderWidth(Float strokeWidthDp)
Set the border stroke width
-
borderWidth
final Unit borderWidth(@DimenRes() Integer strokeWidthDpRes)
Set the border stroke width
-
borderColor
final Unit borderColor(Integer strokeColor)
Set the border stroke color around the sheet. If no color is set, the primary color is used.
-
onViewCreated
Unit onViewCreated(View view, Bundle savedInstanceState)
-
getActualCornerFamily
final Integer getActualCornerFamily()
-
getActualCornerRadius
final Float getActualCornerRadius()
-
onCreateDialog
Dialog onCreateDialog(Bundle savedInstanceState)
-
setupDialog
Unit setupDialog(Dialog dialog, Integer style)
-
-
-
-