Android Open Source - no-frills-cpu-classic Theme






From Project

Back to project page no-frills-cpu-classic.

License

The source code is released under:

Apache License

If you think the Android project no-frills-cpu-classic listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package it.sineo.android.noFrillsCPUClassic.extra;
/*w  ww  . j  av a2  s  .  c o m*/
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.preference.PreferenceManager;

public enum Theme {
  /*
   * Light + Dark action bar har no meaning when on SDK<=10, since there is no
   * action bar at all.
   */
  THEME_DARK(android.R.style.Theme_Black, android.R.style.Theme_Holo), THEME_LIGHT(android.R.style.Theme_Light,
      android.R.style.Theme_Holo_Light), THEME_LIGHT_DARK(android.R.style.Theme_Light,
      android.R.style.Theme_Holo_Light_DarkActionBar);
  int themeId;
  int descriptionId;

  private Theme(int themeId, int v11ThemeId) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      this.themeId = v11ThemeId;
    } else {
      this.themeId = themeId;
    }
  }

  public static Theme applyTo(Context context) {
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    final Theme theme = Theme.valueOf(prefs.getString(Constants.PREF_THEME, Constants.PREF_DEFAULT_THEME));
    final int themeId = theme.themeId;
    context.setTheme(themeId);
    return theme;
  }

  public int getThemeId() {
    return this.themeId;
  }
}




Java Source Code List

it.sineo.android.noFrillsCPUClassic.BootReceiver.java
it.sineo.android.noFrillsCPUClassic.activity.AboutActivity.java
it.sineo.android.noFrillsCPUClassic.activity.MainActivity.java
it.sineo.android.noFrillsCPUClassic.activity.PreferencesActivity.java
it.sineo.android.noFrillsCPUClassic.activity.StatsActivity.java
it.sineo.android.noFrillsCPUClassic.extra.Constants.java
it.sineo.android.noFrillsCPUClassic.extra.Frequency.java
it.sineo.android.noFrillsCPUClassic.extra.PatternReplacerInputFilter.java
it.sineo.android.noFrillsCPUClassic.extra.Stats.java
it.sineo.android.noFrillsCPUClassic.extra.SysUtils.java
it.sineo.android.noFrillsCPUClassic.extra.Theme.java
it.sineo.android.noFrillsCPUClassic.service.BootService.java
it.sineo.android.noFrillsCPUClassic.service.ShutdownService.java
it.sineo.android.noFrillsCPUClassic.widget.StatsWidget.java