2010-10-18 106 views
0

我想要重建(也許我甚至不必)nativ android progress indicator並將其顯示爲列表項的圖標。我跟着this example,並與一個沉重的表演吃動畫,這也與本地微調不匹配。該代碼具有「LinearInterpolator」,似乎會導致這些問題。在Android中使用本機微調器

現在我做我自己的極間和滿足我的需要之一:它量化步入12

不過,我仍然有巨大的性能問題。 UiThread現在不允許我的後臺線程運行,它們旨在下載和解析數據。請注意,我在列表中顯示了幾個spinners。我也嘗試在我的listAdapter中將插入器設置爲類變量。所以,所有的listViews都可以使用這個Interpolator。

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。但是,它仍然不是很高效。 (儘管如此)

回答