我创建了一个扩展View的类,我将在布局中引用它以将其绘制在屏幕上。此类简单地表示一个Rectangle,我希望使矩形的长度一直减少到0。构造函数:publicCardAnimationNew(Contextcontext,AttributeSetattrs){super(context,attrs);mPaint=newPaint(Paint.ANTI_ALIAS_FLAG);mPaint.setColor(getResources().getColor(R.color.card_grey_underline));}测量:@OverrideprotectedvoidonMeasure