// Path: saklib/src/main/java/com/wanjian/sak/utils/ScreenUtils.java
// public class ScreenUtils {
// 
//   public static int dp2px(Context context, int dip) {
//     float density = context.getResources().getDisplayMetrics().density;
//     return (int) (dip * density + 0.5);
//   }
// 
//   public static int px2dp(Context context, float pxValue) {
//     final float scale = context.getResources().getDisplayMetrics().density;
//     return (int) (pxValue / scale + 0.5f);
//   }
// 
// }


import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.View;
import com.wanjian.sak.utils.ScreenUtils;
package com.wanjian.sak.layer.impl;



/**
 * Created by wanjian on 2016/10/26.
 * <p>
 * 在view左上角画浅白色背景和文本
 */

public abstract class LayerTxtAdapter extends ViewLayer {
  private Paint mPaint;
  private Rect mRect = new Rect();

  @Override
  protected void onAttach(View rootView) {
    super.onAttach(rootView);
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
// Path: saklib/src/main/java/com/wanjian/sak/utils/ScreenUtils.java
// public class ScreenUtils {
// 
//   public static int dp2px(Context context, int dip) {
//     float density = context.getResources().getDisplayMetrics().density;
//     return (int) (dip * density + 0.5);
//   }
// 
//   public static int px2dp(Context context, float pxValue) {
//     final float scale = context.getResources().getDisplayMetrics().density;
//     return (int) (pxValue / scale + 0.5f);
//   }
// 
// }


// Path: saklib/src/main/java/com/wanjian/sak/layer/impl/LayerTxtAdapter.java
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.view.View;
import com.wanjian.sak.utils.ScreenUtils;

package com.wanjian.sak.layer.impl;



/**
 * Created by wanjian on 2016/10/26.
 * <p>
 * 在view左上角画浅白色背景和文本
 */

public abstract class LayerTxtAdapter extends ViewLayer {
  private Paint mPaint;
  private Rect mRect = new Rect();

  @Override
  protected void onAttach(View rootView) {
    super.onAttach(rootView);
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setTextSize(ScreenUtils.dp2px(getContext(), 10));