当前位置: 首页>>代码示例>>Java>>正文


Java BottomSheetDialog.setCanceledOnTouchOutside方法代码示例

本文整理汇总了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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:MyDialogBuilder.java

示例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();
}
 
开发者ID:TrustWallet,项目名称:trust-wallet-android,代码行数:11,代码来源:WalletsActivity.java

示例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;
}
 
开发者ID:hss01248,项目名称:DialogUtil,代码行数:10,代码来源:DialogViewBuilder.java

示例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();
}
 
开发者ID:didikee,项目名称:CommonDependence,代码行数:48,代码来源:AndroidShareHelper.java


注:本文中的android.support.design.widget.BottomSheetDialog.setCanceledOnTouchOutside方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。