本文整理匯總了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;
}