本文整理汇总了Java中com.afollestad.materialdialogs.MaterialDialog.SingleButtonCallback方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDialog.SingleButtonCallback方法的具体用法?Java MaterialDialog.SingleButtonCallback怎么用?Java MaterialDialog.SingleButtonCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.afollestad.materialdialogs.MaterialDialog
的用法示例。
在下文中一共展示了MaterialDialog.SingleButtonCallback方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogSelection
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void createDialogSelection(String title, Collection selection, MaterialDialog.ListCallbackSingleChoice callbackSingleChoice, MaterialDialog.SingleButtonCallback positive, int index){
new MaterialDialog.Builder(mContext)
.title(title)
.items(selection)
.typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF)
.iconRes(app_prefs.isLightTheme()?R.drawable.ic_view_list_black_24dp:R.drawable.ic_view_list_white_24dp)
.buttonRippleColorRes(R.color.colorAccent)
.positiveColorRes(R.color.colorStateBlue)
.negativeColorRes(R.color.colorStateOrange)
.theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK)
.itemsCallbackSingleChoice(index, callbackSingleChoice)
.positiveText(R.string.Apply)
.neutralText(R.string.Cancel)
.onPositive(positive)
.onNeutral(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
})
.show();
}
示例2: showFilenameSuggestingDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static void showFilenameSuggestingDialog(final Context context,
final MaterialDialog.SingleButtonCallback callback,
final MaterialDialog.InputCallback inputCallback, int titleResId) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(context);
builder.title(titleResId)
.negativeText(android.R.string.cancel)
.positiveText(android.R.string.ok)
.content(R.string.enter_filename)
.input("", "", inputCallback)
.onAny(callback);
MaterialDialog show = builder.show();
initFilenameInputDialog(show);
}
示例3: createDialogInput
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
/**
* Creates a dialog to type in text
*/
public void createDialogInput(String header, String content, MaterialDialog.InputCallback callback, MaterialDialog.SingleButtonCallback buttonCallback) {
new MaterialDialog.Builder(mContext)
.positiveText(R.string.Ok)
.negativeText(R.string.Cancel)
//.neutralText(R.string.attach_media)
.autoDismiss(false)
.onAny(buttonCallback)
.buttonRippleColorRes(R.color.colorAccent)
.positiveColorRes(R.color.colorStateBlue)
.negativeColorRes(R.color.colorStateOrange)
.theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK)
.title(header)
.content(content)
.inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_IME_MULTI_LINE | InputType.TYPE_TEXT_FLAG_MULTI_LINE)
.input(mContext.getString(R.string.text_enter_text), null, callback)
.show();
}
示例4: setPositive
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
@Deprecated
public Builder setPositive(String text, MaterialDialog.SingleButtonCallback callback) {
this.positive = text;
this.positiveCallback = callback;
return this;
}
示例5: showChooseDocumentDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static void showChooseDocumentDialog(Context context, MaterialDialog.SingleButtonCallback listener, boolean hasChecked) {
MaterialDialog.Builder builder = new MaterialDialog.Builder(context)
.title(R.string.edit_tags)
.content(hasChecked ? R.string.tag_editor_document_tree_permission_failed : R.string.tag_editor_document_tree_message)
.positiveText(android.R.string.ok)
.onPositive(listener);
if (hasChecked) {
builder.negativeText(android.R.string.cancel);
}
builder.show();
}
示例6: handleInternetError
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void handleInternetError(@Nullable MaterialDialog.SingleButtonCallback onPositiveCallback) {
hideProgress();
if (onPositiveCallback == null) {
onPositiveCallback = new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
showProgress(null, getString(R.string.loading_msg));
mainPresenter.populateApp();
}
};
}
errorDialog = new MaterialDialog.Builder(this)
.title(getString(R.string.connection_error))
.content(getString(R.string.connection_error_msg))
.cancelable(false)
.positiveText(getString(R.string.retry))
.onPositive(onPositiveCallback)
.negativeText(getString(R.string.exit))
.onNegative(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
System.exit(0);
}
})
.show();
}
示例7: setNegative
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
@Deprecated
public Builder setNegative(String text, MaterialDialog.SingleButtonCallback callback) {
this.negative = text;
this.negativeCallback = callback;
return this;
}
示例8: setNeutral
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
@Deprecated
public Builder setNeutral(String text, MaterialDialog.SingleButtonCallback callback) {
this.neutral = text;
this.neutralCallback = callback;
return this;
}
示例9: onPositive
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public Builder onPositive(@NonNull MaterialDialog.SingleButtonCallback callback) {
this.positiveCallback = callback;
return this;
}
示例10: newInstance
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static ProfileDialog newInstance(MaterialDialog.SingleButtonCallback buttonCallback) {
callback = buttonCallback;
return new ProfileDialog();
}
示例11: onNegative
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public Builder onNegative(@NonNull MaterialDialog.SingleButtonCallback callback) {
this.negativeCallback = callback;
return this;
}
示例12: setNegative
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
/**
* Set a negative button for the dialog
*
* @param text for the button
* @param callback action to do
* @deprecated use {{@link #setNegativeText(CharSequence)}, {@link #setNegativeText(int)} and {@link #onNegative(MaterialDialog.SingleButtonCallback)}} instead
* @return this
*/
MaterialStyledDialog.Builder setNegative(String text, MaterialDialog.SingleButtonCallback callback);
示例13: onNeutral
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
/**
* Set a neutral button action for the dialog
*
* @param callback for the button
* @return this
*/
MaterialStyledDialog.Builder onNeutral(@NonNull MaterialDialog.SingleButtonCallback callback);
示例14: onPositive
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
/**
* Set a positive button action for the dialog
*
* @param callback for the button
* @return this
*/
MaterialStyledDialog.Builder onPositive(@NonNull MaterialDialog.SingleButtonCallback callback);
示例15: setNegative
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
/**
* Set a negative button for the dialog
*
* @param text for the button
* @param callback action to do
* @deprecated use {{@link #setNegativeText(CharSequence)}, {@link #setNegativeText(int)} and {@link #onNegative(MaterialDialog.SingleButtonCallback)}} instead
* @return this
*/
MaterialStyledDialog.Builder setNegative(String text,
MaterialDialog.SingleButtonCallback callback);