Java 类com.afollestad.materialdialogs.Theme 实例源码

项目:GitHub    文件:MainActivity.java   
@OnClick(R.id.themed) public void showThemed() {
    new MaterialDialog.Builder(this)
            .title(R.string.useGoogleLocationServices)
            .content(R.string.useGoogleLocationServicesPrompt)
            .positiveText(R.string.agree)
            .negativeText(R.string.disagree)
            .positiveColorRes(R.color.material_red_400)
            .negativeColorRes(R.color.material_red_400)
            .titleGravity(GravityEnum.CENTER)
            .titleColorRes(R.color.material_red_400)
            .contentColorRes(android.R.color.white)
            .backgroundColorRes(R.color.material_blue_grey_800)
            .dividerColorRes(R.color.accent)
            .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
            .positiveColor(Color.WHITE)
            .negativeColorAttr(android.R.attr.textColorSecondaryInverse)
            .theme(Theme.DARK)
            .show();
}
项目:anitrend-app    文件:DialogManager.java   
/**
 * 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();
}
项目:anitrend-app    文件:DialogManager.java   
/**
 * Creates a dialog to display a message
 */
public void createDialogMessage(String header, String body, String pos, String neg, MaterialDialog.SingleButtonCallback buttonCallback) {
    // Build the alert dialog
    new MaterialDialog.Builder(mContext)
            .onAny(buttonCallback)
            .positiveText(pos)
            .negativeText(neg)
            .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF)
            .iconRes(app_prefs.isLightTheme()?R.drawable.ic_new_releases_black_24dp:R.drawable.ic_new_releases_white_24dp)
            .buttonRippleColorRes(R.color.colorAccent)
            .positiveColorRes(R.color.colorStateBlue)
            .negativeColorRes(R.color.colorStateOrange)
            .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK)
            .title(header)
            .content(body)
            .show();
}
项目:anitrend-app    文件:DialogManager.java   
/**
 * Creates a dialog to display a message
 */
public void createDialogMessage(String header, Spanned body, String pos, String neg, MaterialDialog.SingleButtonCallback buttonCallback) {
    // Build the alert dialog
    new MaterialDialog.Builder(mContext)
            .onAny(buttonCallback)
            .positiveText(pos)
            .negativeText(neg)
            .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF)
            .iconRes(app_prefs.isLightTheme()?R.drawable.ic_new_releases_black_24dp:R.drawable.ic_new_releases_white_24dp)
            .buttonRippleColorRes(R.color.colorAccent)
            .positiveColorRes(R.color.colorStateBlue)
            .negativeColorRes(R.color.colorStateOrange)
            .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK)
            .title(header)
            .content(body)
            .show();
}
项目:anitrend-app    文件:DialogManager.java   
/**
 * Will not auto dismiss
 */
