private void initView(AttributeSet attrs) {
setLayerType(LAYER_TYPE_HARDWARE, null);
edgePaint.setColor(DEFAULT_EDGE_COLOR);
edgePaint.setAntiAlias(true);
if (attrs != null) {
TypedArray arr = getContext().obtainStyledAttributes(attrs, R.styleable.DepthRelativeLayout);
edgePaint.setColor(arr.getInt(R.styleable.DepthRelativeLayout_depth_edgeColor, DEFAULT_EDGE_COLOR));
setIsCircle(arr.getBoolean(R.styleable.DepthRelativeLayout_depth_isCircle, false));
depth = arr.getDimension(R.styleable.DepthRelativeLayout_depth_value, DEFAULT_THICKNESS * getResources().getDisplayMetrics().density);
depthIndex = arr.getInteger(R.styleable.DepthRelativeLayout_depth_zIndex, depthIndex);
animationDelay = arr.getInteger(R.styleable.DepthRelativeLayout_depth_animationDelay, animationDelay);
customShadowElevation = arr.getDimension(R.styleable.DepthRelativeLayout_depth_elevation, 0);
} else {
edgePaint.setColor(DEFAULT_EDGE_COLOR);
depth = DEFAULT_THICKNESS * getResources().getDisplayMetrics().density;
}
setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
}
});
}
DepthRelativeLayout.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:Depth
作者:
评论列表
文章目录