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


Java ThemeSingleton类代码示例

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


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

示例1: onColorSelection

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
    if (dialog.isAccentMode()) {
        accentPreselect = color;
        ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
        ThemeSingleton.get().widgetColor = color;
    } else {
        primaryPreselect = color;
        if (getSupportActionBar() != null)
            getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
            getWindow().setNavigationBarColor(color);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:MainActivity.java

示例2: onColorSelection

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@Override
public void onColorSelection(@NonNull ColorChooserDialog dialog, @ColorInt int color) {
	if (dialog.isAccentMode()) {
		accentPreselect = color;
		ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
		ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
		ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
		ThemeSingleton.get().widgetColor = color;
		Log.i(TAG, "onColorSelection: #"+ Integer.toHexString(color));
		setStateItem(ElementAppItem.APP_TYPE_COLOR, "#"+Integer.toHexString(color));
	} else {
		primaryPreselect = color;
		if (getSupportActionBar() != null) {
			getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
		}
		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
			getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
			getWindow().setNavigationBarColor(color);
		}
	}
}
 
开发者ID:blxble,项目名称:mesh-core-on-android,代码行数:22,代码来源:AttributeActivity.java

示例3: commit

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@Override
public void commit() {
    mEditor.putLong(VALUES_CHANGED, System.currentTimeMillis())
            .putBoolean(IS_CONFIGURED_KEY, true)
            .commit();

    // MD integration
    if (Config.usingMaterialDialogs(mContext, mKey)) {
        final ThemeSingleton md = ThemeSingleton.get();
        md.titleColor = Config.textColorPrimary(mContext, mKey);
        md.contentColor = Config.textColorSecondary(mContext, mKey);
        md.itemColor = md.titleColor;
        md.widgetColor = Config.accentColor(mContext, mKey);
        md.linkColor = ColorStateList.valueOf(md.widgetColor);
        md.positiveColor = ColorStateList.valueOf(md.widgetColor);
        md.neutralColor = ColorStateList.valueOf(md.widgetColor);
        md.negativeColor = ColorStateList.valueOf(md.widgetColor);
    }
}
 
开发者ID:cseshaiban,项目名称:app-theme-engine-master,代码行数:20,代码来源:Config.java

示例4: onColorSelection

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@Override
public void onColorSelection(ColorChooserDialog dialog, @ColorInt int color) {
  if (dialog.isAccentMode()) {
    accentPreselect = color;
    ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);
    ThemeSingleton.get().neutralColor = DialogUtils.getActionTextStateList(this, color);
    ThemeSingleton.get().negativeColor = DialogUtils.getActionTextStateList(this, color);
    ThemeSingleton.get().widgetColor = color;
  } else {
    primaryPreselect = color;
    if (getSupportActionBar() != null) {
      getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      getWindow().setStatusBarColor(CircleView.shiftColorDown(color));
      getWindow().setNavigationBarColor(color);
    }
  }
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:20,代码来源:MainActivity.java

示例5: showCustomWebView

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@OnClick(R.id.customView_webView) public void showCustomWebView() {
    int accentColor = ThemeSingleton.get().widgetColor;
    if (accentColor == 0)
        accentColor = ContextCompat.getColor(this, R.color.accent);
    ChangelogDialog.create(false, accentColor)
            .show(getSupportFragmentManager(), "changelog");
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:MainActivity.java

示例6: onCreateDialog

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    billingProcessor = new BillingProcessor(getContext(), App.GOOGLE_PLAY_LICENSE_KEY, this);

    @SuppressLint("InflateParams")
    View customView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_donation, null);
    ProgressBar progressBar = ButterKnife.findById(customView, R.id.progress);
    MDTintHelper.setTint(progressBar, ThemeSingleton.get().positiveColor.getDefaultColor());

    return new MaterialDialog.Builder(getContext())
            .title(R.string.support_development)
            .customView(customView, false)
            .build();
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:16,代码来源:DonationsDialog.java

