Android Auto Circular Gallery

I have a gallery widget containing 1-10 images for slides. I know that when I strip the screen, the images scroll from left to right. I want the automatic circular gallery after 10 to automatically start from the first image, is there any automatic circular adapter or method?

         final Gallery g = (Gallery) findViewById(R.id.gallery);
         g.setAdapter(new ImageAdapter(this));
         Animation animation = AnimationUtils.loadAnimation(this,
        R.anim.rotate_indefinitely);

        animation.getInterpolator();
        animation.setDuration(1000);
        animation.setStartOffset(200);
        animation.setRepeatMode(2);
        animation.setFillAfter(false);
        animation.setFillEnabled(true);

        g.setAnimation(animation);
        g.startAnimation(animation);

but I only see that the first image is animated.

Take a look at the video ...

+3
source share
2 answers

SpinnerAdapter , Integer.MAX_VALUE getCount(). , getDropDownView() getView(), position.

+8

. returns Integer.MAX_VALUE in it getCount() method . pass Integer.MAX_VALUE/2 in the position of child in setSelection(position, animate) .

+1

Source: https://habr.com/ru/post/1751704/


All Articles