// Path: app/src/main/java/com/zhenghuiyan/todaything/util/MiscUtil.java
// public class MiscUtil {
//     public static Context appContext = null;
// 
//     private MiscUtil() {}
// 
//     public static void setAppContext(Context c) {
//         appContext = c;
//     }
// 
//     public static Context getAppContext() {
//         return appContext;
//     }
// 
//     /**
//      *
//      * */
// 
//      public static void goToActivity(Activity a, Fragment f, Class<?> b, Bundle bundle, boolean isForResult) {
//         Intent intent = new Intent(a, b);
//         if (bundle != null) {
//             intent.putExtras(bundle);
//         }
//         if (isForResult && (f != null)) {
//             f.startActivityForResult(intent, 0);
//         } else if (isForResult && (f == null)) {
//             a.startActivityForResult(intent, 0);
//         } else {
//             a.startActivity(intent);
//         }
//         a.overridePendingTransition(R.anim.zero_scale_one, R.anim.keep_status);
//     }
// }


import android.content.Context;
import android.util.AttributeSet;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.zhenghuiyan.todaything.R;
import com.zhenghuiyan.todaything.util.MiscUtil;
package com.zhenghuiyan.todaything.widget;



/**
 * Created by zhenghuiyan on 2015/2/5.
 */
public class WeekButton extends CheckBox {

    public WeekButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
// Path: app/src/main/java/com/zhenghuiyan/todaything/util/MiscUtil.java
// public class MiscUtil {
//     public static Context appContext = null;
// 
//     private MiscUtil() {}
// 
//     public static void setAppContext(Context c) {
//         appContext = c;
//     }
// 
//     public static Context getAppContext() {
//         return appContext;
//     }
// 
//     /**
//      *
//      * */
// 
//      public static void goToActivity(Activity a, Fragment f, Class<?> b, Bundle bundle, boolean isForResult) {
//         Intent intent = new Intent(a, b);
//         if (bundle != null) {
//             intent.putExtras(bundle);
//         }
//         if (isForResult && (f != null)) {
//             f.startActivityForResult(intent, 0);
//         } else if (isForResult && (f == null)) {
//             a.startActivityForResult(intent, 0);
//         } else {
//             a.startActivity(intent);
//         }
//         a.overridePendingTransition(R.anim.zero_scale_one, R.anim.keep_status);
//     }
// }


// Path: app/src/main/java/com/zhenghuiyan/todaything/widget/WeekButton.java
import android.content.Context;
import android.util.AttributeSet;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import com.zhenghuiyan.todaything.R;
import com.zhenghuiyan.todaything.util.MiscUtil;

package com.zhenghuiyan.todaything.widget;



/**
 * Created by zhenghuiyan on 2015/2/5.
 */
public class WeekButton extends CheckBox {

    public WeekButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
                    WeekButton.this.setTextColor(MiscUtil.getAppContext().getResources().getColor(android.R.color.white));