示例7: showLicenseDialog

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
private void showLicenseDialog() {
    new LicensesDialog.Builder(this)
            .setNotices(R.raw.notices)
            .setTitle(R.string.licenses)
            .setNoticesCssStyle(getString(R.string.license_dialog_style)
                    .replace("{bg-color}", ThemeSingleton.get().darkTheme ? "424242" : "ffffff")
                    .replace("{text-color}", ThemeSingleton.get().darkTheme ? "ffffff" : "000000")
                    .replace("{license-bg-color}", ThemeSingleton.get().darkTheme ? "535353" : "eeeeee")
            )
            .setIncludeOwnLicense(true)
            .build()
            .showAppCompat();
}
 
开发者ID:aliumujib,项目名称:Orin,代码行数:14,代码来源:AboutActivity.java

示例8: initMaterialDialogTheme

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
public void initMaterialDialogTheme() {
    final ThemeSingleton md = ThemeSingleton.get();
    md.titleColor = ATHUtil.resolveColor(this, android.R.attr.textColorPrimaryInverse);
    md.contentColor = ATHUtil.resolveColor(this, android.R.attr.textColorSecondaryInverse);
    md.itemColor = md.titleColor;
    md.widgetColor = getResources().getColor(R.color.colorAccent);
    md.linkColor = ColorStateList.valueOf(md.widgetColor);
    md.positiveColor = ColorStateList.valueOf(md.widgetColor);
    md.neutralColor = ColorStateList.valueOf(md.widgetColor);
    md.negativeColor = ColorStateList.valueOf(md.widgetColor);
    md.darkTheme = true;
    md.backgroundColor = getResources().getColor(R.color.dialog_background);
}
 
开发者ID:GlennioTech,项目名称:MetadataEditor,代码行数:14,代码来源:MainApplication.java

