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


Java MaterialDialog.Builder方法代码示例

本文整理汇总了Java中com.afollestad.materialdialogs.MaterialDialog.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDialog.Builder方法的具体用法?Java MaterialDialog.Builder怎么用?Java MaterialDialog.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.afollestad.materialdialogs.MaterialDialog的用法示例。


在下文中一共展示了MaterialDialog.Builder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deletePlaylistDailog

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
/**
 * Delete playlist Dialog
 *
 * @param context
 * @param Playlistname
 */
public static void deletePlaylistDailog(@NonNull Context context, String Playlistname, RefreshPlaylist refreshPlaylist) {
    MaterialDialog.Builder builder = new MaterialDialog.Builder(context);
    builder.title(Playlistname);
    builder.content(R.string.deleteplaylist);
    builder.positiveText(R.string.delete);
    builder.onPositive(new MaterialDialog.SingleButtonCallback() {
        @Override
        public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
            deletePlaylist(context, Playlistname);
            Toast.makeText(context, Playlistname + " Deleted", Toast.LENGTH_SHORT).show();
            refreshPlaylist.refresh();
        }
    });
    builder.typeface(Helper.getFont(context), Helper.getFont(context));
    builder.negativeText(R.string.cancel);
    builder.show();
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:24,代码来源:PlaylistHelper.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: onCreateDialog

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View view = LayoutInflater.from(getActivity()).inflate(R.layout.playlist_picker, new LinearLayout(getActivity()), false);
    rv = (RecyclerView) view.findViewById(R.id.rv);
    btn = (Button) view.findViewById(R.id.create_playlist);
    btn.setVisibility(View.GONE);
    MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity());
    CustomLayoutManager customlayoutmanager = new CustomLayoutManager(getActivity());
    customlayoutmanager.setOrientation(LinearLayoutManager.VERTICAL);
    customlayoutmanager.setSmoothScrollbarEnabled(true);
    rv.setLayoutManager(customlayoutmanager);
    tabAdapter = new RemoveTabAdapter(getActivity(), this);
    ItemTouchHelper.Callback callback = new SimpleItemTouchHelperCallback(tabAdapter);
    mItemTouchHelper = new ItemTouchHelper(callback);
    mItemTouchHelper.attachToRecyclerView(rv);
    List<String> data = new ArrayList<String>();
    data.add("1. Recent");
    data.add("2. Folder");
    data.add("3. Song");
    data.add("4. Album");
    data.add("5. Artist");
    data.add("6.Playlist");
    tabAdapter.addDataList(data);
    rv.setAdapter(tabAdapter);
    builder.title("Tab Remove")
            .autoDismiss(true)
            .positiveText(R.string.okay)
            .onPositive(new MaterialDialog.SingleButtonCallback() {
                @Override
                public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                    dialog.dismiss();
                }
            })
            .customView(view, false);
    return builder.show();
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:38,代码来源:TabRemoveFragment.java

示例4: itemsCallbackMultiChoice

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public MaterialDialog.Builder itemsCallbackMultiChoice(@Nullable Integer[] selectedIndices, final VolatileBox<Integer[]> result) {
    dismissListener(result);
    super.itemsCallbackMultiChoice(selectedIndices, new ListCallbackMultiChoice() {
        @Override
        public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) {
            result.setAndNotify(which);
            return true;
        }
    });
    return this;
}
 
开发者ID:feifadaima,项目名称:https-github.com-hyb1996-NoRootScriptDroid,代码行数:12,代码来源:BlockedMaterialDialog.java

示例5: newSimpleProgressLoadingBuilder

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
protected static MaterialDialog.Builder newSimpleProgressLoadingBuilder(Context context, CharSequence cs) {
    CharSequence message = "加载中...";
    if (!TextUtils.isEmpty(cs)) {
        message = cs;
    }
    return newBuilder(context).title(message).progress(true, 0);
}
 
开发者ID:vsona,项目名称:RxJava2RetrofitDemo,代码行数:8,代码来源:BaseMaterialDialog.java

