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


Java BottomSheetDialog.show方法代码示例

本文整理汇总了Java中android.support.design.widget.BottomSheetDialog.show方法的典型用法代码示例。如果您正苦于以下问题:Java BottomSheetDialog.show方法的具体用法?Java BottomSheetDialog.show怎么用?Java BottomSheetDialog.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.design.widget.BottomSheetDialog的用法示例。


在下文中一共展示了BottomSheetDialog.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureTransitionTime

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
public static void configureTransitionTime(DiscreteScrollView scrollView) {
    final BottomSheetDialog bsd = new BottomSheetDialog(scrollView.getContext());
    final TransitionTimeChangeListener timeChangeListener = new TransitionTimeChangeListener(scrollView);
    bsd.setContentView(R.layout.dialog_transition_time);
    defaultPrefs().registerOnSharedPreferenceChangeListener(timeChangeListener);
    bsd.setOnDismissListener(new DialogInterface.OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            defaultPrefs().unregisterOnSharedPreferenceChangeListener(timeChangeListener);
        }
    });
    bsd.findViewById(R.id.dialog_btn_dismiss).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            bsd.dismiss();
        }
    });
    bsd.show();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:DiscreteScrollViewOptions.java

示例2: onClick

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btnBehavior:
            int state = behavior.getState();
            if (state == BottomSheetBehavior.STATE_EXPANDED) {
                behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
            } else if(state == BottomSheetBehavior.STATE_COLLAPSED){
                behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
            }else if(state == BottomSheetBehavior.STATE_HIDDEN){
                behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
            }
            break;
        case R.id.btnDialog:
            BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
            bottomSheetDialog.setContentView(R.layout.include_bottom_sheet_layout);
            bottomSheetDialog.show();
            break;
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:21,代码来源:BottomSheetActivity.java

示例3: onClick

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btnBehavior:
            int state = behavior.getState();
            if (state == BottomSheetBehavior.STATE_EXPANDED) {
                behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
            } else if(state == BottomSheetBehavior.STATE_COLLAPSED){
                behavior.setState(BottomSheetBehavior.STATE_HIDDEN);
            }else if(state == BottomSheetBehavior.STATE_HIDDEN){
                behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
            }
            break;
        case R.id.btnDialog:
            BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
            bottomSheetDialog.setContentView(R.layout.include_bottom_sheet_layout);
            bottomSheetDialog.show();
            break;
        case R.id.btn_baidumap:
            readyGo(BaiduMapSample.class);
            break;
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:24,代码来源:BottomSheetActivity.java

示例4: initBottomSheetDialog2

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void initBottomSheetDialog2() {
    List<String> mList;
    mList = new ArrayList<>();
    for(int i=0; i<20; i++){
        mList.add("item "+i);
    }

    final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
    //创建recyclerView
    RecyclerView recyclerView = new RecyclerView(this);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    RecyclerAdapter recyclerAdapter = new RecyclerAdapter(mList,this);
    recyclerView.setAdapter(recyclerAdapter);
    recyclerAdapter.setOnItemClickListener(new RecyclerAdapter.OnItemClickListener() {
        @Override
        public void onItemClickListener(View item, int position) {
            Toast.makeText(MainActivity.this, "item "+position, Toast.LENGTH_SHORT).show();
            bottomSheetDialog.dismiss();
        }
    });

    bottomSheetDialog.setContentView(recyclerView);
    bottomSheetDialog.show();
}
 
开发者ID:AweiLoveAndroid,项目名称:BottomSheetDialogDemo,代码行数:27,代码来源:MainActivity.java

