Android Open Source - SuiviConsoFreeMobile Gestionnaire Themes






From Project

Back to project page SuiviConsoFreeMobile.

License

The source code is released under:

Ce logiciel est dans le domaine public.

If you think the Android project SuiviConsoFreeMobile 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 net.yvesd.scfm;
//w  w  w  . ja v a 2 s. co m
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class GestionnaireThemes {

  Activity activity;
  SharedPreferences settings;

  public GestionnaireThemes(Activity activity) {
    this.activity = activity;
    settings = activity.getSharedPreferences(
        SuiviConsoFreeMobileActivity.PREFS_NAME, 0);
  }

  /**
   * Bascule du theme noir au thme blanc ou vice versa
   */
  protected void basculerTheme() {

    int theme = settings.getInt(
        SuiviConsoFreeMobileActivity.PREF_KEY_THEME,
        android.R.style.Theme_Light);

    int newTheme = android.R.style.Theme_Light;

    if (theme == android.R.style.Theme_Light)
      newTheme = android.R.style.Theme_Black;
    else
      newTheme = android.R.style.Theme_Light;

    Editor editor = settings.edit();
    editor.putInt(SuiviConsoFreeMobileActivity.PREF_KEY_THEME, newTheme);
    editor.commit();
  }

  public void chargerThemeChoisi() {
    int theme = settings.getInt(
        SuiviConsoFreeMobileActivity.PREF_KEY_THEME,
        android.R.style.Theme_Light);

    activity.setTheme(theme);
  }

}




Java Source Code List

net.yvesd.scfm.AfficherSuiviconsoDetailleActivity.java
net.yvesd.scfm.CanWaitForStream.java
net.yvesd.scfm.DataInterpreter.java
net.yvesd.scfm.DataRecuperatorMock.java
net.yvesd.scfm.DataRecuperatorParams.java
net.yvesd.scfm.DonnesCompteur.java
net.yvesd.scfm.EditAccountActivity.java
net.yvesd.scfm.EditAccountsActivity.java
net.yvesd.scfm.ExtracteurErreur.java
net.yvesd.scfm.GestionIcones.java
net.yvesd.scfm.GestionnaireThemes.java
net.yvesd.scfm.MyHttpClient.java
net.yvesd.scfm.OptionActivity.java
net.yvesd.scfm.SuiviConsoFreeMobileActivity.java
net.yvesd.scfm.TelechargeurDonnesConso.java
net.yvesd.scfm.TelechargeurGenerique.java
net.yvesd.scfm.TelechargeurSuiviConsoDetaille.java