示例6: showLoading

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showLoading() {
    if (builder == null) {
        builder = new MaterialDialog.Builder(SearchActivity.this);
        builder.cancelable(false);
        builder.title("等一下");
        builder.content("正在获取查询条件...").progress(true, 0);
    }
    materialDialog = builder.show();
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:11,代码来源:SearchActivity.java

示例7: showLoading

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showLoading() {
    if (builder == null) {
        builder = new MaterialDialog.Builder(InsideCheckActivity.this);
        builder.cancelable(false);
        builder.title("等一下");
        builder.content("正在请求数据...").progress(true, 0);
    }
    materialDialog = builder.show();
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:11,代码来源:InsideCheckActivity.java

示例8: 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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:41,代码来源:MaterialDialogPreference.java

示例9: hideKeyboard

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static void hideKeyboard(@NonNull final DialogInterface di,
                                @NonNull final MaterialDialog.Builder builder) {
    final MaterialDialog dialog = (MaterialDialog) di;
    if (dialog.getInputEditText() == null) return;
    InputMethodManager imm = (InputMethodManager) builder.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    if (imm != null) {
        final View currentFocus = dialog.getCurrentFocus();
        final IBinder windowToken = currentFocus != null ?
                currentFocus.getWindowToken() : dialog.getView().getWindowToken();
        if (windowToken != null) {
            imm.hideSoftInputFromWindow(windowToken, 0);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:DialogUtils.java

示例10: start

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public AsyncTask start(@NonNull Executor executor) {
    if (mDialog == null) {
        int color = mWallpaper.getColor();
        if (color == 0) {
            color = ColorHelper.getAttributeColor(mContext.get(), R.attr.colorAccent);
        }

        final MaterialDialog.Builder builder = new MaterialDialog.Builder(mContext.get());
        builder.widgetColor(color)
                .typeface(TypefaceHelper.getMedium(mContext.get()), TypefaceHelper.getRegular(mContext.get()))
                .progress(true, 0)
                .cancelable(false)
                .progressIndeterminateStyle(true)
                .content(R.string.wallpaper_loading)
                .positiveColor(color)
                .positiveText(android.R.string.cancel)
                .onPositive((dialog, which) -> {
                    ImageLoader.getInstance().stop();
                    cancel(true);
                });

        mDialog = builder.build();
    }

    if (!mDialog.isShowing()) mDialog.show();

    mExecutor = executor;
    if (mWallpaper == null) {
        LogUtil.e("WallpaperApply cancelled, wallpaper is null");
        return null;
    }

    if (mWallpaper.getDimensions() == null) {
        return WallpaperPropertiesLoaderTask.prepare(mContext.get())
                .wallpaper(mWallpaper)
                .callback(this)
                .start(AsyncTask.THREAD_POOL_EXECUTOR);
    }
    return executeOnExecutor(executor);
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:41,代码来源:WallpaperApplyTask.java

示例11: 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;
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:14,代码来源:LicensesFragment.java

示例12: confirm

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@ScriptInterface
public Object confirm(String title, String content, Object callback) {
    MaterialDialog.Builder builder = dialogBuilder(callback)
            .confirm()
            .title(title)
            .positiveText(R.string.ok)
            .negativeText(R.string.cancel);
    if (!TextUtils.isEmpty(content)) {
        builder.content(content);
    }
    return ((BlockedMaterialDialog.Builder) builder).showAndGet();
}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:13,代码来源:Dialogs.java

示例13: showLoading

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void showLoading() {
    if (builder == null) {
        builder = new MaterialDialog.Builder(NewOpportunityActivity.this);
        builder.cancelable(false);
        builder.title("等一下");
        builder.content("正在请求数据...").progress(true, 0);
    }
    materialDialog = builder.show();
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:10,代码来源:NewOpportunityActivity.java

示例14: showLoading

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void showLoading() {
    if (builder == null) {
        builder = new MaterialDialog.Builder(mContext);
        builder.cancelable(false);
        builder.title("等一下");
        builder.content("正在获取更新数据...").progress(true, 0);
    }
    materialDialog = builder.show();
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:10,代码来源:UpdateManager.java

示例15: showLoading

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void showLoading() {
    if (builder == null) {
        builder = new MaterialDialog.Builder(ShowOpportunityActivity.this);
        builder.cancelable(false);
        builder.title("等一下");
        builder.content("正在请求数据...").progress(true, 0);
    }
    materialDialog = builder.show();
}
 
开发者ID:liuyongfeng90,项目名称:JKCloud,代码行数:11,代码来源:ShowOpportunityActivity.java


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