示例5: showBSDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showBSDialog() {
    final BottomSheetDialog dialog = new BottomSheetDialog(this);
    View view = LayoutInflater.from(this).inflate(R.layout.dialog_layout, null);
    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.bs_rv);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    SimpleStringRecyclerViewAdapter adapter = new SimpleStringRecyclerViewAdapter(this);
    adapter.setItemClickListener(new SimpleStringRecyclerViewAdapter.ItemClickListener() {
        @Override
        public void onItemClick(int pos) {
            dialog.dismiss();
            Toast.makeText(BottomSheetDialogActivity.this, "pos--->" + pos, Toast.LENGTH_LONG).show();
        }
    });
    recyclerView.setAdapter(adapter);
    dialog.setContentView(view);
    dialog.show();
}
 
开发者ID:REBOOTERS,项目名称:AndroidAnimationExercise,代码行数:18,代码来源:BottomSheetDialogActivity.java

示例6: YBottomSheetDialogView

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
public YBottomSheetDialogView(Context context) {
        bottomDialog = new BottomSheetDialog(context);
        View view = LayoutInflater.from(context).inflate(R.layout.sharelayout, null);

        //取消弹出
        view.findViewById(R.id.cancel_share).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (bottomClickListener != null) {
                    bottomClickListener.cancleShare();
                }
            }
        });

        RecyclerView mRecyView = (RecyclerView) view.findViewById(R.id.srecyview);
        //水平滚动的RecycleView
//        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
        LinearLayoutManager linearLayoutManager = new GridLayoutManager(context, 5, GridLayoutManager.VERTICAL, false);
        mRecyView.setLayoutManager(linearLayoutManager);
        mRecyView.setAdapter(new MyShareAdapter());
        bottomDialog.setContentView(view);
        bottomDialog.show();
    }
 
开发者ID:yihaha,项目名称:YGank,代码行数:24,代码来源:YBottomSheetDialogView.java

示例7: setupBottomSheetDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void setupBottomSheetDialog() {
    mBottomSheetDialog = new BottomSheetDialog(mContext);
    View dialogView = LayoutInflater.from(mContext)
            .inflate(R.layout.dialog_bottom_sheet_profile, null);

    RecyclerView avatarRecycler = (RecyclerView) dialogView.findViewById(R.id.avatar_recycler);
    avatarRecycler.setHasFixedSize(true);
    avatarRecycler.setLayoutManager(new GridLayoutManager(mContext, 3, GridLayoutManager.VERTICAL, false));

    avatarRecycler.setAdapter(new AvatarAdapter(mContext, this));

    mBottomSheetDialog.setContentView(dialogView);

    dialogView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);

    BottomSheetBehavior mBehavior = BottomSheetBehavior.from((View) dialogView.getParent());
    mBehavior.setPeekHeight(dialogView.getMeasuredHeight() + 200);

    mBottomSheetDialog.show();
}
 
开发者ID:matbrandao,项目名称:Saude-no-Mapa,代码行数:21,代码来源:RegisterPresenterImpl.java

示例8: createBottomSheetDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void createBottomSheetDialog(Context context) {
    BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(context);
    mBinding = DiscussViewBinding.inflate(LayoutInflater.from(context), null, false);
    mBinding.setHandler(new Handler());
    View view = mBinding.getRoot();
    bottomSheetDialog.setContentView(view);
    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.discuss_view_recyclerview);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
    linearLayoutManager.setSmoothScrollbarEnabled(true);
    recyclerView.setLayoutManager(linearLayoutManager);
    mAdapter = new DiscussAdapter(mCommentsBeenList, mContext);
    recyclerView.setAdapter(mAdapter);

    loadExtraData(mId);

    if (bottomSheetDialog.isShowing()) {
        bottomSheetDialog.dismiss();
    } else {
        bottomSheetDialog.show();
    }
}
 
开发者ID:wl9739,项目名称:DuDian,代码行数:23,代码来源:DiscussView.java

