本文整理汇总了Java中com.afollestad.materialdialogs.MaterialDialog.show方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDialog.show方法的具体用法?Java MaterialDialog.show怎么用?Java MaterialDialog.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.afollestad.materialdialogs.MaterialDialog
的用法示例。
在下文中一共展示了MaterialDialog.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showFirstRunDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void showFirstRunDialog() {
MaterialDialog frDialog = new MaterialDialog.Builder(this)
.title(getString(R.string.welcome_app_dialog_title))
.content(getString(R.string.welcome_app_text))
.positiveText(getString(R.string.welcome_app_dialog_positive_text))
.cancelable(false)
.autoDismiss(false)
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
Prefs.putBoolean("firstRun", false);
}
})
.build();
frDialog.show();
}
示例2: show500ServerError
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void show500ServerError() {
builder = new MaterialDialog.Builder(mContext)
.title(R.string.all_dialog_server_error)
.content(R.string.all_dialog_try_again)
.positiveText(R.string.all_dialog_positive).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例3: showNoInternetConnectionError
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showNoInternetConnectionError() {
builder = new MaterialDialog.Builder(mContext)
.title(R.string.all_dialog_connection_error_title)
.content(R.string.all_dialog_connection_error_content)
.positiveText(R.string.all_dialog_positive).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例4: showSuccessDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showSuccessDialog() {
builder = new MaterialDialog.Builder(mContext)
.title("Success")
.content("Your listing has been updated!")
.positiveText("Continue").onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
startActivity(new Intent(mContext, NearbyProductsActivity.class));
overridePendingTransition(R.anim.left_out, R.anim.right_in);
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例5: showTimeOutError
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showTimeOutError() {
builder = new MaterialDialog.Builder(mContext)
.title("Timeout Error")
.content("Please check your internet connection and try again.")
.positiveText("Aceptar").onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例6: showSuccessDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showSuccessDialog() {
builder = new MaterialDialog.Builder(mContext)
.title(R.string.view_single_dialog_title_success)
.content(R.string.nearby_dialog_listing_created)
.positiveText(R.string.view_single_dialog_positive_continue).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
startActivity(new Intent(mContext, NearbyProductsActivity.class));
overridePendingTransition(R.anim.left_out, R.anim.right_in);
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例7: showRequiredImagesDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showRequiredImagesDialog() {
builder = new MaterialDialog.Builder(mContext)
.title(R.string.new_item_dialog_title_missing_image)
.content(R.string.new_item_dialog_content_missing_image)
.positiveText(R.string.all_dialog_positive).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例8: showTimeOutError
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showTimeOutError() {
builder = new MaterialDialog.Builder(mContext)
.title(R.string.all_dialog_timeout_error_title)
.content(R.string.all_dialog_timeout_error_content)
.positiveText(R.string.all_dialog_positive).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例9: showNetworkError
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showNetworkError() {
builder = new MaterialDialog.Builder(mContext)
.title(R.string.all_dialog_network_error_title)
.content(R.string.all_dialog_timeout_error_content)
.positiveText(R.string.all_dialog_positive).onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
});
dialog = builder.build();
dialog.show();
dialog.setCanceledOnTouchOutside(false);
}
示例10: showDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override protected void showDialog(Bundle state) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(context)
.title(getDialogTitle())
.icon(getDialogIcon())
.dismissListener(this)
.onAny(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
switch (which) {
default:
MaterialDialogPreference.this.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
break;
case NEUTRAL:
MaterialDialogPreference.this.onClick(dialog, DialogInterface.BUTTON_NEUTRAL);
break;
case NEGATIVE:
MaterialDialogPreference.this.onClick(dialog, DialogInterface.BUTTON_NEGATIVE);
break;
}
}
})
.positiveText(getPositiveButtonText())
.negativeText(getNegativeButtonText())
.autoDismiss(true); // immediately close the dialog after selection
final View contentView = onCreateDialogView();
if (contentView != null) {
onBindDialogView(contentView);
builder.customView(contentView, false);
} else {
builder.content(getDialogMessage());
}
PrefUtil.registerOnActivityDestroyListener(this, this);
dialog = builder.build();
if (state != null)
dialog.onRestoreInstanceState(state);
dialog.show();
}
示例11: onCreateDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
builder.typeface(TypefaceHelper.getMedium(getActivity()), TypefaceHelper.getRegular(getActivity()));
builder.customView(R.layout.fragment_filter, false);
MaterialDialog dialog = builder.build();
dialog.show();
ButterKnife.bind(this, dialog);
mTitle.setText(mIsMuzei ? R.string.muzei_category : R.string.wallpaper_filter);
mMenuSelect.setOnClickListener(this);
return dialog;
}
示例12: onCreateDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
builder.customView(R.layout.fragment_licenses, false);
builder.typeface(TypefaceHelper.getMedium(getActivity()), TypefaceHelper.getRegular(getActivity()));
builder.title(R.string.about_open_source_licenses);
MaterialDialog dialog = builder.build();
dialog.show();
ButterKnife.bind(this, dialog);
return dialog;
}
示例13: onCreateDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
builder.customView(R.layout.fragment_languages, false);
builder.typeface(TypefaceHelper.getMedium(getActivity()), TypefaceHelper.getRegular(getActivity()));
builder.title(R.string.pref_language_header);
MaterialDialog dialog = builder.build();
dialog.show();
ButterKnife.bind(this, dialog);
return dialog;
}
示例14: onCreateDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
builder.customView(R.layout.fragment_refresh_duration, true);
builder.typeface(TypefaceHelper.getMedium(getActivity()), TypefaceHelper.getRegular(getActivity()));
builder.title(R.string.muzei_refresh_duration);
builder.positiveText(R.string.close);
MaterialDialog dialog = builder.build();
dialog.show();
ButterKnife.bind(this, dialog);
return dialog;
}
示例15: onCreateDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
builder.customView(R.layout.fragment_credits, false);
builder.typeface(TypefaceHelper.getMedium(getActivity()), TypefaceHelper.getRegular(getActivity()));
builder.title(getTitle(mType));
builder.positiveText(R.string.close);
MaterialDialog dialog = builder.build();
dialog.show();
ButterKnife.bind(this, dialog);
return dialog;
}