本文整理汇总了Java中android.support.design.widget.BottomSheetDialog.setCanceledOnTouchOutside方法的典型用法代码示例。如果您正苦于以下问题:Java BottomSheetDialog.setCanceledOnTouchOutside方法的具体用法?Java BottomSheetDialog.setCanceledOnTouchOutside怎么用?Java BottomSheetDialog.setCanceledOnTouchOutside使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.design.widget.BottomSheetDialog
的用法示例。
在下文中一共展示了BottomSheetDialog.setCanceledOnTouchOutside方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildBottomSheet
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void buildBottomSheet(ConfigBean bean) {
final BottomSheetDialog dialog = new BottomSheetDialog(bean.context);
dialog.setContentView(bean.customView);
dialog.setCancelable(bean.cancelable);
dialog.setCanceledOnTouchOutside(bean.outsideTouchable);
bean.dialog = dialog;
}
示例2: onAddWallet
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void onAddWallet() {
AddWalletView addWalletView = new AddWalletView(this);
addWalletView.setOnNewWalletClickListener(this);
addWalletView.setOnImportWalletClickListener(this);
dialog = new BottomSheetDialog(this);
dialog.setContentView(addWalletView);
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.show();
}
示例3: buildBottomSheet
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void buildBottomSheet(ConfigBean bean) {
final BottomSheetDialog dialog = new BottomSheetDialog(bean.context);
Tool.removeFromParent(bean.customView);
dialog.setContentView(bean.customView);
bean.forceWidthPercent = 1.0f;
dialog.setCancelable(bean.cancelable);
dialog.setCanceledOnTouchOutside(bean.outsideTouchable);
bean.dialog = dialog;
}
示例4: handleShareWithBottomSheets
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void handleShareWithBottomSheets(@NonNull final Activity activity, @NonNull
BottomSheetDialog
shareDialog, @NonNull final Intent shareIntent) {
List<ActionMenuItem> menus = new ArrayList<>();
shareDialog.setCanceledOnTouchOutside(false);
RecyclerView gridView = ((RecyclerView) shareDialog.findViewById(R.id.recyclerView));
if (gridView == null) {
throw new NullPointerException("you should declare a id named recyclerView in your " +
"bottomSheets layout!");
}
int grid = 4;
gridView.setLayoutManager(new GridLayoutManager(activity, grid));
gridView.setNestedScrollingEnabled(false);
gridView.setFocusable(false);
gridView.setHasFixedSize(true);
int v = DisplayUtil.dp2px(activity, 3);
int h = DisplayUtil.dp2px(activity, 8);
SpaceGridItemDecoration spaceItemDecoration = new SpaceGridItemDecoration(grid, h, v,
h, v);
ShareGridAdapter gridAdapter = new ShareGridAdapter();
gridView.setAdapter(gridAdapter);
gridView.addItemDecoration(spaceItemDecoration);
PackageManager pm = activity.getPackageManager();
final List<ResolveInfo> list = pm.queryIntentActivities(shareIntent, 0);
for (int i = 0; i < list.size(); i++) {
ActionMenuItem item = new ActionMenuItem(activity, 0, i, 0, 0, list.get(i).loadLabel
(pm));
item.setIcon(list.get(i).loadIcon(pm));
menus.add(item);
}
gridAdapter.setClickListener(new OnSampleClickListener<ActionMenuItem>() {
@Override
public void onClick(View view, ActionMenuItem obj) {
ActivityInfo activityInfo = list.get(obj.getItemId()).activityInfo;
ComponentName name = new ComponentName(activityInfo.applicationInfo.packageName,
activityInfo.name);
shareIntent.setComponent(name);
activity.startActivity(shareIntent);
}
});
gridAdapter.setMenuItems(menus);
gridAdapter.notifyDataSetChanged();
shareDialog.show();
}