草庐IT

interpolatedTime

全部标签

android - 使用 interpolatedTime == 1 调用两次 applyTransformation

我有一个ListView,它的项目需要用动画折叠然后删除。我使用Animation折叠项目,在完成折叠后我从ListView中删除项目(通过从数据列表中删除它并调用notifyDataSetChanged).为了检测动画是否完成,我在applyTransformation方法中检查是否interpolatedTime==1.0。问题是applyTransformation在`interpolatedTime'==1时被调用了两次,所以我不能真正依赖它(否则我可以删除两个项目而不是一个)。为什么会这样?这是我的一些代码:publicstaticvoidcollapseAndDelete(

Android:展开/折叠动画

假设我有一个垂直的线性布局:[v1][v2]默认情况下,v1已可见=GONE。我想用展开动画显示v1,同时按下v2。我试过这样的:Animationa=newAnimation(){intinitialHeight;@OverrideprotectedvoidapplyTransformation(floatinterpolatedTime,Transformationt){finalintnewHeight=(int)(initialHeight*interpolatedTime);v.getLayoutParams().height=newHeight;v.requestLayou

android - 展开/折叠动画 : Small lag || MeasureSpec returns wrong value

我使用以下两种方法(inspired/copiedfromhere)expand和collapseScrollView中的一些TextViews>点击“header”-TextView。伪布局结构:Divider是一个简单的View,height设置为1dp。content-TextViews样式包括:0dpmatch_parent和一些边距和填充。这里的方法:publicstaticvoidexpand(finalViewv){//v.measure(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CON