示例9: initMdSupport

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
public static void initMdSupport(@NonNull Context context, @Nullable String key) {
    final ThemeSingleton md = ThemeSingleton.get();
    md.titleColor = Config.textColorPrimary(context, key);
    md.contentColor = Config.textColorSecondary(context, key);
    md.itemColor = md.titleColor;
    md.widgetColor = Config.accentColor(context, key);
    md.linkColor = ColorStateList.valueOf(md.widgetColor);
    md.positiveColor = ColorStateList.valueOf(md.widgetColor);
    md.neutralColor = ColorStateList.valueOf(md.widgetColor);
    md.negativeColor = ColorStateList.valueOf(md.widgetColor);
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:12,代码来源:MDUtil.java

示例10: showCustomWebView

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@OnClick(R.id.customView_webView)
public void showCustomWebView() {
  int accentColor = ThemeSingleton.get().widgetColor;
  if (accentColor == 0) {
    accentColor = ContextCompat.getColor(this, R.color.accent);
  }
  ChangelogDialog.create(false, accentColor).show(getSupportFragmentManager(), "changelog");
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:9,代码来源:MainActivity.java

示例11: checkSingleton

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
private void checkSingleton() {
    if (ThemeSingleton.get(false) == null) return;
    ThemeSingleton s = ThemeSingleton.get();
    if (s.darkTheme)
        this.theme = Theme.DARK;
    if (s.titleColor != 0)
        this.titleColor = s.titleColor;
    if (s.contentColor != 0)
        this.contentColor = s.contentColor;
    if (s.positiveColor != null)
        this.positiveColor = s.positiveColor;
    if (s.neutralColor != null)
        this.neutralColor = s.neutralColor;
    if (s.negativeColor != null)
        this.negativeColor = s.negativeColor;
    if (s.itemColor != 0)
        this.itemColor = s.itemColor;
    if (s.icon != null)
        this.icon = s.icon;
    if (s.backgroundColor != 0)
        this.backgroundColor = s.backgroundColor;
    if (s.dividerColor != 0)
        this.dividerColor = s.dividerColor;
    if (s.btnSelectorStacked != 0)
        this.btnSelectorStacked = s.btnSelectorStacked;
    if (s.listSelector != 0)
        this.listSelector = s.listSelector;
    if (s.btnSelectorPositive != 0)
        this.btnSelectorPositive = s.btnSelectorPositive;
    if (s.btnSelectorNeutral != 0)
        this.btnSelectorNeutral = s.btnSelectorNeutral;
    if (s.btnSelectorNegative != 0)
        this.btnSelectorNegative = s.btnSelectorNegative;
    if (s.widgetColor != 0)
        this.widgetColor = s.widgetColor;
    if (s.linkColor != null)
        this.linkColor = s.linkColor;
    this.titleGravity = s.titleGravity;
    this.contentGravity = s.contentGravity;
    this.btnStackedGravity = s.btnStackedGravity;
    this.itemsGravity = s.itemsGravity;
    this.buttonsGravity = s.buttonsGravity;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:44,代码来源:MaterialDialog.java

示例12: preApply

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
public static void preApply(@NonNull Activity activity, @Nullable String key) {
    didPreApply = activity.getClass();
    mToolbar = null;

    int activityTheme = activity instanceof ATEActivityThemeCustomizer ?
            ((ATEActivityThemeCustomizer) activity).getActivityTheme() : Config.activityTheme(activity, key);
    if (activityTheme != 0) activity.setTheme(activityTheme);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        final Window window = activity.getWindow();
        if (Config.coloredStatusBar(activity, key))
            window.setStatusBarColor(Config.statusBarColor(activity, key));
        else window.setStatusBarColor(Color.BLACK);
        if (Config.coloredNavigationBar(activity, key))
            window.setNavigationBarColor(Config.navigationBarColor(activity, key));
        else window.setNavigationBarColor(Color.BLACK);
        applyTaskDescription(activity, key);
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        final View decorView = activity.getWindow().getDecorView();
        boolean lightStatusEnabled = false;
        if (Config.coloredStatusBar(activity, key)) {
            final int lightStatusMode = Config.lightStatusBarMode(activity, key);
            switch (lightStatusMode) {
                case Config.LIGHT_STATUS_BAR_OFF:
                default:
                    break;
                case Config.LIGHT_STATUS_BAR_ON:
                    lightStatusEnabled = true;
                    break;
                case Config.LIGHT_STATUS_BAR_AUTO:
                    lightStatusEnabled = Util.isColorLight(Config.primaryColor(activity, key));
                    break;
            }
        }

        final int systemUiVisibility = decorView.getSystemUiVisibility();
        if (lightStatusEnabled) {
            decorView.setSystemUiVisibility(systemUiVisibility | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        } else {
            decorView.setSystemUiVisibility(systemUiVisibility & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
        }
    }

    // MD integration
    if (Config.usingMaterialDialogs(activity, key)) {
        final ThemeSingleton md = ThemeSingleton.get();
        md.titleColor = Config.textColorPrimary(activity, key);
        md.contentColor = Config.textColorSecondary(activity, key);
        md.itemColor = md.titleColor;
        md.widgetColor = Config.accentColor(activity, key);
        md.linkColor = ColorStateList.valueOf(md.widgetColor);
        md.positiveColor = ColorStateList.valueOf(md.widgetColor);
        md.neutralColor = ColorStateList.valueOf(md.widgetColor);
        md.negativeColor = ColorStateList.valueOf(md.widgetColor);
    }
}
 
开发者ID:cseshaiban,项目名称:app-theme-engine-master,代码行数:58,代码来源:ATE.java

示例13: checkSingleton

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
private void checkSingleton() {
    if (ThemeSingleton.get(false) == null) return;
    ThemeSingleton s = ThemeSingleton.get();
    if (s.darkTheme)
        this.theme = Theme.DARK;
    if (s.titleColor != 0)
        this.titleColor = s.titleColor;
    if (s.contentColor != 0)
        this.contentColor = s.contentColor;
    if (s.positiveColor != null)
        this.positiveColor = s.positiveColor;
    if (s.neutralColor != null)
        this.neutralColor = s.neutralColor;
    if (s.negativeColor != null)
        this.negativeColor = s.negativeColor;
    if (s.itemColor != 0)
        this.itemColor = s.itemColor;
    if (s.icon != null)
        this.icon = s.icon;
    if (s.backgroundColor != 0)
        this.backgroundColor = s.backgroundColor;
    if (s.dividerColor != 0)
        this.dividerColor = s.dividerColor;
    if (s.btnSelectorStacked != 0)
        this.btnSelectorStacked = s.btnSelectorStacked;
    if (s.listSelector != 0)
        this.listSelector = s.listSelector;
    if (s.btnSelectorPositive != 0)
        this.btnSelectorPositive = s.btnSelectorPositive;
    if (s.btnSelectorNeutral != 0)
        this.btnSelectorNeutral = s.btnSelectorNeutral;
    if (s.btnSelectorNegative != 0)
        this.btnSelectorNegative = s.btnSelectorNegative;
    if (s.widgetColor != 0)
        this.widgetColor = s.widgetColor;
    this.titleGravity = s.titleGravity;
    this.contentGravity = s.contentGravity;
    this.btnStackedGravity = s.btnStackedGravity;
    this.itemsGravity = s.itemsGravity;
    this.buttonsGravity = s.buttonsGravity;
}
 
开发者ID:susong7519,项目名称:EasyFrame,代码行数:42,代码来源:MaterialDialog.java

示例14: checkSingleton

import com.afollestad.materialdialogs.internal.ThemeSingleton; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions")
private void checkSingleton() {
  if (ThemeSingleton.get(false) == null) {
    return;
  }
  ThemeSingleton s = ThemeSingleton.get();
  if (s.darkTheme) {
    this.theme = Theme.DARK;
  }
  if (s.titleColor != 0) {
    this.titleColor = s.titleColor;
  }
  if (s.contentColor != 0) {
    this.contentColor = s.contentColor;
  }
  if (s.positiveColor != null) {
    this.positiveColor = s.positiveColor;
  }
  if (s.neutralColor != null) {
    this.neutralColor = s.neutralColor;
  }
  if (s.negativeColor != null) {
    this.negativeColor = s.negativeColor;
  }
  if (s.itemColor != 0) {
    this.itemColor = s.itemColor;
  }
  if (s.icon != null) {
    this.icon = s.icon;
  }
  if (s.backgroundColor != 0) {
    this.backgroundColor = s.backgroundColor;
  }
  if (s.dividerColor != 0) {
    this.dividerColor = s.dividerColor;
  }
  if (s.btnSelectorStacked != 0) {
    this.btnSelectorStacked = s.btnSelectorStacked;
  }
  if (s.listSelector != 0) {
    this.listSelector = s.listSelector;
  }
  if (s.btnSelectorPositive != 0) {
    this.btnSelectorPositive = s.btnSelectorPositive;
  }
  if (s.btnSelectorNeutral != 0) {
    this.btnSelectorNeutral = s.btnSelectorNeutral;
  }
  if (s.btnSelectorNegative != 0) {
    this.btnSelectorNegative = s.btnSelectorNegative;
  }
  if (s.widgetColor != 0) {
    this.widgetColor = s.widgetColor;
  }
  if (s.linkColor != null) {
    this.linkColor = s.linkColor;
  }
  this.titleGravity = s.titleGravity;
  this.contentGravity = s.contentGravity;
  this.btnStackedGravity = s.btnStackedGravity;
  this.itemsGravity = s.itemsGravity;
  this.buttonsGravity = s.buttonsGravity;
}
 
开发者ID:afollestad,项目名称:material-dialogs,代码行数:64,代码来源:MaterialDialog.java


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