當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。