我想重建
nativ android progress indicator
并将其显示为列表项的图标。我跟随
this example
最后是一个重性能的吃动画,这也不符合本地旋转器。代码具有“linerinterpolator”,这似乎导致了这些问题。
现在我做了自己的国际刑警组织,满足了我的一个需求:它将步骤量化为12个。
但是,我仍然有巨大的性能问题。
uithread现在不允许我的后台线程运行
,用于下载和分析数据。请注意,我正在列表中显示几个微调器。我还尝试在listadapter中将插值器设置为类变量。所以,所有列表视图都可以使用这个插值器。
if(imageViewIcon != null) {
RotateAnimation anim = new RotateAnimation(0f, 360f, 51f, 51f);
anim.setInterpolator(new Interpolator() {
@Override
public float getInterpolation( float input ) {
return (float) Math.floor((double)input*10)/12;
}
});
// anim
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(1000);
// Start animating the image
imageViewSpinner.startAnimation(anim);
}
更新
最后,我发现了ProgressBarWidget,它和我做的完全一样。不过,它的性能还是不太好。(不过更好)