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


Java ColorChooserDialog.getTitle方法代码示例

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


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

示例1: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            ThemeStore.editTheme(this)
                    .primaryColor(selectedColor)
                    .commit();
            break;
        case R.string.accent_color:
            ThemeStore.editTheme(this)
                    .accentColor(selectedColor)
                    .commit();
            break;
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).updateDynamicShortcuts();
    }
    recreate();
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:21,代码来源:SettingsActivity.java

示例2: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            ThemeStore.editTheme(this).primaryColor(selectedColor).commit();
            break;
        case R.string.accent_color:
            ThemeStore.editTheme(this).accentColor(selectedColor).commit();
            break;
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).updateDynamicShortcuts();
    }
    recreate();
}
 
开发者ID:h4h13,项目名称:RetroMusicPlayer,代码行数:17,代码来源:SettingsActivity.java

示例3: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            if (PreferenceUtils.getPrimaryColor(getContext()) == selectedColor) return;
            prefs.edit().putInt(PreferenceUtils.PRIMARY, selectedColor).apply();
            primary.transition(new ColorDrawable(selectedColor));
            break;
        case R.string.accent_color:
            if (PreferenceUtils.getAccentColor(getContext()) == selectedColor) return;
            prefs.edit().putInt(PreferenceUtils.ACCENT, selectedColor).apply();
            accent.transition(new ColorDrawable(selectedColor));
            break;
        default:
            return;
    }
    pasta.showToast(getString(R.string.restart_msg));
}
 
开发者ID:TheAndroidMaster,项目名称:Pasta-Music,代码行数:18,代码来源:SettingsFragment.java

示例4: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    final Config config = ATE.config(this, getATEKey());
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            config.primaryColor(selectedColor);
            break;
        case R.string.accent_color:
            config.accentColor(selectedColor);
            break;
        case R.string.primary_text_color:
            config.textColorPrimary(selectedColor);
            break;
        case R.string.secondary_text_color:
            config.textColorSecondary(selectedColor);
            break;
    }
    config.commit();
    recreate(); // recreation needed to reach the checkboxes in the preferences layout
}
 
开发者ID:cseshaiban,项目名称:app-theme-engine-master,代码行数:21,代码来源:SettingsActivity.java

示例5: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    final Config config = ATE.config(this, getATEKey());
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            config.primaryColor(selectedColor);
            break;
        case R.string.accent_color:
            config.accentColor(selectedColor);
            // We've overridden the navigation view selected colors in the default config,
            // which means we are responsible for keeping those colors up to date.
            config.navigationViewSelectedIcon(selectedColor);
            config.navigationViewSelectedText(selectedColor);
            break;
        case R.string.primary_text_color:
            config.textColorPrimary(selectedColor);
            break;
        case R.string.secondary_text_color:
            config.textColorSecondary(selectedColor);
            break;
    }
    config.commit();
    recreate(); // recreation needed to reach the checkboxes in the preferences layout
}
 
开发者ID:deba12,项目名称:app-theme-engine,代码行数:25,代码来源:SettingsActivity.java

示例6: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog colorChooserDialog, @ColorInt int i) {

    ThemeStore themeStore = ThemeStore.editTheme(this);

    switch (colorChooserDialog.getTitle()) {

        case R.string.primary_color: themeStore.primaryColor(i); break;
        case R.string.toolbar_text : Theme.setTextColorToolbar(prefEdit, i); break;
        case R.string.tab_indicator: Theme.setTabIndicatorColor(prefEdit, i); break;
        case R.string.accent_color : themeStore.accentColor(i); break;
        case R.string.counter_back: Theme.setCounterBackColor(prefEdit, i); break;
        case R.string.counter_text: Theme.setCounterTextColor(prefEdit, i); break;
    }

    prefEdit.commit();
    themeStore.commit();
    recreate();
}
 
开发者ID:punchup,项目名称:Superuser-UI,代码行数:20,代码来源:MainActivity.java

