private void setDrawWithLayer(View v, boolean drawWithLayer) {
        if (isHardwareAccelerated()) {
            if (v.getLayerType() != LAYER_TYPE_HARDWARE && drawWithLayer) {
                v.setLayerType(LAYER_TYPE_HARDWARE, null);
            } else if (v.getLayerType() != LAYER_TYPE_NONE && !drawWithLayer) {
                v.setLayerType(LAYER_TYPE_NONE, null);
            }
        }
    }
Enable a hardware layer for the view.

@param v
@param drawWithLayer
app/src/main/java/home/smart/fly/animations/customview/flipview/FlipView.java