本文整理汇总了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();
}
示例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();
}
示例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;
}
}
示例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;
}
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}