imageview と 3 つの textview の 4 つのアイテムが使用されている 1 つのカスタム リスト ビューがあります。リストのすべてのイメージビューに対して5つのイメージURIがあり、特定のイメージビューアイテムの一定期間内にイメージを動的に変更したいと考えています。画像を動的に変更するためのスレッドを適用しましたが、一度にリストビューの1つのアイテムにしか機能しません。リストビューのすべてのイメージビュー項目を動的に変更したい。私がやること。私は正しい方向に進んでいますか、それとも何か他のことを試す必要があります.誰かが私に提案してください.助けは非常に高く評価されます..事前に感謝します:)
これが私のgetViewコードです-
final AQuery recycle = aq.recycle(view);
final Handler mHandler = new Handler();
// Create runnable for posting
final Runnable mUpdateResults = new Runnable() {
public void run() {
animate_slide(recycle , currentimageindex);
currentimageindex++;
if(currentimageindex > 4){
currentimageindex = 0;
}
}
};
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
mHandler.post(mUpdateResults);
}
}, delay, period);
そして、私がアニメーションのために呼び出すメソッド-
private void animate_slide(AQuery recycle ,int ci) {
if(ci == 0){
Log.d("00000000000000","----------"+ci);
recycle.id(R.id.avatar).progress(R.id.progress).image(ApplicationConstants.IMG_URL_SUFFIX+picture.get(currentimageindex), true, true, 100, 0, null, AQuery.FADE_IN);
}else if(ci == 1){
Log.d("11111111111111","----------"+ci);
recycle.id(R.id.avatar).progress(R.id.progress).image(ApplicationConstants.IMG_URL_SUFFIX+picture1.get(currentimageindex), true, true, 100, 0, null, AQuery.FADE_IN);
}else if(ci == 2){
Log.d("2222222222222222","----------"+ci);
recycle.id(R.id.avatar).progress(R.id.progress).image(ApplicationConstants.IMG_URL_SUFFIX+picture2.get(currentimageindex), true, true, 100, 0, null, AQuery.FADE_IN);
}else if(ci == 3){
Log.d("3333333333333333","----------"+ci);
recycle.id(R.id.avatar).progress(R.id.progress).image(ApplicationConstants.IMG_URL_SUFFIX+picture3.get(currentimageindex), true, true, 100, 0, null, AQuery.FADE_IN);
}else if(ci == 4){
Log.d("00000000000000","----------"+ci);
recycle.id(R.id.avatar).progress(R.id.progress).image(ApplicationConstants.IMG_URL_SUFFIX+picture4.get(currentimageindex), true, true, 100, 0, null, AQuery.FADE_IN);
}
}