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


Java Theme类代码示例

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


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

示例1: showThemed

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
@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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:MainActivity.java

示例2: createDialogInput

import com.afollestad.materialdialogs.Theme; //导入依赖的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

示例3: createDialogMessage

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:20,代码来源:DialogManager.java

示例4: createDialogSelection

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:23,代码来源:DialogManager.java

示例5: createSorceryDialog

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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());
}
 
开发者ID:NeoLSN,项目名称:DialogAlchemy,代码行数:22,代码来源:DialogExampleFragment.java

示例6: showProgressDialog

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();
    }

}
 
开发者ID:yndongyong,项目名称:fast-dev-library,代码行数:18,代码来源:FaBaseActivity.java

示例7: onMenuItemFontSizeClick

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();
}
 
开发者ID:crysehillmes,项目名称:smoothnovelreader,代码行数:22,代码来源:NovelReadViewActivity.java

示例8: onMenuItemPageCurlModeClick

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();
    }
 
开发者ID:crysehillmes,项目名称:smoothnovelreader,代码行数:23,代码来源:NovelReadViewActivity.java

示例9: onClickGender

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
@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();
}
 
开发者ID:andreshj87,项目名称:CleanFit,代码行数:21,代码来源:SettingsFragment.java

示例10: onClickActivityFactor

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
@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();
}
 
开发者ID:andreshj87,项目名称:CleanFit,代码行数:21,代码来源:SettingsFragment.java

示例11: onClickGoal

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
@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();
}
 
开发者ID:andreshj87,项目名称:CleanFit,代码行数:21,代码来源:SettingsFragment.java

示例12: onDailyClick

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
@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();
}
 
开发者ID:andreshj87,项目名称:CleanFit,代码行数:22,代码来源:AddMealFragment.java

示例13: showSortDialog

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();
}
 
开发者ID:DeFuture,项目名称:AmazeFileManager-master,代码行数:20,代码来源:Futils.java

示例14: showHistoryDialog

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();

}
 
开发者ID:DeFuture,项目名称:AmazeFileManager-master,代码行数:21,代码来源:Futils.java

示例15: showHiddenDialog

import com.afollestad.materialdialogs.Theme; //导入依赖的package包/类
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();

}
 
开发者ID:DeFuture,项目名称:AmazeFileManager-master,代码行数:21,代码来源:Futils.java


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