// Path: sak-nop/src/main/java/com/wanjian/sak/converter/ISizeConverter.java
// public abstract class ISizeConverter {
//     public static ISizeConverter CONVERTER;
// 
//     public abstract String desc();
// 
//     public abstract Size convert(Context context, float length);
// 
//     public abstract int recovery(Context context, float length);
// 
// }
// 
// Path: saklib/src/main/java/com/wanjian/sak/layer/ISize.java
// public interface ISize {
//   void onSizeConvertChange(ISizeConverter converter);
// }
// 
// 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.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.View;
import com.wanjian.sak.R;
import com.wanjian.sak.converter.ISizeConverter;
import com.wanjian.sak.layer.ISize;
import com.wanjian.sak.utils.ScreenUtils;
import java.text.DecimalFormat;
  private Rect mRect = new Rect();
  private DecimalFormat mFormat = new DecimalFormat("#.###");

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

    mBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mBgPaint.setColor(mBgColor);

    mPaddingPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaddingPaint.setColor(mPaddingColor);
  }

  protected void onDraw(Canvas canvas, View view) {
    int l = view.getPaddingLeft();
    int t = view.getPaddingTop();
    int r = view.getPaddingRight();
    int b = view.getPaddingBottom();
    int w = view.getWidth();
    int h = view.getHeight();

    canvas.drawRect(0, 0, l, h, mPaddingPaint);
    canvas.drawRect(0, 0, w, t, mPaddingPaint);
    canvas.drawRect(w - r, 0, w, h, mPaddingPaint);
    canvas.drawRect(0, h - b, w, h, mPaddingPaint);

// Path: sak-nop/src/main/java/com/wanjian/sak/converter/ISizeConverter.java
// public abstract class ISizeConverter {
//     public static ISizeConverter CONVERTER;
// 
//     public abstract String desc();
// 
//     public abstract Size convert(Context context, float length);
// 
//     public abstract int recovery(Context context, float length);
// 
// }
// 
// Path: saklib/src/main/java/com/wanjian/sak/layer/ISize.java
// public interface ISize {
//   void onSizeConvertChange(ISizeConverter converter);
// }
// 
// 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/PaddingLayer.java
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.View;
import com.wanjian.sak.R;
import com.wanjian.sak.converter.ISizeConverter;
import com.wanjian.sak.layer.ISize;
import com.wanjian.sak.utils.ScreenUtils;
import java.text.DecimalFormat;

  private Rect mRect = new Rect();
  private DecimalFormat mFormat = new DecimalFormat("#.###");

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

    mBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mBgPaint.setColor(mBgColor);

    mPaddingPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaddingPaint.setColor(mPaddingColor);
  }

  protected void onDraw(Canvas canvas, View view) {
    int l = view.getPaddingLeft();
    int t = view.getPaddingTop();
    int r = view.getPaddingRight();
    int b = view.getPaddingBottom();
    int w = view.getWidth();
    int h = view.getHeight();

    canvas.drawRect(0, 0, l, h, mPaddingPaint);
    canvas.drawRect(0, 0, w, t, mPaddingPaint);
    canvas.drawRect(w - r, 0, w, h, mPaddingPaint);
    canvas.drawRect(0, h - b, w, h, mPaddingPaint);

    ISizeConverter converter = getSizeConverter();