// Path: app/src/main/java/com/github/mzule/androidweekly/App.java
// public class App extends Application {
//     private static App instance;
// 
//     public static App getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         instance = this;
//     }
// }


import android.content.Context;
import android.content.SharedPreferences;
import com.github.mzule.androidweekly.App;
package com.github.mzule.androidweekly.dao;



/**
 * Created by CaoDongping on 3/26/16.
 */
public class TextZoomKeeper {
    public static void save(int zoom) {
        getSharedPreferences().edit().putInt("zoom", zoom).apply();
    }

    public static int read(int def) {
        return getSharedPreferences().getInt("zoom", def);
    }

    private static SharedPreferences getSharedPreferences() {
// Path: app/src/main/java/com/github/mzule/androidweekly/App.java
// public class App extends Application {
//     private static App instance;
// 
//     public static App getInstance() {
//         return instance;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         instance = this;
//     }
// }


// Path: app/src/main/java/com/github/mzule/androidweekly/dao/TextZoomKeeper.java
import android.content.Context;
import android.content.SharedPreferences;
import com.github.mzule.androidweekly.App;

package com.github.mzule.androidweekly.dao;



/**
 * Created by CaoDongping on 3/26/16.
 */
public class TextZoomKeeper {
    public static void save(int zoom) {
        getSharedPreferences().edit().putInt("zoom", zoom).apply();
    }

    public static int read(int def) {
        return getSharedPreferences().getInt("zoom", def);
    }

    private static SharedPreferences getSharedPreferences() {
        return App.getInstance().getSharedPreferences("TextZoom", Context.MODE_PRIVATE);