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


Java BottomSheetDialog.setContentView方法代码示例

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


在下文中一共展示了BottomSheetDialog.setContentView方法的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: 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

示例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;
    }
}
 
开发者ID:zuoni1018,项目名称:CoordinatorLayoutExample-master,代码行数:21,代码来源:BottomSheetActivity.java

示例4: 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

示例5: createBottomSheetDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void createBottomSheetDialog() {
    mBottomSheetDialog = new BottomSheetDialog(getActivity());
    View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_bottom_sheet, null, false);
    mBottomSheetDialog.setContentView(view);

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
    recyclerView.setHasFixedSize(true);
    List<String> list = new ArrayList<>();
    /*for (int i = 0; i < 20; i++) {
        list.add("我是第" + i + "个");
    }*/
    list.add("下载视频");
    list.add("打开文件");
    list.add("取消下载");
    list.add("打开知识地图");
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
    linearLayoutManager.setSmoothScrollbarEnabled(true);
    recyclerView.setLayoutManager(linearLayoutManager);
    ListRecyclerAdapter adapter = new ListRecyclerAdapter(list);
    recyclerView.setAdapter(adapter);

    adapter.setOnItemClickListener(this);
    setBehaviorCallback();
}
 
开发者ID:liuhui19991,项目名称:CloudMusicLH,代码行数:25,代码来源:AnchorRadioFragment.java

示例6: 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

示例7: create

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
public BottomSheetDialog create() {
    final MessageBox messageBox = new MessageBox(context);

    messageBox.setMessage(message);

    final BottomSheetDialog dialog = new BottomSheetDialog(context);
    dialog.setContentView(messageBox);

    if (listener==null){
        listener = new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dialog.hide();
            }
        };
    }
    if (text == null)
        messageBox.setCloseButton(listener);
    else
        messageBox.setActionButton(text, listener);


    return dialog;
}
 
开发者ID:shiburagi,项目名称:Stylish-Widget-for-Android,代码行数:25,代码来源:MessageBoxDialog.java

示例8: 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

示例9: 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

示例10: 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

示例11: onCreateDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    BottomSheetDialog dialog = (BottomSheetDialog) super.onCreateDialog(savedInstanceState);
    View view = View.inflate(getContext(), R.layout.dialog_bottom_sheet, null);
    dialog.setContentView(view);
    mBehavior = BottomSheetBehavior.from((View) view.getParent());
    dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    imPay = (ImageView) view.findViewById(R.id.im_pay);
    return dialog;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:TMVPFragment.java

示例12: buildBottomSheet

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void buildBottomSheet(BuildBean bean) {
    BottomSheetDialog dialog = new BottomSheetDialog(bean.mContext);
    SheetHolder sheetHolder = new SheetHolder(bean.mContext);
    dialog.setContentView(sheetHolder.rootView);
    sheetHolder.assingDatasAndEvents(bean.mContext, bean);
    bean.dialog = dialog;
}
 
开发者ID:weileng11,项目名称:KUtils-master,代码行数:8,代码来源:Buildable.java

示例13: 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

示例14: buildBottomSheet

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void buildBottomSheet(BuildBean bean) {
    BottomSheetDialog dialog = new BottomSheetDialog(bean.mContext);
    SheetHolder sheetHolder = new SheetHolder(bean.mContext, false);
    dialog.setContentView(sheetHolder.rootView);
    sheetHolder.assingDatasAndEvents(bean.mContext, bean);
    bean.dialog = dialog;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:Buildable.java

示例15: showBottomSheetDialog

import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showBottomSheetDialog() {
  BottomSheetDialog dialog = new BottomSheetDialog(this);
  View view = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_list, null);
  RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
  recyclerView.setLayoutManager(new LinearLayoutManager(this));
  recyclerView.setAdapter(new CoordinatorAdapter(this, mTitles));
  dialog.setContentView(view);
  dialog.show();
}
 
开发者ID:liuguoquan727,项目名称:android-study,代码行数:10,代码来源:BottomSheetBehaviorActivity.java


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