gtomato / carouselview Goto Github PK
View Code? Open in Web Editor NEWA wonderful library to display 2D fancy carousels for Android.
License: MIT License
A wonderful library to display 2D fancy carousels for Android.
License: MIT License
Hi. I've noticed that onItemClick
Callback isn't returning proper position values. I have 3 items total in my CarouselView. Callback onItemSelected
is returning the proper positions but onItemClick
is returning valid positions only for the first item.
Here is my code:
carousel.setOnItemSelectedListener(new CarouselView.OnItemSelectedListener() {
@Override
public void onItemSelected(CarouselView carouselView, int position, int adapterPosition, RecyclerView.Adapter adapter) {
System.out.println("onItemSelected: position=" + position + ", adapterPosition=" + adapterPosition);
}
@Override
public void onItemDeselected(CarouselView carouselView, int position, int adapterPosition, RecyclerView.Adapter adapter) {
}
});
carousel.setOnItemClickListener(new CarouselView.OnItemClickListener() {
@Override
public void onItemClick(RecyclerView.Adapter adapter, View view, int position, int adapterPosition) {
System.out.println("onItemClick: position=" + position + ", adapterPosition=" + adapterPosition);
}
});
And here are the Logs:
System.out: onItemSelected: position=0, adapterPosition=0
System.out: onItemClick: position=0, adapterPosition=0
System.out: onItemSelected: position=1, adapterPosition=1
System.out: onItemClick: position=0, adapterPosition=0
System.out: onItemSelected: position=2, adapterPosition=2
System.out: onItemClick: position=1, adapterPosition=1
I am using in it all item of a vertical recyclerview. I want to set the carousel view to more sensitive, is it possible?
Adapter with wrap_content parent height and width is not working.
Hi,
We are showing the images from the Picasso inside the carousel view, with the below code.
Picasso.with(context)
.load(thumbURL)
.placeholder(R.drawable.spin)
.error(R.drawable.image_unavailable)
.into(holder.slide);
The small placeholder image shows first. But after when the image is loaded from URL, the image still shows in the size of small placeholder. But once we go and come back to the same screen(refresh), this time the same image appears in the right size. As the same image loaded this time is from the Memory Cache.
Could you please let us know do we have any fixes/workaround for this one.
Thanks,
Raghu
I use WheelTransform and use Scale Largest equal true but left and right item size equal center
My code:
carouselView = (CarouselView) fragmentView.findViewById(R.id.carouselView);
carouselView.setGravity(Gravity.CENTER);
carouselView.setClickToScroll(false);
carouselView.setExtraVisibleChilds(2);
carouselView.setEnableFling(false); // Disable fast scrolling
carouselView.setTransformer(new CarouselView.ViewTransformer() {
@OverRide
public void onAttach(CarouselLayoutManager layoutManager) {
layoutManager.setDrawOrder(CarouselView.DrawOrder.FirstFront);
}
@Override
public void transform(View view, float position) {
int width = view.getMeasuredWidth(), height = view.getMeasuredHeight();
Float value = width * position * translationXRate * (1f / (Math.abs(position) + 1));
view.setTranslationX(value);
view.setScaleX(2f / (position + 2));
view.setScaleY(3f / (position + 3f));
view.setAlpha(position < 0 ? Math.max(1 + position, 0) : 1);
}
});
i want to make a vertical carousal view. is there a way to make this vertical?
I have an image directly inside my Carousel. I want to image to rotate as the carousel rotates. How should I approach?
I have this crash sometimes, maybe is related with the activity re-creation but I am not able to reproduce all the time.
Any idea?
Is there a way to get the item position on scroll for FlatMerryGoRoundTransformer ?
CarouselLayoutManager's translatePosition method may try to divide the position by zero as there are no item available. This would occur if a user tries to scroll on an empty carousel.
public int translatePosition(int position) {
if (!mInfinite) return position;
int itemCount = getItemCount();
**position %= itemCount**;
if (position < 0) position += itemCount;
return position;
}
Hi,
There are lots of debug log messages are coming from the carousel view. Could you please remove the debug log messages, or give the option to hide or enable the logs from the carousel view.
Thanks,
Raghu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.