public final class BottomSheetFragmentDelegate
extends java.lang.Object
implements com.flipboard.bottomsheet.OnSheetDismissedListener
Fragment implementing BottomSheetFragmentInterface.
When using an BottomSheetFragmentDelegate, you should any methods exposed in it rather than the
Fragment method of the same name. This applies to:
onCreate(android.os.Bundle)onAttach(Context)onDetach()getLayoutInflater(Bundle, LayoutInflater)onActivityCreated(Bundle)onStart()onSaveInstanceState(Bundle)onDestroyView()
An Activity can only be linked with one BottomSheetFragmentDelegate instance,
so the instance returned from create(BottomSheetFragmentInterface) should be kept
until the Activity is destroyed.
| Modifier and Type | Method and Description |
|---|---|
static BottomSheetFragmentDelegate |
create(BottomSheetFragmentInterface sheetFragmentInterface) |
void |
dismiss()
Dismiss the fragment and it's bottom sheet.
|
void |
dismissAllowingStateLoss()
Version of
dismiss() that uses FragmentTransaction.commitAllowingStateLoss(). |
com.flipboard.bottomsheet.BottomSheetLayout |
getBottomSheetLayout() |
android.view.LayoutInflater |
getLayoutInflater(android.os.Bundle savedInstanceState,
android.view.LayoutInflater superInflater)
Retrieves the appropriate layout inflater, either the sheet's or the view's super container.
|
void |
onActivityCreated(android.os.Bundle savedInstanceState)
Corresponding onActivityCreated() method
|
void |
onAttach(android.content.Context context)
Corresponding onAttach() method
|
void |
onCreate(android.os.Bundle savedInstanceState)
Corresponding onCreate() method
|
void |
onDestroyView()
Corresponding onDestroyView() method
|
void |
onDetach()
Corresponding onDetach() method
|
void |
onDismissed(com.flipboard.bottomsheet.BottomSheetLayout bottomSheetLayout) |
void |
onSaveInstanceState(android.os.Bundle outState)
Corresponding onSaveInstanceState() method
|
void |
onStart()
Corresponding onStart() method
|
void |
show(android.support.v4.app.FragmentManager manager,
int bottomSheetLayoutId)
DialogFragment-like show() method for displaying this the associated sheet fragment
|
int |
show(android.support.v4.app.FragmentTransaction transaction,
int bottomSheetLayoutId)
DialogFragment-like show() method for displaying this the associated sheet fragment
|
public static BottomSheetFragmentDelegate create(BottomSheetFragmentInterface sheetFragmentInterface)
public void show(android.support.v4.app.FragmentManager manager,
@IdRes
int bottomSheetLayoutId)
manager - FragmentManager instancebottomSheetLayoutId - Resource ID of the BottomSheetLayoutpublic int show(android.support.v4.app.FragmentTransaction transaction,
@IdRes
int bottomSheetLayoutId)
transaction - FragmentTransaction instancebottomSheetLayoutId - Resource ID of the BottomSheetLayoutpublic void dismiss()
public void dismissAllowingStateLoss()
dismiss() that uses FragmentTransaction.commitAllowingStateLoss().
See linked documentation for further details.public void onAttach(android.content.Context context)
context - Context to match the Fragment API, unused.public void onDetach()
public void onCreate(@Nullable
android.os.Bundle savedInstanceState)
savedInstanceState - Instance state, can be null.@CheckResult
public android.view.LayoutInflater getLayoutInflater(android.os.Bundle savedInstanceState,
android.view.LayoutInflater superInflater)
savedInstanceState - Instance state, here to match Fragment API but unused.superInflater - The result of the view's inflater, usually the result of super.getLayoutInflater()public com.flipboard.bottomsheet.BottomSheetLayout getBottomSheetLayout()
BottomSheetLayout.public void onActivityCreated(@Nullable
android.os.Bundle savedInstanceState)
savedInstanceState - Instance state, here to match the Fragment API but unusedpublic void onStart()
public void onSaveInstanceState(android.os.Bundle outState)
outState - The output state, here to match the Fragment API but unusedpublic void onDestroyView()
@CallSuper public void onDismissed(com.flipboard.bottomsheet.BottomSheetLayout bottomSheetLayout)
onDismissed in interface com.flipboard.bottomsheet.OnSheetDismissedListener