I found a library on github that has CarouselPicker com.github.Vatican-Cameos:CarouselPicker:v1.0 i added this in the dependencies and compile also in repositories maven { url 'https://jitpack.io'}
I have successfully make a CarouselPicker this is the JAVA CODE
carouselPicker = (CarouselPicker)findViewById(R.id.carouselPicker);
List<CarouselPicker.PickerItem> itemsImage = new ArrayList<>();
itemsImage.add(new CarouselPicker.DrawableItem(R.drawable.abc));
itemsImage.add(new CarouselPicker.DrawableItem(R.drawable.123));
itemsImage.add(new CarouselPicker.DrawableItem(R.drawable.colors));
itemsImage.add(new CarouselPicker.DrawableItem(R.drawable.shapes));
CarouselPicker.CarouselViewAdapter imageAdapter = new CarouselPicker.CarouselViewAdapter(this, itemsImage,0);
carouselPicker.setAdapter(imageAdapter);
And by having a LinearLayout this is the XML code
<in.goodiebag.carouselpicker.CarouselPicker
android:id="@+id/carouselPicker"
android:layout_marginTop="50dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:items_visible="three"
/>
I cant find on google on what if the 1st item in the carousel picker selected like a OnClickListener
to change the intent
I found a library you used on this link You must use
addOnPageChangeListener
like this:So, your
onClickListener
that you want to handle the click event, isonPageSelected
method.