// Path: app/src/main/java/com/github/mzule/androidweekly/util/DensityUtil.java
// public class DensityUtil {
//     public static int dp2px(float dp) {
//         float density = App.getInstance().getResources().getDisplayMetrics().density;
//         return (int) (dp * density + 0.5f);
//     }
// 
//     public static float px2dp(float px) {
//         float density = App.getInstance().getResources().getDisplayMetrics().density;
//         return px / density;
//     }
// 
//     public static int screenWidth() {
//         return App.getInstance().getResources().getDisplayMetrics().widthPixels;
//     }
// }


import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.github.mzule.androidweekly.R;
import com.github.mzule.androidweekly.util.DensityUtil;
import com.pnikosis.materialishprogress.ProgressWheel;
package com.github.mzule.androidweekly.ui.view;




/**
 * Created by CaoDongping on 1/5/16.
 */
public class ProgressView extends ProgressWheel {
    public ProgressView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public ProgressView(Context context) {
        super(context);
        init();
    }

    private void init() {
        if (isInEditMode()) {
            return;
        }
        setBarColor(getResources().getColor(R.color.colorPrimary));
// Path: app/src/main/java/com/github/mzule/androidweekly/util/DensityUtil.java
// public class DensityUtil {
//     public static int dp2px(float dp) {
//         float density = App.getInstance().getResources().getDisplayMetrics().density;
//         return (int) (dp * density + 0.5f);
//     }
// 
//     public static float px2dp(float px) {
//         float density = App.getInstance().getResources().getDisplayMetrics().density;
//         return px / density;
//     }
// 
//     public static int screenWidth() {
//         return App.getInstance().getResources().getDisplayMetrics().widthPixels;
//     }
// }


// Path: app/src/main/java/com/github/mzule/androidweekly/ui/view/ProgressView.java
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.github.mzule.androidweekly.R;
import com.github.mzule.androidweekly.util.DensityUtil;
import com.pnikosis.materialishprogress.ProgressWheel;

package com.github.mzule.androidweekly.ui.view;




/**
 * Created by CaoDongping on 1/5/16.
 */
public class ProgressView extends ProgressWheel {
    public ProgressView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public ProgressView(Context context) {
        super(context);
        init();
    }

    private void init() {
        if (isInEditMode()) {
            return;
        }
        setBarColor(getResources().getColor(R.color.colorPrimary));
        setBarWidth(DensityUtil.dp2px(2));