// Path: app/src/main/java/com/zhihu/android/app/mirror/util/DisplayUtils.java
// public class DisplayUtils {
//     public static float getScreenDensity(Context context) {
//         return context.getResources().getDisplayMetrics().density;
//     }
// 
//     public static int getScreenWidth(Context context) {
//         WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Display display = manager.getDefaultDisplay();
//         Point point = new Point();
//         display.getSize(point);
//         return point.x;
//     }
// 
//     public static int getScreenHeight(Context context) {
//         WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Display display = manager.getDefaultDisplay();
//         Point point = new Point();
//         display.getSize(point);
//         return point.y;
//     }
// 
//     public static int getStatusBarHeight(Context context) {
//         int statusBarHeight = 0;
// 
//         int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             statusBarHeight = context.getResources().getDimensionPixelSize(resourceId);
//         }
// 
//         return statusBarHeight;
//     }
// 
//     public static int getNavigationBarHeight(Context context) {
//         int navigationBarHeight = 0;
// 
//         int resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             navigationBarHeight = context.getResources().getDimensionPixelSize(resourceId);
//         }
// 
//         return navigationBarHeight;
//     }
// 
//     public static int dp2px(Context context, float dp) {
//         return (int) (getScreenDensity(context) * dp + 0.5F);
//     }
// 
//     public static int sp2px(Context context, float sp) {
//         return (int) (context.getResources().getDisplayMetrics().scaledDensity * sp + 0.5F);
//     }
// 
//     public static void requestImmersiveStickyMode(Activity activity) {
//         activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
//                 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
//                 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
//                 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
//                 | View.SYSTEM_UI_FLAG_FULLSCREEN
//                 | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
//     }
// 
//     public static void clearImmersiveStickyMode(Activity activity) {
//         activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
//     }
// }


import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import com.zhihu.android.app.mirror.R;
import com.zhihu.android.app.mirror.util.DisplayUtils;
/*
 * Mirror - Yet another Sketch Mirror App for Android.
 * Copyright (C) 2016 Zhihu Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.zhihu.android.app.mirror.widget;



public class PointView extends View {
    private Paint mPaint;
    private int mAlpha;
    private int mRadius;

    private float mCurrentAlpha;
    private float mDeltaFraction;
    private long mPreDrawTime;
    private boolean mIsRunning;
    private boolean mIsReverse;

    public PointView(Context context) {
        super(context);
        init(null);
    }

    public PointView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(attrs);
    }

    public PointView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(attrs);
    }

    private void init(AttributeSet attrs) {
        mAlpha = 255;
// Path: app/src/main/java/com/zhihu/android/app/mirror/util/DisplayUtils.java
// public class DisplayUtils {
//     public static float getScreenDensity(Context context) {
//         return context.getResources().getDisplayMetrics().density;
//     }
// 
//     public static int getScreenWidth(Context context) {
//         WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Display display = manager.getDefaultDisplay();
//         Point point = new Point();
//         display.getSize(point);
//         return point.x;
//     }
// 
//     public static int getScreenHeight(Context context) {
//         WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Display display = manager.getDefaultDisplay();
//         Point point = new Point();
//         display.getSize(point);
//         return point.y;
//     }
// 
//     public static int getStatusBarHeight(Context context) {
//         int statusBarHeight = 0;
// 
//         int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             statusBarHeight = context.getResources().getDimensionPixelSize(resourceId);
//         }
// 
//         return statusBarHeight;
//     }
// 
//     public static int getNavigationBarHeight(Context context) {
//         int navigationBarHeight = 0;
// 
//         int resourceId = context.getResources().getIdentifier("navigation_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             navigationBarHeight = context.getResources().getDimensionPixelSize(resourceId);
//         }
// 
//         return navigationBarHeight;
//     }
// 
//     public static int dp2px(Context context, float dp) {
//         return (int) (getScreenDensity(context) * dp + 0.5F);
//     }
// 
//     public static int sp2px(Context context, float sp) {
//         return (int) (context.getResources().getDisplayMetrics().scaledDensity * sp + 0.5F);
//     }
// 
//     public static void requestImmersiveStickyMode(Activity activity) {
//         activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
//                 | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
//                 | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
//                 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
//                 | View.SYSTEM_UI_FLAG_FULLSCREEN
//                 | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
//     }
// 
//     public static void clearImmersiveStickyMode(Activity activity) {
//         activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
//     }
// }


// Path: app/src/main/java/com/zhihu/android/app/mirror/widget/PointView.java
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import com.zhihu.android.app.mirror.R;
import com.zhihu.android.app.mirror.util.DisplayUtils;

/*
 * Mirror - Yet another Sketch Mirror App for Android.
 * Copyright (C) 2016 Zhihu Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.zhihu.android.app.mirror.widget;



public class PointView extends View {
    private Paint mPaint;
    private int mAlpha;
    private int mRadius;

    private float mCurrentAlpha;
    private float mDeltaFraction;
    private long mPreDrawTime;
    private boolean mIsRunning;
    private boolean mIsReverse;

    public PointView(Context context) {
        super(context);
        init(null);
    }

    public PointView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(attrs);
    }

    public PointView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(attrs);
    }

    private void init(AttributeSet attrs) {
        mAlpha = 255;
        mRadius = DisplayUtils.dp2px(getContext(), 8.0F);