// Path: BossTransfer/app/src/main/java/com/example/arial/bosstransfer/Util.java
// public class Util {
//     /**
//      * 获取屏幕参数，这个获取到的高是包含导航栏和状态栏的
//      *
//      * @param context
//      * @return
//      */
//     public static int[] getScreenParams(Context context) {
//         WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         return new int[]{wm.getDefaultDisplay().getWidth(), wm.getDefaultDisplay().getHeight()};
//     }
// 
//     /**
//      * 获取状态栏高度
//      */
//     public static int getStatusBarHeight(Context context) {
//         int result = 0;
//         int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             result = context.getResources().getDimensionPixelSize(resourceId);
//         }
//         return result;
//     }
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.support.annotation.DrawableRes;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.example.arial.bosstransfer.R;
import com.example.arial.bosstransfer.Util;
package com.example.arial.bosstransfer.boss;



/**
 * Created by lyy on 2016/2/19.
 */
@TargetApi(11)
public class BossTransferView extends LinearLayout {
    private static final String TAG = "ExpansionTemp";
    private View mHandleView;
    private WindowManager mWm;
    private ImageView mImg;
    private View mTemp;
    //    private ProgressBar mPb;
    private ImageView mPb;
    private int[] mLocation = new int[2];
    private View mRootView;

    public BossTransferView(Context context, View rootView, View handleView, WindowManager wm) {
        super(context, null);
        mHandleView = handleView;
        mRootView = rootView;
        mWm = wm;
        init();
    }

    public BossTransferView(Context context, AttributeSet attrs) {
        super(context, attrs, 0);
    }

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

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.layout_boss_transfer, this);
        mImg = (ImageView) findViewById(R.id.img);
        mTemp = findViewById(R.id.line);
//        mPb = (ProgressBar) findViewById(R.id.progress);
        mPb = (ImageView) findViewById(R.id.progress);
        mHandleView.getLocationInWindow(mLocation);
// Path: BossTransfer/app/src/main/java/com/example/arial/bosstransfer/Util.java
// public class Util {
//     /**
//      * 获取屏幕参数，这个获取到的高是包含导航栏和状态栏的
//      *
//      * @param context
//      * @return
//      */
//     public static int[] getScreenParams(Context context) {
//         WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         return new int[]{wm.getDefaultDisplay().getWidth(), wm.getDefaultDisplay().getHeight()};
//     }
// 
//     /**
//      * 获取状态栏高度
//      */
//     public static int getStatusBarHeight(Context context) {
//         int result = 0;
//         int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             result = context.getResources().getDimensionPixelSize(resourceId);
//         }
//         return result;
//     }
// }


// Path: BossTransfer/app/src/main/java/com/example/arial/bosstransfer/boss/BossTransferView.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.support.annotation.DrawableRes;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.example.arial.bosstransfer.R;
import com.example.arial.bosstransfer.Util;

package com.example.arial.bosstransfer.boss;



/**
 * Created by lyy on 2016/2/19.
 */
@TargetApi(11)
public class BossTransferView extends LinearLayout {
    private static final String TAG = "ExpansionTemp";
    private View mHandleView;
    private WindowManager mWm;
    private ImageView mImg;
    private View mTemp;
    //    private ProgressBar mPb;
    private ImageView mPb;
    private int[] mLocation = new int[2];
    private View mRootView;

    public BossTransferView(Context context, View rootView, View handleView, WindowManager wm) {
        super(context, null);
        mHandleView = handleView;
        mRootView = rootView;
        mWm = wm;
        init();
    }

    public BossTransferView(Context context, AttributeSet attrs) {
        super(context, attrs, 0);
    }

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

    private void init() {
        LayoutInflater.from(getContext()).inflate(R.layout.layout_boss_transfer, this);
        mImg = (ImageView) findViewById(R.id.img);
        mTemp = findViewById(R.id.line);
//        mPb = (ProgressBar) findViewById(R.id.progress);
        mPb = (ImageView) findViewById(R.id.progress);
        mHandleView.getLocationInWindow(mLocation);
        int sbh = Util.getStatusBarHeight(getContext());