示例9: showThreadListSettingsDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showThreadListSettingsDialog() {
    final LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    final View view = inflater.inflate(R.layout.dialog_thread_list_settings, null);

    final ValueChagerView valueChagerView = (ValueChagerView) view.findViewById(R.id.value_changer);

    valueChagerView.setCurrentValue(HiSettingsHelper.getInstance().getTitleTextSizeAdj());

    final BottomSheetDialog dialog = new BottomDialog(getActivity());

    valueChagerView.setOnChangeListener(new ValueChagerView.OnChangeListener() {
        @Override
        public void onChange(int currentValue) {
            HiSettingsHelper.getInstance().setTitleTextSizeAdj(currentValue);
            if (mThreadListAdapter != null)
                mThreadListAdapter.notifyDataSetChanged();
        }
    });

    dialog.setContentView(view);
    BottomSheetBehavior mBehavior = BottomSheetBehavior.from((View) view.getParent());
    mBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    dialog.show();
}
 
开发者ID:GreenSkinMonster,项目名称:hipda,代码行数:25,代码来源:ThreadListFragment.java

示例10: showSortDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showSortDialog() {
    mSortDialog = new BottomSheetDialog(this);
    View view = View.inflate(this, R.layout.bottom_menu_content, null);
    RecyclerView itemList = (RecyclerView) view.findViewById(R.id.bottom_list);
    itemList.setLayoutManager(new LinearLayoutManager(this));

    SortTypeAdapter adapter = new SortTypeAdapter(this, columnFields);
    itemList.setAdapter(adapter);

    mSortDialog.setContentView(view);
    mSortDialog.show();
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:13,代码来源:SqlTabDatasActivity.java

示例11: showSelectColumsDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showSelectColumsDialog(final List<String> tablesName, final TextView selectedTxt, final RelativeLayout cloumnLayout, final TextView fkFieldTitle, final TextView fk_field) {
        View view = View.inflate(this, R.layout.bottom_menu_content, null);
        View dividerLine = view.findViewById(R.id.dividerLine);
        dividerLine.setVisibility(View.VISIBLE);
        final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
        RecyclerView itemList = (RecyclerView) view.findViewById(R.id.bottom_list);
        itemList.setLayoutManager(new LinearLayoutManager(this));

        SelectTabOrColumnDialog adapter = new SelectTabOrColumnDialog(this, tablesName);
        itemList.setAdapter(adapter);
        adapter.setMyListener(new SelectTabOrColumnDialog.MyListener() {
            @Override
            public void click(int position) {
                bottomSheetDialog.dismiss();
                String selected = tablesName.get(position);
                if (fk_field != null && !selected.equals(mSelectedTab)) {

                    mSelectedTab = selected;
                    fk_field.setText(null);

                    cloumnLayout.setEnabled(true);
                    cloumnLayout.setClickable(true);
//                    fkFieldTitle.setTextColor(getResources().getColor(SkinHandler.getResourceId(SqlCreateTableActivity.this, R.attr.minorText)));
                }
                selectedTxt.setText(selected);
            }
        });


        bottomSheetDialog.setContentView(view);
        bottomSheetDialog.show();
    }
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:33,代码来源:SqlCreateTableActivity.java

示例12: shouldScriptOptionsDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void shouldScriptOptionsDialog(String url) {
    mUrl = url;
    String fileName = DownloadManager.parseFileNameLocally(url);
    mBottomSheetDialog = new BottomSheetDialog(getContext());
    mBottomSheetDialog.setContentView(new OptionListView.Builder(getContext())
            .title(fileName)
            .item(R.id.save, R.drawable.ic_file_download_black_48dp, R.string.text_download)
            .item(R.id.run, R.drawable.ic_play_arrow_white_48dp, R.string.text_run)
            .bindItemClick(this)
            .build());
    mBottomSheetDialog.show();
}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:13,代码来源:CommunityWebView.java

示例13: onBtnBottomDialogClicked

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
@OnClick(R.id.btn_bottom_dialog)
public void onBtnBottomDialogClicked() {
    WebView webView = new WebView(this);
    webView.loadUrl("https://github.com/jiangkang/KTools");
    webView.getSettings().setJavaScriptEnabled(true);
    BottomSheetDialog dialog = new BottomSheetDialog(this);
    dialog.setCancelable(true);
    dialog.setContentView(webView);
    dialog.show();
}
 
开发者ID:jiangkang,项目名称:KTools,代码行数:11,代码来源:KDialogActivity.java

示例14: showRateDetailDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showRateDetailDialog() {
    BottomSheetDialog dialog = new BottomSheetDialog(this);
    View view = getLayoutInflater().inflate(R.layout.dialog_rate_detail,null);
    ((TextView)view.findViewById(R.id.tv_rating)).setText(data.getRating().getAverage()+"");
    ((RatingBar)view.findViewById(R.id.rb_rating)).setRating((float) (data.getRating().getAverage()/2.0));
    ((TextView)view.findViewById(R.id.tv_rating_people)).setText(data.getRatings_count()+"人评分");

    DecimalFormat df = new DecimalFormat("#.0");

    int total = data.getRating().getDetails().getStar5()+data.getRating().getDetails().getStar4()+data.getRating().getDetails().getStar3()+data.getRating().getDetails().getStar2()+data.getRating().getDetails().getStar1();
    ((TextView)view.findViewById(R.id.tv_rate_5)).setText(df.format(data.getRating().getDetails().getStar5()/(total*1.0)*100)+"%");
    setWidth(view.findViewById(R.id.pb_5),Float.parseFloat(df.format(data.getRating().getDetails().getStar5()/(total*1.0)*100)));

    ((TextView)view.findViewById(R.id.tv_rate_4)).setText(df.format(data.getRating().getDetails().getStar4()/(total*1.0)*100)+"%");
    setWidth(view.findViewById(R.id.pb_4),Float.parseFloat(df.format(data.getRating().getDetails().getStar4()/(total*1.0)*100)));

    ((TextView)view.findViewById(R.id.tv_rate_3)).setText(df.format(data.getRating().getDetails().getStar3()/(total*1.0)*100)+"%");
    setWidth(view.findViewById(R.id.pb_3),Float.parseFloat(df.format(data.getRating().getDetails().getStar3()/(total*1.0)*100)));

    ((TextView)view.findViewById(R.id.tv_rate_2)).setText(df.format(data.getRating().getDetails().getStar2()/(total*1.0)*100)+"%");
    setWidth(view.findViewById(R.id.pb_2),Float.parseFloat(df.format(data.getRating().getDetails().getStar2()/(total*1.0)*100)));

    ((TextView)view.findViewById(R.id.tv_rate_1)).setText(df.format(data.getRating().getDetails().getStar1()/(total*1.0)*100)+"%");
    setWidth(view.findViewById(R.id.pb_1),Float.parseFloat(df.format(data.getRating().getDetails().getStar1()/(total*1.0)*100)));

    dialog.setContentView(view);
    dialog.show();
}
 
开发者ID:lai233333,项目名称:MyDemo,代码行数:29,代码来源:MovieDetailActivity.java

示例15: showMoveBottomSheet

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
@Override
    public void showMoveBottomSheet() {
        final BottomSheetDialog dialog = new BottomSheetDialog(mContext);
//                    获取contentView
        ViewGroup contentView = (ViewGroup) ((ViewGroup) findViewById(android.R.id.content)).getChildAt(0);
        View root = LayoutInflater.from(mContext).inflate(R.layout.bottom_sheet_folder, contentView, false);
        RecyclerView recyclerView = (RecyclerView) root.findViewById(R.id.recycler_bottom_sheet_folder);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        dialog.setContentView(root);

        recyclerView.setAdapter(getBottomSheetRvAdapter(dialog));

        dialog.show();
    }
 
开发者ID:ifadai,项目名称:SuperNote,代码行数:15,代码来源:NoteMainActivity.java


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