public void createDialogMessage(String header, Spanned body, String pos, String neg, String neu, MaterialDialog.SingleButtonCallback buttonCallback) {
    // Build the alert dialog
    new MaterialDialog.Builder(mContext)
            .onAny(buttonCallback)
            .positiveText(pos)
            .negativeText(neg)
            .neutralText(neu)
            .autoDismiss(false)
            .typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF)
            .iconRes(app_prefs.isLightTheme()?R.drawable.ic_new_releases_black_24dp:R.drawable.ic_new_releases_white_24dp)
            .buttonRippleColorRes(R.color.colorAccent)
            .positiveColorRes(R.color.colorStateBlue)
            .negativeColorRes(R.color.colorStateOrange)
            .theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK)
            .title(header)
            .content(body)
            .show();
}
项目:anitrend-app    文件:DialogManager.java   
public void createDialogSelection(String title , int 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();
}
项目:anitrend-app    文件:DialogManager.java   
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();
}
项目:DialogAlchemy    文件:DialogExampleFragment.java   
private void createSorceryDialog() {
    PhilosopherStone stone = new SorceryStone.Builder(getActivity())
            .titleColor(Color.MAGENTA)
            .titleGravity(GravityEnum.CENTER)
            .contentColor(Color.CYAN)
            .contentGravity(GravityEnum.CENTER)
            .buttonRippleColor(Color.YELLOW)
            .contentLineSpacing(2.0f)
            .theme(Theme.DARK)
            .setPhilosopherStone(new ColorPaletteStone()) // special power
            .build();

    Material.Builder builder = new Material.Builder(getActivity())
            .setTitle("Sorcery Stone")
            .setNegativeButton(android.R.string.cancel, null)
            .setPositiveButton(android.R.string.ok, null)
            .setPhilosopherStone(stone);

    DialogAlchemy.show(getFragmentManager(), builder.build(),
            new MaterialDialogsTransmutationCircle());
}
项目:fast-dev-library    文件:FaBaseActivity.java   
public void showProgressDialog(@Nullable String content) {
    if (this.mProgressDialog == null) {
        this.mProgressDialog = new MaterialDialog.Builder(this)
                .theme(Theme.LIGHT)
                .content(content == null ? "请稍后..." : content)
                .progress(true, 0)
                .cancelable(false)
                .show();
    } else {
        this.mProgressDialog.setContent(content == null ? "请稍后..." : content);
    }

    if (!this.mProgressDialog.isShowing()) {
        this.mProgressDialog.show();
    }

}
项目:smoothnovelreader    文件:NovelReadViewActivity.java   
public void onMenuItemFontSizeClick(){
    String[] fontSizes = getResources().getStringArray(R.array.readview_font_size_entries);
    int index = Arrays.binarySearch(fontSizes, mFontSizePref.get());
    MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(this)
            .title(R.string.settings_item_font_size_dialog_title)
            .items(fontSizes)
            .theme(isNightMode() ? Theme.DARK : Theme.LIGHT)
            .itemsCallbackSingleChoice(index, (materialDialog, view, selection, charSequence) -> {
                mFontSizePref.set(charSequence.toString());
                mFontSize = PreferenceConverter.getFontSize(NovelReadViewActivity.this, charSequence.toString());
                mNovelReadAdapter.setFontSize(mFontSize);
                //getPresenter().getSplitTextPainter().setTextSize(mFontSize);
                getPresenter().splitChapterAndDisplay(mNovelChapters.get(chapterIndex).getTitle(),
                        mCurrentContent);
                return true;
            })
            .positiveText(R.string.dialog_choose);
    MaterialDialog dialog = dialogBuilder.build();
    dialog.setOnDismissListener(dialogInterface -> hideSystemUI());
    dialog.show();
}
项目:smoothnovelreader    文件:NovelReadViewActivity.java   
public void onMenuItemPageCurlModeClick(){

        String[] pageCurlModes = getResources().getStringArray(R.array.scroll_mode_string_entries);
        String[] pageCurlModeValues = getResources().getStringArray(R.array.scroll_mode_value_entries);
        String currentMode = mScrollMode.get();
        int index = Arrays.binarySearch(pageCurlModeValues, currentMode);
        MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(this)
                .title(R.string.settings_item_scroll_mode_title)
                .items(pageCurlModes)
                .theme(isNightMode() ? Theme.DARK : Theme.LIGHT)
                .itemsCallbackSingleChoice(index, (materialDialog, view, selection, charSequence) -> {
                    if(selection == index) return false;
                    mScrollMode.set(pageCurlModeValues[selection]);
                    mReadWidgetContainer.removeAllViews();
                    recreate();
                    return true;
                })
                .positiveText(R.string.dialog_choose);
        MaterialDialog dialog = dialogBuilder.build();
        dialog.setOnDismissListener(dialogInterface -> hideSystemUI());
        dialog.show();
    }
