こんにちは、Slide show Demoを参照して水平方向の画像スクロールを使用しています。
今、私はそれを円形にしたいので、43番目の画像が来てもスクロールが止まらず、最初の画像が来るはずです。
このような画像を追加しました。
public void addImagesToView() {
for (int j = 0; j < Utility.image_array.length; j++) {
final Button imageButton = new Button(this);
imageButton.setBackgroundResource(Utility.image_array[j]);
imageButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
System.gc();
Runtime.getRuntime().gc();
imageButton.setTag(i);
imageButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
if (isFaceDown) {
/*
* if (clickTimer != null) { clickTimer.cancel();
* clickTimer = null; } clickedButton = (Button) arg0;
* stopAutoScrolling();
* clickedButton.startAnimation(scaleFaceUpAnimation());
* clickedButton.setSelected(true); clickTimer = new
* Timer();
*
* if (clickSchedule != null) { clickSchedule.cancel();
* clickSchedule = null; } clickSchedule = new
* TimerTask() { public void run() {
* startAutoScrolling(); } };
* clickTimer.schedule(clickSchedule, 1500);
*/
}
}
});
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
256, 256);
params.setMargins(0, 25, 0, 25);
imageButton.setLayoutParams(params);
horizontalOuterLayout.addView(imageButton);
}
}
この43枚の画像をスムーズに円形にする方法を知りたいだけなので、右にスクロールして最後の画像に到達すると、最初の画像などで右にスクロールする必要があります。左スクロールと同じ。