@Override
  protected void onAttach(View rootView) {
    super.onAttach(rootView);
    Context context=getContext();
    res = context.getResources();
    density = context.getResources().getDisplayMetrics().density;
    slop = ViewConfiguration.get(context).getScaledTouchSlop();

    textSize = TEXT_SIZE_DP * density;
    textOffset = TEXT_OFFSET_DP * density;

    setChromeColor(CHROME_COLOR);
    viewBorderPaint.setStyle(STROKE);
    viewBorderPaint.setTextSize(textSize);
    setChromeShadowColor(CHROME_SHADOW_COLOR);
    if (Build.VERSION.SDK_INT >= JELLY_BEAN) {
      viewBorderPaint.setTypeface(Typeface.create("sans-serif-condensed", NORMAL));
    }
  }
Renders your view hierarchy as an interactive 3D visualization of layers.
<p>
Interactions supported:
<ul>
<li>Single touch: controls the rotation of the model.</li>
<li>Two finger vertical pinch: Adjust zoom.</li>
<li>Two finger horizontal pinch: Adjust layer spacing.</li>
</ul>
saklib/src/main/java/com/wanjian/sak/layer/impl/ScalpelFrameLayout.java