项目:CleanFit    文件:SettingsFragment.java   
@OnClick(R.id.layout_gender)
public void onClickGender() {
    new MaterialDialog.Builder(getActivity())
            .theme(Theme.LIGHT)
            .title("Gender")
            .items(Gender.getStringValues(getActivity()))
            .itemsCallbackSingleChoice(mPresenter.getCurrentGender() - 1, new MaterialDialog.ListCallbackSingleChoice() {
                @Override
                public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                    Gender gender = Gender.fromValue(getActivity(), text.toString());
                    if (gender != null) {
                        mPresenter.setCurrentGender(gender.getIntValue());
                    }

                    return true;
                }
            })
            .positiveText("Done")
            .show();
}
项目:CleanFit    文件:SettingsFragment.java   
@OnClick(R.id.layout_activity_factor)
public void onClickActivityFactor() {
    new MaterialDialog.Builder(getActivity())
            .theme(Theme.LIGHT)
            .title("Activity Level")
            .items(ActivityFactor.getStringValues(getActivity()))
            .itemsCallbackSingleChoice(mPresenter.getCurrentActivityFactor() - 1, new MaterialDialog.ListCallbackSingleChoice() {
                @Override
                public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                    ActivityFactor activityFactor = ActivityFactor.fromValue(getActivity(), text.toString());
                    if (activityFactor != null) {
                        mPresenter.setCurrentActivityFactor(activityFactor.getIntValue());
                    }

                    return true;
                }
            })
            .positiveText("Done")
            .show();
}
项目:CleanFit    文件:SettingsFragment.java   
@OnClick(R.id.layout_goal)
public void onClickGoal() {
    new MaterialDialog.Builder(getActivity())
            .theme(Theme.LIGHT)
            .title("Goal")
            .items(Goal.getStringValues(getActivity()))
            .itemsCallbackSingleChoice(mPresenter.getCurrentGoal() - 1, new MaterialDialog.ListCallbackSingleChoice() {
                @Override
                public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
                    Goal goal = Goal.fromValue(getActivity(), text.toString());
                    if (goal != null) {
                        mPresenter.setCurrentGoal(goal.getIntValue());
                    }

                    return true;
                }
            })
            .positiveText("Done")
            .show();
}
项目:CleanFit    文件:AddMealFragment.java   
@OnClick(com.zireck.calories.R.id.layout_daily)
public void onDailyClick() {
    mMaterialDialog = new MaterialDialog.Builder(getActivity())
            .title("Daily Meal")
            .items(Mealtime.getStringValues(getActivity()))
            .itemsCallbackSingleChoice(0, new MaterialDialog.ListCallbackSingleChoice() {
                @Override
                public boolean onSelection(MaterialDialog materialDialog, View view, int which,
                                           CharSequence text) {
                    mTextDaily.setText(text);
                    return false;
                }
            })
            .theme(Theme.LIGHT)
            .widgetColorRes(com.zireck.calories.R.color.primary)
            .positiveText("Choose")
            .positiveColorRes(com.zireck.calories.R.color.primary)
            .negativeText("Cancel")
            .negativeColorRes(com.zireck.calories.R.color.primary)
            .show();
}
项目:AmazeFileManager-master    文件:Futils.java   
public void showSortDialog(final Main m) {
    String[] sort = m.getResources().getStringArray(R.array.sortby);
    int current = Integer.parseInt(m.Sp.getString("sortby", "0"));
    MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity());
    if(m.theme1==1)a.theme(Theme.DARK);
    a.items(sort).itemsCallbackSingleChoice(current, new MaterialDialog.ListCallbackSingleChoice() {
        @Override
        public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {

            m.Sp.edit().putString("sortby", "" + which).commit();
            m.getSortModes();
            m.loadlist(new File(m.current), false);
            dialog.dismiss();
            return true;
        }
    });
    a.title(R.string.sortby);
    a.build().show();
}
项目:AmazeFileManager-master    文件:Futils.java   
public void showHistoryDialog(final Main m) {
    final ArrayList<String> paths = m.history.readTable();
    final MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity());
    a.positiveText(R.string.cancel);
    a.positiveColor(Color.parseColor(m.fabSkin));
    a.title(R.string.history);
    if(m.theme1==1)
        a.theme(Theme.DARK);
    LayoutInflater layoutInflater = (LayoutInflater) m.getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = layoutInflater.inflate(R.layout.list_dialog, null);
    ListView listView = (ListView) view.findViewById(R.id.listView);
    listView.setDivider(null);
    a.customView(view, true);
    a.autoDismiss(true);
    MaterialDialog x=a.build();
    HiddenAdapter adapter = new HiddenAdapter(m.getActivity(),m, R.layout.bookmarkrow, toFileArray(paths),m.hidden,x,true);
    listView.setAdapter(adapter);
    x.show();

}
项目:AmazeFileManager-master    文件:Futils.java   
public void showHiddenDialog(final Main m) {
      final ArrayList<String> paths = m.hidden.readTable();
        final MaterialDialog.Builder a = new MaterialDialog.Builder(m.getActivity());
    a.positiveText(R.string.cancel);
    a.positiveColor(Color.parseColor(m.fabSkin));
    a.title(R.string.hiddenfiles);
    if(m.theme1==1)
        a.theme(Theme.DARK);
    LayoutInflater layoutInflater = (LayoutInflater) m.getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = layoutInflater.inflate(R.layout.list_dialog, null);
    ListView listView = (ListView) view.findViewById(R.id.listView);
    a.customView(view, true);
    a.autoDismiss(true);
    listView.setDivider(null);
    MaterialDialog x=a.build();
    HiddenAdapter adapter = new HiddenAdapter(m.getActivity(),m, R.layout.bookmarkrow, toFileArray(paths),m.hidden,x,false);
    listView.setAdapter(adapter);
    x.show();

}
项目:RadioControl    文件:MainActivity.java   
public void showUpdated() {
    new MaterialDialog.Builder(this)
            .title("RadioControl has been updated")
            .theme(Theme.LIGHT)
            .positiveText("GOT IT")
            .negativeText("WHAT'S NEW")
            .onAny(new MaterialDialog.SingleButtonCallback() {
                @Override
                public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                    String chk = which.name();
                    Log.d("RadioControl", "Updated: " + chk);
                    if(chk.equals("POSITIVE")){
                        dialog.dismiss();
                    }
                    else if(chk.equals("NEGATIVE")){
                        startChangelogActivity();
                    }
                }
            })
            .show();
}
项目:photon-tinker-android    文件:RenameHelper.java   
private void doRename(final String newName) {
    Async.executeAsync(device, new Async.ApiProcedure<ParticleDevice>() {
        @Override
        public Void callApi(@NonNull ParticleDevice sparkDevice) throws ParticleCloudException, IOException {
            device.setName(newName);
            EventBus.getDefault().post(device);
            return null;
        }

        @Override
        public void onFailure(@NonNull ParticleCloudException exception) {
            new MaterialDialog.Builder(activity)
                    .theme(Theme.LIGHT)
                    .title("Unable to rename core")
                    .content(exception.getBestMessage())
                    .positiveText("OK");
        }
    }).andIgnoreCallbacksIfActivityIsFinishing(activity);
}
项目:UnofficialHendrixApp    文件:BaseActivity.java   
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_about:
            new MaterialDialog.Builder(this)
                    .title(R.string.about_title)
                    .content(R.string.about_content)
                    .theme(Theme.LIGHT)
                    .titleColor(R.color.primary_text_default_material_light)
                    .contentColor(R.color.primary_text_default_material_light)
                    .positiveText(R.string.dialog_close)
                    .show();
            return true;
        case R.id.action_settings:
            startActivity( new Intent(this, SettingsActivity.class) );
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
项目:AmazeFileManager    文件:LoadFolderSpaceDataTask.java   
private void updateChart(String totalSpace, List<PieEntry> entries) {
    boolean isDarkTheme = appTheme.getMaterialDialogTheme() == Theme.DARK;

    PieDataSet set = new PieDataSet(entries, null);
    set.setColors(COLORS);
    set.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
    set.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
    set.setSliceSpace(5f);
    set.setAutomaticallyDisableSliceSpacing(true);
    set.setValueLinePart2Length(1.05f);
    set.setSelectionShift(0f);

    PieData pieData = new PieData(set);
    pieData.setValueFormatter(new GeneralDialogCreation.SizeFormatter(context));
    pieData.setValueTextColor(isDarkTheme? Color.WHITE:Color.BLACK);

    chart.setCenterText(new SpannableString(context.getString(R.string.total) + "\n" + totalSpace));
    chart.setData(pieData);
}
项目:AmazeFileManager    文件:ColorPref.java   
private void invalidateColorPreference(ColorPickerDialog selectedColors) {
    int colorPickerPref = sharedPref.getInt(PreferencesConstants.PREFERENCE_COLOR_CONFIG, ColorPickerDialog.NO_DATA);
    boolean isColor = colorPickerPref != ColorPickerDialog.CUSTOM_INDEX
            && colorPickerPref != ColorPickerDialog.RANDOM_INDEX;

    if(isColor) {
        selectedColors.setColorsVisibility(View.VISIBLE);

        int skin = activity.getColorPreference().getColor(ColorUsage.PRIMARY);
        int skin_two = activity.getColorPreference().getColor(ColorUsage.PRIMARY_TWO);
        int accent_skin = activity.getColorPreference().getColor(ColorUsage.ACCENT);
        int icon_skin = activity.getColorPreference().getColor(ColorUsage.ICON_SKIN);
        selectedColors.setColors(skin, skin_two, accent_skin, icon_skin);

        if(activity.getAppTheme().getMaterialDialogTheme() == Theme.LIGHT) {
            selectedColors.setDividerColor(Color.WHITE);
        } else {
            selectedColors.setDividerColor(Color.BLACK);
        }
    } else{
        selectedColors.setColorsVisibility(View.GONE);
    }
}
项目:light-novel-library_Wenku8_Android    文件:FavFragment.java   
@Override
public void onDeleteClick(View view, final int position) {
    // popup to show delete
    new MaterialDialog.Builder(getActivity())
            .callback(new MaterialDialog.ButtonCallback() {
                @Override
                public void onPositive(MaterialDialog dialog) {
                    super.onPositive(dialog);
                    // delete operatio, delete from cloud first, if succeed then delete from local
                    AsyncRemoveBookFromCloud arbfc = new AsyncRemoveBookFromCloud();
                    arbfc.execute(listNovelItemAid.get(position));
                    listNovelItemAid.remove(position);
                    refreshList(timecount ++);
                }
            })
            .theme(Theme.LIGHT)
            .content(R.string.dialog_content_want_to_delete)
            .contentGravity(GravityEnum.CENTER)
            .positiveText(R.string.dialog_positive_sure)
            .negativeText(R.string.dialog_negative_preferno)
            .show();
}
项目:light-novel-library_Wenku8_Android    文件:FavFragment.java   
@Override
protected void onPreExecute() {
    super.onPreExecute();

    loadAllLocal();

    isLoading = true;
    md = new MaterialDialog.Builder(getActivity())
            .theme(Theme.LIGHT)
            .content(R.string.dialog_content_sync)
            .progress(false, 1, true)
            .cancelable(true)
            .cancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialog) {
                    isLoading = false;
                    md.dismiss();
                }
            })
            .show();
    md.setProgress(0);
    md.setMaxProgress(0);
    md.show();
}
项目:light-novel-library_Wenku8_Android    文件:ConfigFragment.java   
@Override
protected void onPreExecute() {
    super.onPreExecute();
    md = new MaterialDialog.Builder(getActivity())
            .theme(Theme.LIGHT)
            .cancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialog) {
                    isLoading = false;
                    AsyncDeleteSlow.this.cancel(true);
                }
            })
            .title(R.string.config_clear_cache)
            .content(R.string.dialog_content_wipe_cache_slow)
            .progress(true, 0)
            .cancelable(true)
            .show();
    isLoading = true;
}
项目:light-novel-library_Wenku8_Android    文件:NovelInfoActivity.java   
@Override
protected void onPreExecute() {
    super.onPreExecute();
    loading = true;
    md = new MaterialDialog.Builder(NovelInfoActivity.this)
            .theme(Theme.LIGHT)
            .content(R.string.dialog_content_downloading)
            .progress(false, 1, true)
            .cancelable(true)
            .cancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialog) {
                    loading = false;
                }
            })
            .show();
    md.setProgress(0);
    md.setMaxProgress(1);
    size_a = 0;
}
项目:light-novel-library_Wenku8_Android    文件:SearchActivity.java   
@Override
public void onItemLongClick(View view, final int postion) {
    //Toast.makeText(this, postion + ": Long Click Detected", Toast.LENGTH_SHORT).show();
    new MaterialDialog.Builder(this)
            .callback(new MaterialDialog.ButtonCallback() {
                @Override
                public void onPositive(MaterialDialog dialog) {
                    super.onPositive(dialog);
                    GlobalConfig.deleteSearchHistory(historyList.get(postion));
                    refreshHistoryList();
                }
            })
            .theme(Theme.LIGHT)
            .backgroundColorRes(R.color.dlgBackgroundColor)
            .contentColorRes(R.color.dlgContentColor)
            .positiveColorRes(R.color.dlgPositiveButtonColor)
            .negativeColorRes(R.color.dlgNegativeButtonColor)
            .title(getResources().getString(R.string.dialog_content_delete_one_search_record))
            .content(historyList.get(postion))
            .contentGravity(GravityEnum.CENTER)
            .positiveText(R.string.dialog_positive_likethis)
            .negativeText(R.string.dialog_negative_preferno)
            .show();
}
项目:android-wail-app    文件:TrackActionsDialog.java   
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    return new MaterialDialog.Builder(activity)
            .items(R.array.track_actions)
            .itemsCallback(new MaterialDialog.ListCallback() {
                @Override
                public void onSelection(MaterialDialog materialDialog, View view,
                                        int i, CharSequence charSequence) {
                    switch (i) {
                        case 0: // Love
                            loveTrack();
                            break;
                    }
                }
            })
            .theme(Theme.DARK)
            .build();
}
项目:material-dialogs    文件:MainActivity.java   
@OnClick(R.id.themed)
public void showThemed() {
  new MaterialDialog.Builder(this)
      .title(R.string.useGoogleLocationServices)
      .content(R.string.useGoogleLocationServicesPrompt, true)
      .positiveText(R.string.agree)
      .negativeText(R.string.disagree)
      .positiveColorRes(R.color.material_red_400)
      .negativeColorRes(R.color.material_red_400)
      .titleGravity(GravityEnum.CENTER)
      .titleColorRes(R.color.material_red_400)
      .contentColorRes(android.R.color.white)
      .backgroundColorRes(R.color.material_blue_grey_800)
      .dividerColorRes(R.color.accent)
      .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
      .positiveColor(Color.WHITE)
      .negativeColorAttr(android.R.attr.textColorSecondaryInverse)
      .theme(Theme.DARK)
      .show();
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:FloatingLayoutBoundsView.java   
private void ensureDialog() {
    if (mNodeInfoDialog == null) {
        mNodeInfoView = new NodeInfoView(getContext());
        mNodeInfoDialog = new MaterialDialog.Builder(getContext())
                .customView(mNodeInfoView, false)
                .theme(Theme.LIGHT)
                .build();
        mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE);
    }
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:FloatingLayoutHierarchyView.java   
private void ensureNodeInfoDialog() {
    if (mNodeInfoDialog == null) {
        mNodeInfoView = new NodeInfoView(getContext());
        mNodeInfoDialog = new MaterialDialog.Builder(getContext())
                .customView(mNodeInfoView, false)
                .theme(Theme.LIGHT)
                .build();
        if (mNodeInfoDialog.getWindow() != null)
            mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE);
    }
}
项目:https-github.com-hyb1996-NoRootScriptDroid    文件:Dialogs.java   
private BlockedMaterialDialog.Builder dialogBuilder() {
    Context context = mAppUtils.getCurrentActivity();
    if (context == null || ((Activity) context).isFinishing()) {
        context = getContext();
    }
    return (BlockedMaterialDialog.Builder) new BlockedMaterialDialog.Builder(context, mUiHandler)
            .theme(Theme.LIGHT);
}
项目:Auto.js    文件:LayoutBoundsFloatyWindow.java   
private void ensureDialog() {
    if (mNodeInfoDialog == null) {
        mNodeInfoView = new NodeInfoView(mContext);
        mNodeInfoDialog = new MaterialDialog.Builder(mContext)
                .customView(mNodeInfoView, false)
                .theme(Theme.LIGHT)
                .build();
        mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE);
    }
}
项目:Auto.js    文件:LayoutHierarchyFloatyWindow.java   
private void ensureNodeInfoDialog() {
    if (mNodeInfoDialog == null) {
        mNodeInfoView = new NodeInfoView(mContext);
        mNodeInfoDialog = new MaterialDialog.Builder(mContext)
                .customView(mNodeInfoView, false)
                .theme(Theme.LIGHT)
                .build();
        if (mNodeInfoDialog.getWindow() != null)
            mNodeInfoDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_PHONE);
    }
}
项目:Auto.js    文件:Dialogs.java   
private BlockedMaterialDialog.Builder dialogBuilder(Object callback) {
    Context context = mAppUtils.getCurrentActivity();
    if (context == null || ((Activity) context).isFinishing()) {
        context = getContext();
    }
    return (BlockedMaterialDialog.Builder) new BlockedMaterialDialog.Builder(context, mUiHandler, mScriptBridges, callback)
            .theme(Theme.LIGHT);
}
项目:Auto.js    文件:BlockedMaterialDialog.java   
public Builder(Context context, UiHandler uiHandler, ScriptBridges scriptBridges, Object callback) {
    super(context);
    super.theme(Theme.LIGHT);
    mUiHandler = uiHandler;
    mScriptBridges = scriptBridges;
    mCallback = callback;
    if (Looper.getMainLooper() != Looper.myLooper()) {
        mResultBox = new VolatileDispose<>();
    }
}
项目:Nearby    文件:SupporterMainActivity.java   
private void init(){

        logoutBtn = (Button)findViewById(R.id.btn_logout);
        logoutBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                logout(SupporterMainActivity.this);
            }
        });

        tv_msg = (TextView)findViewById(R.id.tv_msg);
        tv_msg.setVisibility(View.GONE);

        mLinearLayoutManager = new LinearLayoutManager(getApplicationContext());
        mLinearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        rv = (RecyclerView) findViewById(R.id.rv);
        rv.setHasFixedSize(true);
        rv.setLayoutManager(mLinearLayoutManager);
