本文整理汇总了Java中android.support.design.widget.BottomSheetDialog.setOnDismissListener方法的典型用法代码示例。如果您正苦于以下问题:Java BottomSheetDialog.setOnDismissListener方法的具体用法?Java BottomSheetDialog.setOnDismissListener怎么用?Java BottomSheetDialog.setOnDismissListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.design.widget.BottomSheetDialog
的用法示例。
在下文中一共展示了BottomSheetDialog.setOnDismissListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setupProfileBottomSheet
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void setupProfileBottomSheet() {
View v = LayoutInflater.from(getContext()).inflate(R.layout.stream_profile_preview, null);
mProfileBottomSheet = new BottomSheetDialog(getContext());
mProfileBottomSheet.setContentView(v);
final BottomSheetBehavior behavior = getDefaultBottomSheetBehaviour(v);
mProfileBottomSheet.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
});
TextView mNameView = (TextView) mProfileBottomSheet.findViewById(R.id.twitch_name);
TextView mFollowers = (TextView) mProfileBottomSheet.findViewById(R.id.txt_followers);
TextView mViewers = (TextView) mProfileBottomSheet.findViewById(R.id.txt_viewers);
ImageView mFollowButton = (ImageView) mProfileBottomSheet.findViewById(R.id.follow_unfollow_icon);
ImageView mFullProfileButton = (ImageView) mProfileBottomSheet.findViewById(R.id.full_profile_icon);
RecyclerView mPanelsRecyclerView = (RecyclerView) mProfileBottomSheet.findViewById(R.id.panel_recyclerview);
mNameView.setText(mChannelInfo.getDisplayName());
mFollowers.setText(mChannelInfo.getFollowers() + "");
mViewers.setText(mChannelInfo.getViews() + "");
mFullProfileButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mProfileBottomSheet.dismiss();
final Intent intent = new Intent(getContext(), ChannelActivity.class);
intent.putExtra(getContext().getResources().getString(R.string.channel_info_intent_object), mChannelInfo);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(intent);
}
});
setupFollowButton(mFollowButton);
setupPanels(mPanelsRecyclerView);
}
示例3: onReactivateAccountClicked
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
@Override
public void onReactivateAccountClicked() {
mIsValidationFromDialog = true;
mBottomSheetDialog = new BottomSheetDialog(mContext);
View dialogView = LayoutInflater.from(mContext).inflate(R.layout.dialog_bottom_sheet_reactivate_account, null);
mBottomViews = new ReactivateViews();
ButterKnife.bind(mBottomViews, dialogView);
mInteractor.validateReactivateForms(mBottomViews.loginEmailEdit, mBottomViews.loginPasswordEdit, this);
mBottomViews.loginGoogleButton.setSize(SignInButton.SIZE_STANDARD);
mBottomViews.loginGoogleButton.setScopes(mGso.getScopeArray());
mBottomViews.filterButton.setOnClickListener(v -> {
requestReactivateNormalAccount();
});
mBottomViews.loginGoogleButton.setOnClickListener(v -> {
googleLoginClicked();
});
mBottomViews.loginFacebookButton.setOnClickListener(v -> {
facebookLoginClicked();
});
mBottomSheetDialog.setContentView(dialogView);
mBottomViews.bottomSheet.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
BottomSheetBehavior mBehavior = BottomSheetBehavior.from((View) dialogView.getParent());
mBehavior.setPeekHeight(mBottomViews.bottomSheet.getMeasuredHeight() + 200);
mBottomSheetDialog.setOnDismissListener(dialog -> {
mIsValidationFromDialog = false;
});
mBottomSheetDialog.show();
}
示例4: riwayatDetail
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
public void riwayatDetail() {
View v = getLayoutInflater().inflate(R.layout.riwayat_detail, null);
TextView resi = (TextView) v.findViewById(R.id.nomor_resi);
resi.setText("No Resi : " + bind.getString("resi"));
RecyclerView recyclerView = (RecyclerView) v.findViewById(R.id.list_riwayat);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(Detail.this));
if (d_PENGIRIM.equals("POS")) {
recyclerView.setAdapter(new RiwayatAdapterPOS(list));
} else if (d_PENGIRIM.equals("JNE")) {
recyclerView.setAdapter(new RiwayatAdapterJNE(list));
} else {
recyclerView.setAdapter(new RiwayatAdapterTIKI(list));
}
sheetDialog = new BottomSheetDialog(this);
sheetDialog.setContentView(v);
sheetDialog.show();
sheetDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
sheetDialog = null;
}
});
}
示例5: showFilterBottomSheetDialog
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showFilterBottomSheetDialog() {
mIsFiltered = false;
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mContext);
View dialogView = LayoutInflater.from(mContext).inflate(R.layout.dialog_bottom_sheet_filter, null);
FilterViews bottomViews = new FilterViews();
ButterKnife.bind(bottomViews, dialogView);
mCurrentFilterTitle = bottomViews.filterTitle;
updateCurrentFilterTitle();
bottomViews.redeAtendimentoSpinner.setAdapter(getRedeAtendimentoAdapter());
bottomViews.categoriaSpinner.setAdapter(getCategoriaSpinner());
RxAdapterView.itemSelections(bottomViews.redeAtendimentoSpinner).subscribe(integer -> {
doFilter(bottomViews);
});
RxAdapterView.itemSelections(bottomViews.categoriaSpinner).subscribe(integer -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.vinculoSusCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.atendimentoUrgencialCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.atendimentoAmbulatorialCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.centroCirurgicoCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.obstetraCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.neoNatalCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
RxCompoundButton.checkedChanges(bottomViews.dialiseCheckbox).subscribe(isChecked -> {
doFilter(bottomViews);
});
bottomViews.filterButton.setOnClickListener(view -> {
mIsFiltered = true;
mInteractor.clearMarkers(mMap);
showMapPins(mFilteredEstablishmentList);
mInteractor.animateCameraToAllEstablishments(mMap);
bottomSheetDialog.dismiss();
});
bottomSheetDialog.setContentView(dialogView);
bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet)
.setBackgroundResource(R.color.default_dialog_background);
dialogView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
BottomSheetBehavior mBehavior = BottomSheetBehavior.from((View) dialogView.getParent());
mBehavior.setPeekHeight((int) (mView.getMapContainerHeight() + 400));
bottomSheetDialog.setOnDismissListener(dialogInterface -> {
if (!mIsFiltered) {
mFilteredEstablishmentList.clear();
mFilteredEstablishmentList.addAll(mEstablishmentList);
}
});
bottomSheetDialog.show();
}
示例6: showRemedyBottomDialog
import android.support.design.widget.BottomSheetDialog; //导入方法依赖的package包/类
private void showRemedyBottomDialog(Remedy remedy) {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(mContext);
View dialogView = LayoutInflater.from(mContext).inflate(R.layout.dialog_bottom_sheet_remedy, null);
BottomViews bottomViews = new BottomViews();
ButterKnife.bind(bottomViews, dialogView);
mRemedyProgress = bottomViews.remedyProgress;
bottomViews.priceText.setText("R$ " + String.format(Locale.getDefault(), "%.2f", remedy.getPmc0()) + " a " +
"R$ " + String.format(Locale.getDefault(), "%.2f", remedy.getPmc20()));
bottomViews.establishmentTitle.setText(GenericUtil.capitalize(remedy.getProduto().toLowerCase()));
bottomViews.apresentacaoText.setText(GenericUtil.capitalize(remedy.getApresentacao().toLowerCase()));
bottomViews.classeTerapeuticaText.setText(GenericUtil.capitalize(remedy.getClasseTerapeutica().toLowerCase()));
bottomViews.laboratorioText.setText(GenericUtil.capitalize(remedy.getLaboratorio().toLowerCase()));
bottomViews.principioAtivoText.setText(GenericUtil.capitalize(remedy.getPrincipioAtivo().toLowerCase()));
bottomViews.registroText.setText(remedy.getRegistro());
bottomViews.cnpjText.setText(remedy.getCnpj());
if (remedy.getRestricao().equals("Sim")) {
bottomViews.possuiRestricaoText.setVisibility(View.VISIBLE);
}
bottomViews.likeImage.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.ic_like_filled));
isLiked = true;
bottomViews.likeImage.setOnClickListener(v -> {
mRemedyProgress.setVisibility(View.VISIBLE);
if (isLiked) {
mSubscription.add(mInteractor.requestDisLikeRemedy(Long.valueOf(remedy.getCodBarraEan()))
.observeOn(AndroidSchedulers.mainThread())
.onErrorReturn(throwable -> null)
.subscribe(responseBodyResponse -> {
mRemedyProgress.setVisibility(View.GONE);
if (responseBodyResponse != null && responseBodyResponse.isSuccessful()) {
isLiked = false;
mInteractor.removeDislikedContentCode();
bottomViews.likeImage.setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.ic_like_empty));
} else {
mView.showToast(mContext.getString(R.string.http_error_generic));
}
}));
} else {
requestLikeRemedies(Long.valueOf(remedy.getCodBarraEan()), bottomViews.likeImage);
}
});
bottomSheetDialog.setContentView(dialogView);
bottomSheetDialog.getWindow().findViewById(R.id.design_bottom_sheet)
.setBackgroundResource(R.color.default_dialog_background);
dialogView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
BottomSheetBehavior mBehavior = BottomSheetBehavior.from((View) dialogView.getParent());
mBehavior.setPeekHeight(mView.getRootHeight() - 200);
bottomSheetDialog.setOnDismissListener(dialog -> {
if (mInteractor.getLikedRemedyCount() < mAdapterCountAfterFetching) {
requestFavRemedies();
}
});
bottomSheetDialog.show();
}