public class BottomSheet
extends android.app.Dialog
Dialog 的基础上重新定制了 show() 和 Dialog.hide() 时的动画效果, 使 Dialog 在界面底部升起和降下。
提供了以下两种面板样式:
BottomSheet.BottomListSheetBuilder 生成。BottomSheet.BottomGridSheetBuilder 生成。| Modifier and Type | Class and Description |
|---|---|
static class |
BottomSheet.BottomGridSheetBuilder
生成宫格类型的
BottomSheet 对话框。 |
static class |
BottomSheet.BottomListSheetBuilder
生成列表类型的
BottomSheet 对话框。 |
static interface |
BottomSheet.OnBottomSheetShowListener |
android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnKeyListener, android.content.DialogInterface.OnMultiChoiceClickListener, android.content.DialogInterface.OnShowListener| Constructor and Description |
|---|
BottomSheet(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
dismiss() |
android.view.View |
getContentView() |
protected void |
onCreate(android.os.Bundle savedInstanceState) |
void |
setContentView(int layoutResID) |
void |
setContentView(android.view.View view) |
void |
setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params) |
void |
setOnBottomSheetShowListener(BottomSheet.OnBottomSheetShowListener onBottomSheetShowListener) |
void |
show() |
addContentView, cancel, closeOptionsMenu, create, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, requireViewById, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setTitle, setVolumeControlStream, takeKeyEvents, unregisterForContextMenupublic void setOnBottomSheetShowListener(BottomSheet.OnBottomSheetShowListener onBottomSheetShowListener)
protected void onCreate(android.os.Bundle savedInstanceState)
onCreate in class android.app.Dialogpublic void setContentView(int layoutResID)
setContentView in class android.app.Dialogpublic void setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
setContentView in class android.app.Dialogpublic android.view.View getContentView()
public void setContentView(android.view.View view)
setContentView in class android.app.Dialogpublic void show()
show in class android.app.Dialogpublic void dismiss()
dismiss in interface android.content.DialogInterfacedismiss in class android.app.Dialog