//        rv.addItemDecoration(new DividerItemDecoration(getApplicationContext(), DividerItemDecoration.VERTICAL_LIST));

        loading = (AVLoadingIndicatorView)findViewById(R.id.loading);
        progressDialog = new MaterialDialog.Builder(this)
                .content(R.string.please_wait)
                .progress(true, 0)
                .progressIndeterminateStyle(true)
                .theme(Theme.LIGHT)
                .build();

    }
项目:Nearby    文件:StartActivity.java   
private void init(){

        kenBurnsView = (KenBurnsView)findViewById(R.id.image);
        kenBurnsView.setImageResource(R.drawable.loading);

        rl_background = (RelativeLayout)findViewById(R.id.rl_background);

        initLoginForm();

        tv_signupSupporterBtn = (TextView)findViewById(R.id.tv_signup_supporter);
        tv_signupSupporterBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(StartActivity.this, RegisterSupporterActivity.class);
                startActivity(intent);
            }
        });

        progressDialog = new MaterialDialog.Builder(this)
                .content(R.string.please_wait)
                .progress(true, 0)
                .progressIndeterminateStyle(true)
                .theme(Theme.LIGHT)
                .build();

        findViewById(R.id.rl_background).setVisibility(View.GONE);

    }
项目:Nearby    文件:MedicineDetailActivity.java   
private void initProgressDialog(){
    if(progressDialog != null){
        progressDialog.dismiss();
    }
    progressDialog = new MaterialDialog.Builder(this)
            .content(R.string.please_wait)
            .progress(true, 0)
            .progressIndeterminateStyle(true)
            .theme(Theme.LIGHT)
            .cancelable(false)
            .build();
}