void setup() {
getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (child instanceof DepthLayout) {
boolean hasChangedBounds = ((DepthLayout) child).calculateBounds();
if (hasChangedBounds)
invalidate();
}
}
return true;
}
});
shadowPaint.setColor(Color.BLACK);
shadowPaint.setAntiAlias(true);
softShadow = (NinePatchDrawable) getResources().getDrawable(R.drawable.shadow, null);
roundSoftShadow = getResources().getDrawable(R.drawable.round_soft_shadow, null);
}
DepthRendrer.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:HaiNaBaiChuan
作者:
评论列表
文章目录