当前位置: 首页>>代码示例>>Java>>正文


Java MaterialDialog.SingleButtonCallback方法代码示例

本文整理汇总了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();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:23,代码来源:DialogManager.java

示例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);
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:17,代码来源:DialogHelper.java

示例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();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:21,代码来源:DialogManager.java

示例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;
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:8,代码来源:MaterialStyledDialog.java

示例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();
}
 
开发者ID:h4h13,项目名称:RetroMusicPlayer,代码行数:12,代码来源:TaggerUtils.java

示例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();
}
 
开发者ID:Nulltilus,项目名称:Appmatic-Android,代码行数:28,代码来源:MainActivity.java

示例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;
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:8,代码来源:MaterialStyledDialog.java

示例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;
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:8,代码来源:MaterialStyledDialog.java

示例9: onPositive

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public Builder onPositive(@NonNull MaterialDialog.SingleButtonCallback callback) {
    this.positiveCallback = callback;
    return this;
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:6,代码来源:MaterialStyledDialog.java

示例10: newInstance

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static ProfileDialog newInstance(MaterialDialog.SingleButtonCallback buttonCallback) {
    callback = buttonCallback;
    return new ProfileDialog();
}
 
开发者ID:jumaallan,项目名称:AndelaTrackChallenge,代码行数:5,代码来源:ProfileDialog.java

示例11: onNegative

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public Builder onNegative(@NonNull MaterialDialog.SingleButtonCallback callback) {
    this.negativeCallback = callback;
    return this;
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:6,代码来源:MaterialStyledDialog.java

示例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);
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:10,代码来源:IBuilder.java

示例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);
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:8,代码来源:IBuilder.java

示例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);
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:8,代码来源:IBuilder.java

示例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);
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:11,代码来源:IBuilder.java


注:本文中的com.afollestad.materialdialogs.MaterialDialog.SingleButtonCallback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。