示例7: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    final Config config = ATE.config(this, getATEKey());
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            config.primaryColor(selectedColor);
            break;
        case R.string.accent_color:
            config.accentColor(selectedColor);
            break;
    }
    config.commit();
    recreate(); // recreation needed to reach the checkboxes in the preferences layout
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:15,代码来源:SettingsActivity.java

示例8: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    final Config config = ATE.config(this, getATEKey());
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            config.primaryColor(selectedColor);
            break;
        case R.string.accent_color:
            config.accentColor(selectedColor);
            break;
    }
    config.commit();
    recreate();
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:15,代码来源:SettingsActivity.java

示例9: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(ColorChooserDialog dialog, int color) {
    int title = dialog.getTitle();
    if (title == R.string.actionbr) {
        actionbar = color;
    } else if (title == R.string.navbr) {
        navbar = color;
    } else if (title == R.string.txt) {
        text = color;
    }
    refresh();
}
 
开发者ID:TheAndroidMaster,项目名称:Calculator,代码行数:13,代码来源:PrefsSettings.java

示例10: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
/**
 * Set the new text or background color for {@link #tempTag}.
 * @param dialog        Dialog whose title string's resource ID will determine if we're setting the text or
 *                      background color.
 * @param selectedColor New text or background color.
 */
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    if (dialog.getTitle() == R.string.title_tag_text_color) // Text color dialog.
        ActionHelper.setTagTextColor(realm, tempTag, selectedColor);
    else // Background color dialog.
        ActionHelper.setTagBgColor(realm, tempTag, selectedColor);
    // Notify the adapter that it needs to re-draw the tag's card.
    adapter.notifyItemChanged(items.indexOf(tempTag));
    // Indicate that we might need an explicit update.
    taggingHelper.markForExplicitUpdateIfNecessary();
}
 
开发者ID:bkromhout,项目名称:Minerva,代码行数:18,代码来源:TaggingActivity.java

示例11: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
    if (R.string.dialog_colour_primary_title == dialog.getTitle()) {
        prefs.put(Constants.PREFS_COLOR_PRIMARY, String.valueOf(color));
        Utils.resetColours(1);
    } else if (R.string.dialog_colour_accent_title == dialog.getTitle()) {
        prefs.put(Constants.PREFS_COLOR_ACCENT, String.valueOf(color));
        Utils.resetColours(2);
    }
    recreate();
}
 
开发者ID:out386,项目名称:AndroidFileHost_Browser,代码行数:12,代码来源:MainActivity.java

示例12: onColorSelection

import com.afollestad.materialdialogs.color.ColorChooserDialog; //导入方法依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int selectedColor) {
    switch (dialog.getTitle()) {
        case R.string.primary_color:
            if (!App.isProVersion()) {
                Arrays.sort(NonProAllowedColors.PRIMARY_COLORS);
                if (Arrays.binarySearch(NonProAllowedColors.PRIMARY_COLORS, selectedColor) < 0) {
                    // color wasn't found
                    Toast.makeText(this, R.string.only_the_first_5_colors_available, Toast.LENGTH_LONG).show();
                    startActivity(new Intent(this, PurchaseActivity.class));
                    return;
                }
            }
            ThemeStore.editTheme(this)
                    .primaryColor(selectedColor)
                    .commit();
            break;
        case R.string.accent_color:
            if (!App.isProVersion()) {
                Arrays.sort(NonProAllowedColors.ACCENT_COLORS);
                if (Arrays.binarySearch(NonProAllowedColors.ACCENT_COLORS, selectedColor) < 0) {
                    // color wasn't found
                    Toast.makeText(this, R.string.only_the_first_5_colors_available, Toast.LENGTH_LONG).show();
                    startActivity(new Intent(this, PurchaseActivity.class));
                    return;
                }
            }
            ThemeStore.editTheme(this)
                    .accentColor(selectedColor)
                    .commit();
            break;
    }

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).updateDynamicShortcuts();
    }
    recreate();
}
 
开发者ID:kabouzeid,项目名称:Phonograph,代码行数:39,代码来源:SettingsActivity.java


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