// Path: MensaApp/src/main/java/de/lukasniemeier/mensa/ui/ThemeHelper.java
// public class ThemeHelper {
// 
//     public static int getRefreshBarColor(Context context) {
//         TypedArray attributes = context.getTheme().obtainStyledAttributes(
//                 new int[]{R.attr.refresh_bar_color});
//         int colorId;
//         if (attributes != null) {
//             colorId = attributes.getColor(0, R.color.dark_green_studi);
//             attributes.recycle();
//         } else {
//             colorId = context.getResources().getColor(R.color.dark_green_studi);
//         }
//         return colorId;
//     }
// 
//     public static int currentTheme(Context context) {
//         SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
//         String themeValue = preferences.getString("settings_list_theme", String.valueOf(R.style.Theme_Studi_Theme));
//         // ensure value is saved
//         preferences.edit().putString("settings_list_theme", themeValue).commit();
//         return Integer.valueOf(themeValue);
//     }
// }


import android.os.Bundle;
import android.preference.PreferenceActivity;
import de.lukasniemeier.mensa.ui.ThemeHelper;
package de.lukasniemeier.mensa.ui.preference;



/**
 * Created on 19.11.13.
 */
public abstract class ThemedPreferenceActivity extends PreferenceActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
// Path: MensaApp/src/main/java/de/lukasniemeier/mensa/ui/ThemeHelper.java
// public class ThemeHelper {
// 
//     public static int getRefreshBarColor(Context context) {
//         TypedArray attributes = context.getTheme().obtainStyledAttributes(
//                 new int[]{R.attr.refresh_bar_color});
//         int colorId;
//         if (attributes != null) {
//             colorId = attributes.getColor(0, R.color.dark_green_studi);
//             attributes.recycle();
//         } else {
//             colorId = context.getResources().getColor(R.color.dark_green_studi);
//         }
//         return colorId;
//     }
// 
//     public static int currentTheme(Context context) {
//         SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
//         String themeValue = preferences.getString("settings_list_theme", String.valueOf(R.style.Theme_Studi_Theme));
//         // ensure value is saved
//         preferences.edit().putString("settings_list_theme", themeValue).commit();
//         return Integer.valueOf(themeValue);
//     }
// }


// Path: MensaApp/src/main/java/de/lukasniemeier/mensa/ui/preference/ThemedPreferenceActivity.java
import android.os.Bundle;
import android.preference.PreferenceActivity;
import de.lukasniemeier.mensa.ui.ThemeHelper;

package de.lukasniemeier.mensa.ui.preference;



/**
 * Created on 19.11.13.
 */
public abstract class ThemedPreferenceActivity extends PreferenceActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setTheme(ThemeHelper.currentTheme(this));