ImaginativeShohag / Why-Not-Image-Carousel

Why Not use Image Carousel if you have lots of images to show!
https://imaginativeshohag.github.io/Why-Not-Image-Carousel/
Apache License 2.0
472 stars 69 forks source link

Could you help me to be able to do the CarouselType.SHOWCASE function that doesn't work, I really need it #93

Closed katherineCruzG closed 1 year ago

katherineCruzG commented 1 year ago

I put it in the two ways that are in the repository and neither works, any solution for this error?

ImaginativeShohag commented 1 year ago

Please share some codes. Like the XMLs and init codes.

katherineCruzG commented 1 year ago

this is the code in xml <org.imaginativeworld.whynotimagecarousel.ImageCarousel android:id="@+id/carousel" android:layout_width="match_parent" android:layout_height="300dp" app:imageScaleType="centerInside" app:carouselType="SHOWCASE" app:carouselGravity="CENTER" app:scaleOnScroll="true" app:carouselBackground="#ffff4444"

    />

This is the code in java list.add( new CarouselItem( R.drawable.fondo_3, "Photo by Kimiya Oveisi on Unsplash" ) );

    carousel.setCarouselType(CarouselType.SHOWCASE);

    carousel.addData(list);
ImaginativeShohag commented 1 year ago

Please check out the samples from here.

To use the showcase, you need a custom layout for the items with fixed widths. Checkout the example 3 from here.

katherineCruzG commented 1 year ago

And that would add everything in the mainActivity? Type the code of example 3? Or do I have to create one similar to that or could I use that?

ImaginativeShohag commented 1 year ago

Carousel properties can be set in the XML or in code. No issue.

But you have to create a custom layout for the carousel item. Must have fixed width.

katherineCruzG commented 1 year ago

and could you create that custom design in the xml or could you give me an example?

matthewlu341 commented 1 year ago

The example you provided is in Kotlin, can you provide an example of how we could do it in Java? Thanks.

ImaginativeShohag commented 1 year ago

@matthewlu341 Java example already exists. Please check this.

ImaginativeShohag commented 1 year ago

@katherineCruzG You will find the samples here.