// Path: app/src/main/java/studio/androiddev/puzzle/PuzzleApplication.java
// public class PuzzleApplication extends Application{
// 
//     private static Context mContext;
// 
//     private static User mUser;
// 
//     private static DishManager dm;
// 
//     public static int getLevel() {
//         return level;
//     }
// 
//     public static void setLevel(int level) {
//         if(level < 3) return;
//         PuzzleApplication.level = level;
//         initDishManager();
//     }
// 
//     private static int level = 4;
// 
//     @Override
//     public void onCreate(){
//         super.onCreate();
//         LeakCanary.install(this);
//         Bmob.initialize(this, StaticValue.bmobId);
//         if(mContext == null) mContext = getApplicationContext();
//         SharedPreferences pref = getSharedPreferences(StaticValue.SP_NAME, MODE_PRIVATE);
//         setLevel(pref.getInt(StaticValue.SP_LEVEL, 4));
//     }
// 
//     public static User getmUser() {
//         return mUser;
//     }
// 
//     public static void setmUser(User mUser) {
//         PuzzleApplication.mUser = mUser;
//     }
// 
//     public static Context getAppContext(){
//         return mContext;
//     }
// 
//     public static void initDishManager(){
//         dm = new DishManager(level);
//     }
// 
//     public static DishManager getDishManager(){
//         return dm;
//     }
// }
// 
// Path: app/src/main/java/studio/androiddev/puzzle/utils/StaticValue.java
// public class StaticValue {
//     public static String bmobId = "284420dcdca2ba4dbb2f1b2bb463fb35";
// 
//     public static final String SP_NAME = "puzzle_sp";
//     public static final String SP_LEVEL = "level";
// }


import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import studio.androiddev.puzzle.PuzzleApplication;
import studio.androiddev.puzzle.R;
import studio.androiddev.puzzle.utils.StaticValue;
package studio.androiddev.puzzle.activity;



public class SettingActivity extends BaseActivity {

    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.levelChooseButton)
    Button levelChooseButton;
    @Bind(R.id.buttonShare)
    ImageButton buttonShare;

    private int choosedLevel = 0;

    final int[] levels = {
            R.string.setting_level_3,
            R.string.setting_level_4,
            R.string.setting_level_5,
            R.string.setting_level_6};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
        setSupportActionBar(toolbar);

        toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
// Path: app/src/main/java/studio/androiddev/puzzle/PuzzleApplication.java
// public class PuzzleApplication extends Application{
// 
//     private static Context mContext;
// 
//     private static User mUser;
// 
//     private static DishManager dm;
// 
//     public static int getLevel() {
//         return level;
//     }
// 
//     public static void setLevel(int level) {
//         if(level < 3) return;
//         PuzzleApplication.level = level;
//         initDishManager();
//     }
// 
//     private static int level = 4;
// 
//     @Override
//     public void onCreate(){
//         super.onCreate();
//         LeakCanary.install(this);
//         Bmob.initialize(this, StaticValue.bmobId);
//         if(mContext == null) mContext = getApplicationContext();
//         SharedPreferences pref = getSharedPreferences(StaticValue.SP_NAME, MODE_PRIVATE);
//         setLevel(pref.getInt(StaticValue.SP_LEVEL, 4));
//     }
// 
//     public static User getmUser() {
//         return mUser;
//     }
// 
//     public static void setmUser(User mUser) {
//         PuzzleApplication.mUser = mUser;
//     }
// 
//     public static Context getAppContext(){
//         return mContext;
//     }
// 
//     public static void initDishManager(){
//         dm = new DishManager(level);
//     }
// 
//     public static DishManager getDishManager(){
//         return dm;
//     }
// }
// 
// Path: app/src/main/java/studio/androiddev/puzzle/utils/StaticValue.java
// public class StaticValue {
//     public static String bmobId = "284420dcdca2ba4dbb2f1b2bb463fb35";
// 
//     public static final String SP_NAME = "puzzle_sp";
//     public static final String SP_LEVEL = "level";
// }


// Path: app/src/main/java/studio/androiddev/puzzle/activity/SettingActivity.java
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import studio.androiddev.puzzle.PuzzleApplication;
import studio.androiddev.puzzle.R;
import studio.androiddev.puzzle.utils.StaticValue;

package studio.androiddev.puzzle.activity;



public class SettingActivity extends BaseActivity {

    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.levelChooseButton)
    Button levelChooseButton;
    @Bind(R.id.buttonShare)
    ImageButton buttonShare;

    private int choosedLevel = 0;

    final int[] levels = {
            R.string.setting_level_3,
            R.string.setting_level_4,
            R.string.setting_level_5,
            R.string.setting_level_6};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
        setSupportActionBar(toolbar);

        toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
        levelChooseButton.setText(getString(levels[PuzzleApplication.getLevel() - 3]));