azoft / carousellayoutmanager Goto Github PK
View Code? Open in Web Editor NEWAndroid Carousel LayoutManager for RecyclerView
License: Apache License 2.0
Android Carousel LayoutManager for RecyclerView
License: Apache License 2.0
where do i need to set the spacing between the center item?
Just like in Android 5.0+ when you swipe though your notifications and they stack on top of each other on top and bottom of screen when they no longer fit the screen.
There is a way to disable infinite scroll?
Is it possible to change the size of the on focus image?
The difference is huge between the image and their left and right children.
By the way you did a great work!
Thanks
Giosk
It seems good on Android.
Is there any iOS version available to have similar behaviour?
I appreciate your help on it.
Thanks,
Mehul.
It doesn't center on the desired position, instead on a seemingly random one
Hello, thanks for share this repository. It is perfect drawing UI for my application.
The only issue I am facing of the speed of loading. It takes 3-4 seconds for first time loading whenever application moves carousel page. (Please note that Carousel loading static cards and images with in application)
Do you have any solution for this? Kindly add me on skype -- mobileapplication
Best,
Shani Shah
Hi,
I'm getting a crash when I call scrollToPosition() method, my code
final CarouselLayoutManager layoutManager = new CarouselLayoutManager
(CarouselLayoutManager.HORIZONTAL, false);
Carousel2Adapter adapter = new Carousel2Adapter();
ArrayList<Object> objects = getObjects();
adapter.setObjects(objects);
recyclerView.setAdapter(adapter);
recyclerView.setHasFixedSize(true);
layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());
layoutManager.setMaxVisibleItems(1);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addOnScrollListener(new CenterScrollListener());
recyclerView.scrollToPosition(2);
I have tried with default LayoutManager (LinearLayoutManager) and it worked. exception I'm getting is
ava.lang.IllegalArgumentException: position can't be great then adapter items count. position is : 2
I have around 10 items is in my recycler view
Hi,
Thanks for your work.
How can I change this distance?
https://drive.google.com/open?id=0B9OWBQk6eUcmZUhWV0piLUZmQmc
Hey guys. Thanks for really great lib :) I have a question. I have only two items in view, and right left child is visible. How to put it behind center one, and show it on sides when items count is > than 2?)
Excellent library and the idea. With your library, I would like to create the carousel with live load data, but I have a problem to insert data upward, notifiitemRangeInserted method does not work as it should work with usual adapter. There is a solution for this situation?
Thanks for help!)
Hi! The carousel is great! I have a question... What do I have to set or change when the distance between each item are very large? I mean, I have a list of items but the height of each one is no too large, it just one textview. But when I implement the layout manager on vertical I get a distance between each one, and I want them to be overloaded.
Thanks :)
Hi, after following the advice in the issue: #4 , and adjusting the zoom size and some of the spacing sizes and animation tends to jump around, especially when a carousel item settles at the centre point. Cheers
I have an horizontal RecyclerView
in which I'm trying to show a vertical carousel. Nothing is displayed.
If I show the same carousel (using the same code - recycler view, adapter, etc) outside of the horizontal RecyclerView
it works.
And if I use a normal vertical RecyclerView
(i.e. use LinearLayoutManager
) in the horizontal RecyclerView
instead of carousel, it also works (again, same code, I just change the layout manager + the configuration indicated in the readme).
Any ideas...?
Hi Author,
I have downloaded 10 images from internet and i need to use this carosel for them. How to do so?
Alsoi need to open new activity on clicking any item of the carosel. Please help me in this.
Thanks
I'm trying to use the vertical version with CardViews inside a fragment but nothing is showing, I have pasted the code as this is just for testing I'm ignoring data.
This is the fragment:
public class FavoritesFragment extends Fragment {
private static final String TAG = "FavoritesFragment";
private Context mContext;
private RecyclerView mRecyclerView;
private CarouselLayoutManager mCoverFlowLayoutManager;
private FavoritesAdapter mFavoritesAdapter;
private ArrayList<String> testData;
public FavoritesFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View layout = inflater.inflate(R.layout.fragment_favorites, container, false);
mContext = getContext();
testData = new ArrayList<>();
testData.add("0");
testData.add("1");
testData.add("2");
testData.add("3");
testData.add("4");
initRecyclerView(layout, testData);
return layout;
}
private void initRecyclerView(View layout, ArrayList<String> testData) {
mCoverFlowLayoutManager = new CarouselLayoutManager(CarouselLayoutManager.VERTICAL, true);
mCoverFlowLayoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());
mRecyclerView = (RecyclerView)layout.findViewById(R.id.recyclerViewFavorites);
mRecyclerView.setLayoutManager(mCoverFlowManager);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setAdapter(new FavoritesAdapter(testData, mContext));
mRecyclerView.addOnScrollListener(new CenterScrollListener());
}
private class FavoritesAdapter extends RecyclerView.Adapter<FavoritesAdapter.ViewHolder> {
private List<String> data;
private Context mContext;
// ViewHolder to hold the card
public class ViewHolder extends RecyclerView.ViewHolder {
private View mContainer;
private ImageView mItemImage;
private TextView mDescription;
private TextView mPrice;
private TextView mShippingDate;
public ViewHolder(View cardView) {
super(cardView);
mContainer = cardView.findViewById(R.id.card_container);
mItemImage = (ImageView)cardView.findViewById(R.id.card_item_image);
mDescription = (TextView)cardView.findViewById(R.id.card_description);
mPrice = (TextView)cardView.findViewById(R.id.card_description);
mShippingDate = (TextView)cardView.findViewById(R.id.card_shipping);
}
}
public FavoritesAdapter(List<String> data, Context context) {
mContext = context;
this.data = data;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(mContext).inflate(R.layout.card_layout, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
}
@Override
public int getItemCount() {
return data.size();
}
}
}
fragment_favorites.xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.panasonixx.asosplus.FavoritesFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerViewFavorites"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerInParent="true" />
</FrameLayout>
card_layout.xml:
<android.support.v7.widget.CardView xmlns:cardview="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/card_container"
cardview:cardCornerRadius="2dp"
cardview:cardElevation="4dp"
cardview:cardUseCompatPadding="true">
<RelativeLayout
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/frameLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentBottom="false"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="false"
android:layout_alignParentStart="false"
android:layout_above="@+id/card_description">
<LinearLayout
android:id="@+id/linearView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@android:color/holo_purple"
android:gravity="center_vertical"
android:orientation="vertical"
android:visibility="gone">
<LinearLayout
android:id="@+id/layoutButtons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone">
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:text="@string/card_reveal_buy" />
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:text="@string/card_reveal_share" />
<Button
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/card_reveal_favorite" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/card_item_image"
android:layout_width="match_parent"
android:layout_height="440dp"
android:adjustViewBounds="true"
android:contentDescription="@string/image"
android:src="@drawable/test_image"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal|top" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/price"
android:id="@+id/card_price"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_margin="2dp" />
<TextView
android:layout_width="80dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/shipping"
android:id="@+id/card_shipping"
android:textAlignment="viewEnd"
android:layout_alignTop="@+id/card_price"
android:layout_alignParentEnd="true"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/desc"
android:id="@+id/card_description"
android:textAlignment="center"
android:layout_above="@+id/card_price"
android:layout_alignParentStart="true"
android:layout_alignEnd="@+id/card_shipping"
android:layout_marginBottom="8dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/card_image_description"
android:id="@+id/card_shipping_icon"
android:src="@drawable/ic_local_shipping"
android:layout_alignTop="@+id/card_shipping"
android:layout_toStartOf="@+id/card_shipping" />
</RelativeLayout>
</android.support.v7.widget.CardView>
I have a TextView underneath the images and i wanna hide all textViews from children on the right and left and just show the one in the middle. is there a way to do that?
Hello,
Thank you for your amazing library. I am trying to find out the direction of scrolling while the center item changes. The problem exists when the adapter has only two items and the layout manager is circular. For example the first item displays the minute 0 and the second item displays the minute 30. The item in the center is the 30 one. When I scroll up the item changes correctly to 0 but I have no indication that the scroll happened forwards. The same thing happens when I scroll down and the item goes from 0 to 30 (backwards). The scrollBy(...)
function gets a diff that may be bigger or lower than 0 in any given situation thus I am not able to distinct that the scroll happened backwards or forwards.
Any given thoughts?
Hi,
is there a way to disable scroll?
Hello.
I used your library in order to stack cards for my program.
Since it is a RecyclerView, I have added an ItemTouchListener to the RecyclerView in order to slide the items.
All is fine. But one issue I encountered was that when I slide the item left or right (but not removing it), then scrolling the list up / down very fast, my program would crash and will say
java.lang.IllegalArgumentException: Tmp detached view should be removed from RecyclerView before it can be recycled: ViewHolder{f0f213a position=5 id=-1, oldPos=-1, pLpos:-1 tmpDetached no parent}
at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:5424)
at android.support.v7.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1242)
at android.support.v7.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:11151)
at android.support.v7.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:11651)
at android.support.v7.widget.SimpleItemAnimator.dispatchMoveFinished(SimpleItemAnimator.java:279)
at android.support.v7.widget.DefaultItemAnimator$6.onAnimationEnd(DefaultItemAnimator.java:304)
at android.support.v4.view.ViewPropertyAnimatorCompatJB$1.onAnimationEnd(ViewPropertyAnimatorCompatJB.java:47)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1114)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1239)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:766)
at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:695)
at android.view.Choreographer.doFrame(Choreographer.java:628)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Hoping for your response on this issue. Thank you.
The idea of the recycler is to reuse the views, and not actually inflate them again once they've been inflated (similar to the ViewHolder Pattern), but according to our logging, CarouselLayoutManager is not recycling the views.
In the adapter, we added two log calls:
Attached is our output of the logs:
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 6
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 7
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 8
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 9
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 10
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 11
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 12
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 13
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 14
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 15
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 16
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 17
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 18
com.example.scroller D/ScrollAdapter: onCreate called
com.example.scroller D/ScrollAdapter: onBind called at position 19
Could you add the SnapHelper for scrolling to center?
I appreciate your help on it.
Thanks!
just add the animator like below, but the animateRemove is not called. Could you help this?
recyclerView.setItemAnimator(new DefaultItemAnimator() {
@Override
public boolean animateRemove(RecyclerView.ViewHolder holder) {
Log.e("carousel","animateRemove");
return super.animateRemove(holder);
}
@Override
public boolean animateAdd(RecyclerView.ViewHolder holder) {
Log.e("carousel","animateAdd");
return super.animateAdd(holder);
}
});
HORIZONTAL Recyclerview have 2 item and item place on each other
code :
layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener()); recyclerview_transfer.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewsUtil.dpToPx(250))); recyclerview_transfer.setLayoutManager(layoutManager); recyclerview_transfer.setHasFixedSize(true); recyclerview_transfer.addOnScrollListener(new CenterScrollListener());
Can provide findFirstVisibleItemPosition(),findLastVisibleItemPosition() method or provide a listener notify which item selected now ?
Love this lib! It's brilliant!
Every time a scroll occurs, ItemTransformation
objects are created per view per scroll. This use of creating many ItemTransformation
objects a lot of the time, it makes the GC fire off many times and therefore, you see jank. If an object pool is used, it would mean that the GC won't be fired constantly.
This would look something like adding a method to ItemTransformation.obtain(scaleX,scaleY,translationX,translationY)
and using an object pool internally to get objects. Then once it's been used, just call release
method on object and that tells the system it can be recycled.
Colt McAnlis explains the concept here: https://www.youtube.com/watch?v=bSOREVMEFnM
What do you think? Is it something worth exploring?
Hello,
thanks for a great library! Do you have any thoughts on how to use it on not fixed item height? For instance I have an item view with multiple text views which are generated in the adapter based on adapter data. If item view is higher than the defined fixed height the item view is cut off at the bottom.
Is it possible to disable circular loop of list items?
Why I can‘t find the CLASS ItemViewBinding so that many problems happened...
I'm a beginner...
example:("ItemViewBinding" is red in the following code)
private static class TestViewHolder extends RecyclerView.ViewHolder {
private final ItemViewBinding mItemViewBinding;
TestViewHolder(final ItemViewBinding itemViewBinding) {
super(itemViewBinding.getRoot());
mItemViewBinding = itemViewBinding;
}
}
Hi,
Thanks for the awesome library.
I've used it in my app and everything works great. However, i have a requirement to set the opacity level of next and previous item to as low as possible so that user's focus is mainly on center item.
Please help. Thanks in advance.
Regards
Sahmed
Thanks for this great library.
When selection changes item scale & layout position is changed. Is it possible to add animation to make smooth transition? Thanks.
Hello,
first thanks for great job you did on this project!
Secondly. I successfully used your library but now I am experiencing little problem.
When I try to change text of textview inside OnItemSelectionListener than immediately recyclerview jump to center item and scroll animation is not smooth but is completed immediately.
Any idea at least for some workaround? So far I postponed changing a text with runnable so if user scroll fast, than he will not experience this jumping.
Thank you!
Is there any option/method to set center by manually(programatically)?
Please help?
Thanks in avdance.
i'm using the vertical view for the carousel, but when i scroll the items, the center will kinda look jerky/jumpy its a bit circular transition, My code below
@OverRide
public ItemTransformation transformChild(@nonnull View child, float itemPositionToCenterDiff, int orientation) {
final float scale = (float) (2 * (2 * -StrictMath.atan(Math.abs(itemPositionToCenterDiff) + 1.30) / Math.PI + 1));
// because scaling will make view smaller in its center, then we should move this item to the top or bottom to make it visible
final float translateY;
final float translateX;
if (CarouselLayoutManager.VERTICAL == orientation) {
final float translateYGeneral = child.getMeasuredHeight() * (1 - scale) * 2 * .50f;
translateY = Math.signum(itemPositionToCenterDiff) * translateYGeneral;
translateX = 0;
} else {// 0.60
final float translateXGeneral = (float) (child.getMeasuredWidth() * (0 - scale) / 2f);
translateX = Math.signum(itemPositionToCenterDiff) * translateXGeneral;
translateY = 0;
}
return new ItemTransformation(scale, scale, translateX, translateY);
}
Hi, thanks for perfect library. I hava a problem about childs. Here is my implementation :
layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());
layoutManager.setMaxVisibleItems(4);
recyclerView.setLayoutManager(layoutManager);
// we expect only fixed sized item for now
recyclerView.setHasFixedSize(true);
// sample adapter with random data
recyclerView.setAdapter(adapter);
// enable center post scrolling
recyclerView.addOnScrollListener(new CenterScrollListener());
here what i want to do : ios photo
here what i do : android
how can i make bigger these childs? thank you
Im using the following line to enable the zoom effects , layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());
. The problem with this , even when I am scrolling , every item is getting zoomed when it comes to center , which I feel is distracting the user. How to remove this effect while scrolling ?
Regards,
Sasank
Hi! You carousel is awesom :)
And working fine (bug with the animations turned out to be my problev, sorry).
But i have some questions:
Regards Max
Hello,
Can I achieve a feature which is available on most of a carousel components implementation?
Right now if I click on an item which isn't centred (on the left or on the right) nothing happens.
What I have now is set onClickListner
for each item in onBindViewHolder
method.
I'd like to animate clicked item to a centre position somehow.
Log:
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at com.azoft.carousellayoutmanager.CarouselLayoutManager.getScrollItemSize(CarouselLayoutManager.java:574)
at com.azoft.carousellayoutmanager.CarouselLayoutManager.getMaxScrollOffset(CarouselLayoutManager.java:415)
at com.azoft.carousellayoutmanager.CarouselLayoutManager.getCurrentScrollPosition(CarouselLayoutManager.java:404)
at com.azoft.carousellayoutmanager.CarouselLayoutManager.getOffsetCenterView(CarouselLayoutManager.java:584)
at com.azoft.carousellayoutmanager.CenterScrollListener.onScrollStateChanged(CenterScrollListener.java:25)
at android.support.v7.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:3990)
How to implement pagination in this layout manager , unlike the other layout mangers i cant get the first and last visible item methods here ....
I found that the background seems to be forced to change is not it?
Hi!
i used this library v1.1.9, and catch crash on rooted device nexus 5x with cyanogenmod and android 7.1.1.
bug is unboxing Integer mDecoratedChildWidth to int, when mDecoratedChildWidth == null
i looked v1.2.0, and this version is not fix this crash
info from fabric.io:
Device Nexus 5 CAF
ORIENTATION Portrait
PROXIMITY On
OS VERSION 7.1.1
UI ORIENTATION Portrait
ROOTED Yes
crash log:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at com.azoft.carousellayoutmanager.CarouselLayoutManager.getScrollItemSize(Unknown Source:590)
at com.azoft.carousellayoutmanager.CarouselLayoutManager.scrollBy(Unknown Source:258)
at com.azoft.carousellayoutmanager.CarouselLayoutManager.scrollHorizontallyBy(Unknown Source:233)
at android.support.v7.widget.RecyclerView.scrollByInternal(Unknown Source:1636)
at android.support.v7.widget.RecyclerView.onTouchEvent(Unknown Source:2759)
at android.view.View.dispatchTouchEvent(View.java:10024)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2626)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2307)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2321)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:413)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1808)
at android.app.Activity.dispatchTouchEvent(Activity.java:3061)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(Unknown Source:67)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:375)
at android.view.View.dispatchPointerEvent(View.java:10244)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4444)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4312)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3859)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3912)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3878)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4005)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3886)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4062)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3859)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3912)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3878)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3886)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3859)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6252)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6226)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6187)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6355)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6326)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6378)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:615)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6126)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Hello!
I want to use your carousel, but i cant do that. Have you any tutorial?
Thank you!
Patricio from Argentina.
Hi,
When I scroll from one card to another very slowly it jumps from on to another. the scrolling is not smooth, I think you are bringing the next card immediately. can you make it pixel by pixel ? also is there any way that I can adjust the position of cards ?
Hi,
I tried to smooth scroll to next item from carousel using two buttons(left and right). For this I used the following:
Process: com.azoft.carousellayoutmanager.sample, PID: 31908
java.lang.IllegalArgumentException: Invalid target position
at android.support.v7.widget.RecyclerView$SmoothScroller.start(RecyclerView.java:9562)
at android.support.v7.widget.RecyclerView$LayoutManager.startSmoothScroll(RecyclerView.java:6596)
at com.azoft.carousellayoutmanager.CarouselLayoutManager.smoothScrollToPosition(CarouselLayoutManager.java:193)
There is a workaround for example for non infinite scroll to check when navigate left if carouselLayoutManager.getCenterItemPosition() != 0, but the issue is still there.
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.