Giter VIP home page Giter VIP logo

cardstackview's Introduction

Logo

CardStackView

Platform License API AndroidArsenal CircleCI

Overview

Overview

Contents

Setup

val cardStackView = findViewById<CardStackView>(R.id.card_stack_view)
cardStackView.layoutManager = CardStackLayoutManager()
cardStackView.adapter = CardStackAdapter()

Features

Manual Swipe

ManualSwipe

Automatic Swipe

AutomaticSwipe

CardStackView.swipe()

You can set custom swipe animation.

val setting = SwipeAnimationSetting.Builder()
        .setDirection(Direction.Right)
        .setDuration(Duration.Normal.duration)
        .setInterpolator(AccelerateInterpolator())
        .build()
CardStackLayoutManager.setSwipeAnimationSetting(setting)
CardStackView.swipe()

Cancel

Manual swipe is canceled when the card is dragged less than threshold.

Cancel

Rewind

Rewind

CardStackView.rewind()

You can set custom rewind animation.

val setting = RewindAnimationSetting.Builder()
        .setDirection(Direction.Bottom)
        .setDuration(Duration.Normal.duration)
        .setInterpolator(DecelerateInterpolator())
        .build()
CardStackLayoutManager.setRewindAnimationSetting(setting)
CardStackView.rewind()

Overlay View

Value Sample
Left Overlay-Left
Right Overlay-Right

Put overlay view in your item layout of RecyclerView.

<FrameLayout
    android:id="@+id/left_overlay"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Set your left overlay -->

</FrameLayout>
Value Layout ID
Left left_overlay
Right right_overlay
Top top_overlay
Bottom bottom_overlay

Overlay Interpolator

You can set own interpolator to define the rate of change of alpha.

CardStackLayoutManager.setOverlayInterpolator(LinearInterpolator())

Paging

You can implement paging by using following two ways.

  1. Use DiffUtil.
  2. Call RecyclerView.Adapter.notifyItemRangeInserted manually.

Caution

You should NOT call RecyclerView.Adapter.notifyDataSetChanged for paging because this method will reset top position and maybe occur a perfomance issue.

Reloading

You can implement reloading by calling RecyclerView.Adapter.notifyDataSetChanged.

Stack From

Default Value Sample
None StackFrom-None
Top StackFrom-Top
Bottom StackFrom-Bottom
Left StackFrom-Left
Right StackFrom-Right
CardStackLayoutManager.setStackFrom(StackFrom.None)

Visible Count

Default Value Sample
2 VisibleCount-2
3 VisibleCount-3
4 VisibleCount-4
CardStackLayoutManager.setVisibleCount(3)

Translation Interval

Default Value Sample
4dp TranslationInterval-4dp
8dp TranslationInterval-8dp
12dp TranslationInterval-12dp
CardStackLayoutManager.setTranslationInterval(8.0f)

Scale Interval

Default Value Sample
95% ScaleInterval-95%
90% ScaleInterval-90%
CardStackLayoutManager.setScaleInterval(0.95f)

Max Degree

Default Value Sample
20° MaxDegree-20
MaxDegree-0
CardStackLayoutManager.setMaxDegree(20.0f)

Swipe Direction

Default Value Sample
Horizontal SwipeDirection-Horizontal
Vertical SwipeDirection-Vertical
Freedom SwipeDirection-Freedom
CardStackLayoutManager.setDirections(Direction.HORIZONTAL)

Swipe Threshold

Default Value Sample
30% SwipeThreshold-30%
10% SwipeThreshold-10%
CardStackLayoutManager.setSwipeThreshold(0.3f)

Swipe Restriction

CanScrollHorizontal CanScrollVertical Sample
true true SwipeRestriction-NoRestriction
true false SwipeRestriction-CanScrollHorizontalOnly
false true SwipeRestriction-CanScrollVerticalOnly
false false SwipeRestriction-CannotSwipe
CardStackLayoutManager.setCanScrollHorizontal(true)
CardStackLayoutManager.setCanScrollVertical(true)

Swipeable Method

Default Value Sample
AutomaticAndManual SwipeableMethod-AutomaticAndManual
Automatic SwipwableMethod-Automatic
Manual SwipwableMethod-Manual
None SwipwableMethod-None
CardStackLayoutManager.setSwipeableMethod(SwipeableMethod.AutomaticAndManual)

Public Interfaces

Basic usages

Method Description
CardStackView.swipe() You can swipe once by calling this method.
CardStackView.rewind() You can rewind once by calling this method.
CardStackLayoutManager.getTopPosition() You can get position displayed on top.
CardStackLayoutManager.setStackFrom(StackFrom stackFrom) You can set StackFrom.
CardStackLayoutManager.setTranslationInterval(float translationInterval) You can set TranslationInterval.
CardStackLayoutManager.setScaleInterval(float scaleInterval) You can set ScaleInterval.
CardStackLayoutManager.setSwipeThreshold(float swipeThreshold) You can set SwipeThreshold.
CardStackLayoutManager.setMaxDegree(float maxDegree) You can set MaxDegree.
CardStackLayoutManager.setDirections(List directions) You can set Direction.
CardStackLayoutManager.setCanScrollHorizontal(boolean canScrollHorizontal) You can set CanScrollHorizontal.
CardStackLayoutManager.setCanScrollVertical(boolean canScrollVertical) You can set CanScrollVertical.
CardStackLayoutManager.setSwipeAnimationSetting(SwipeAnimationSetting swipeAnimationSetting) You can set SwipeAnimationSetting.
CardStackLayoutManager.setRewindAnimationSetting(RewindAnimationSetting rewindAnimationSetting) You can set RewindAnimationSetting.

Advanced usages

Method Description
CardStackView.smoothScrollToPosition(int position) You can scroll any position with animation.
CardStackView.scrollToPosition(int position) You can scroll any position without animation.

Callbacks

Method Description
CardStackListener.onCardDragging(Direction direction, float ratio) This method is called while the card is dragging.
CardStackListener.onCardSwiped(Direction direction) This method is called when the card is swiped.
CardStackListener.onCardRewound() This method is called when the card is rewinded.
CardStackListener.onCardCanceled() This method is called when the card is dragged less than threshold.
CardStackListener.onCardAppeared(View view, int position) This method is called when the card appeared.
CardStackListener.onCardDisappeared(View view, int position) This method is called when the card disappeared.

Migration Guide

Migration of Features

1.x 2.x
Move to Origin Cancel
Reverse Rewind
ElevationEnabled Stack From
TranslationDiff Translation Interval
ScaleDiff Scale Interval
SwipeEnabled Swipe Restriction

Migration of Callbacks

1.x 2.x
CardStackView.CardEventListener CardStackListener
onCardDragging(float percentX, float percentY) onCardDragging(Direction direction, float ratio)
onCardSwiped(SwipeDirection direction) onCardSwiped(Direction direction)
onCardReversed() onCardRewound()
onCardMovedToOrigin() onCardCanceled()
onCardClicked(int index) This method is no longer provided. Please implement in your item of RecyclerView.

Installation

dependencies {
    implementation "com.yuyakaido.android:card-stack-view:2.3.4"
}

License

Copyright 2018 yuyakaido

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

cardstackview's People

Contributors

damien5314 avatar katsuya-yamada-eureka avatar sinsaitou avatar sroka avatar t-kurimura avatar yuyakaido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cardstackview's Issues

Undo Card

Card we swiped, can we get the card again.

how to make infinite swiping loop of 4 images.

@OverRide
public void onCardSwiped(Quadrant quadrant) {
Log.d("CardStackView", "onCardSwiped: " + quadrant.toString());
Log.d("CardStackView", "topIndex: " + cardStackView.getTopIndex());
if (cardStackView.getTopIndex() == imageList.size() - 1) {
Log.d("CardStackView", "Paginate: " + cardStackView.getTopIndex());
paginate();
}
}

here how to set top index to 0, what i want to do is when top index is reach to last index of image. i want to set top index to 0 again.. how do i do that.

Bug card

You need swipe left (or right) and fast touch the left side of the screen!

Crash

Got this crash using beta8. Not sure how to reproduce it but I will post re-produce steps when I can.

11-06 12:13:14.512 11196-11196/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException: Attempt to invoke interface method 'android.view.ViewParent android.view.ViewParent.getParent()' on a null object reference
at com.yuyakaido.android.cardstackview.internal.CardContainerView.onTouchEvent(CardContainerView.java:91)
at android.view.View.dispatchTouchEvent(View.java:10025)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2663)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2344)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2691)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at com.sothree.slidinguppanel.SlidingUpPanelLayout.dispatchTouchEvent(SlidingUpPanelLayout.java:963)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2669)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2358)
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 com.promgirl.speedshop.activities.SpeedShopActivity.dispatchTouchEvent(SpeedShopActivity.java:609)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:375)
at android.view.View.dispatchPointerEvent(View.java:10245)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4433)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4301)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3848)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3901)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3867)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3994)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3875)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4051)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3848)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3901)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3867)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3875)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3848)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6209)
11-06 12:13:14.512 11196-11196/? E/AndroidRuntime: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6183)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6144)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6312)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:6088)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Block movement on horizontal or vertical axis.

Is there any easy way to stop the card from moving in a specific axis? Like in the following gif where the horizontal axis is blocked and it can only move in the vertical axis.

Vertical Swiper

Thanks!

Card ignores touch with overlay

Here is my overlay

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="visible"
    app:cardBackgroundColor="#22000000"
    app:cardCornerRadius="6dp"
    app:cardElevation="0dp"
    app:cardUseCompatPadding="true">

    <com.beardedhen.androidbootstrap.AwesomeTextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:textSize="64sp"
        app:bootstrapBrand="danger"
        app:fontAwesomeIcon="fa_trash_o" />

</android.support.v7.widget.CardView>

My content card contains hard layout, but i think it not important. In my case, the card ignores touching anywhere, BUT on the edges of the card, the touch works! if I remove the app:cardUseCompatPadding="true" then the touches do not work anywhere, even at the edges. Library bug? I use beta-8

How can I get the coordinates of the user's click on a card?

Hello,

Is there a way for me to receive the point (x,y) where the user clicked on the card? My approach is to do the following:

  1. Update CardContainerView.java to pass motionOriginX and motionOriginY to the containerEventListener
  2. containerEventListener will then pass them to cardEventListener in CardStackView.java and from there I can use the point as I need them?

Thanks for your time

Lock the last item

Add the code:

                    if (distance < distanceBorder || topIndex == adapter.getCount() - 1) {
                        cardAnimator.moveToOrigin();
                    } else {
                        discard(direction);
                    }

in line 148 in the class CardStackView

Adding an onclick method for the card

If I add an onClick listener to the contentview of the card the card it seems to consume the ontouch event, and the card can no longer be swiped, is there any solution to this?

How to make overlay view to overlap card frame?

Hi, great library. But there are some question about functionality. I've tried to do it by myself, but without any result. So, what is the proper way to overlap card frame view, without annoying shadow(screenshot) in background?
untitled 2

Reverse more than 1 card

Hello! I'm using this awesome library and encountered problem - I can reverse only 1 last card swiped. Is there any possibility to reverse all last swiped cards one by one?

flip

Hi yuyakaido.I need to implement flip on cardstackview.can you help me for implementing flip

Bug swipe

If you fast swipe left and right! You will see a flying card in the background =)

Get last card when swipe left

Any one help me, i want to get last swipable card when we swipe left direction.

Actually i want achieve, when i swipe left direction then show me last swipable card

Enhancement

Hey yuyakaido,
how to implement card swipe with image swipe like as badoo app in your CardStackView

Perform reverse by draggin

Is there a way to perform a reverse (bring previous card back) by dragging from the edge of the screen?

Set Current Stack Position

Is there a method to set the cardstack to start an index? I notice that on orientation change, the card stack resets and loads from the beginning. I would like to save the current position and restore that position so the user does not have to start from the beginning.

Thanks for making such a great library!

com.android.tools.build:gradle:3.0.0 Slow down the dragging

When you upgrade your build:gradle to 3 the dragging processes of the card stack is slow down (dramatically).

My File:

buildscript {
    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Workaround:
For now I just rollback to 2.3.3 And everything went to normal.

onCardSwiped() is not called on time

I'm trying to prevent users from swiping fast, as the onCardSwiped() is called with a delay on fast swiping.

If a user swipes fast, by the time the user is on his 3rd swipe, the onCardSwiped() method get called on behalf of the 1st swipe.

I tried to disable swipes until the onCardSwiped() get called, like in the following code snippet, but it's not working as the current swipe get disabled too.

        `mCardsViewListener = new CardStackView.CardEventListener() {
            @Override
            public void onCardDragging( float percentX, float percentY ) {
                if ( percentX >= 0.75 || percentX <= -0.75 ) {
                    mCardsView.setSwipeEnabled( false );
                }
            }
    
            @Override
            public void onCardSwiped( SwipeDirection direction ) {
                mCardsView.setSwipeEnabled( true );
                // Some code to handle swiped card goes here...
            }
    
            @Override
            public void onCardReversed() {
                Log.d( TAG, "onCardReversed" );
            }
    
            @Override
            public void onCardMovedToOrigin() {
                Log.d( TAG, "onCardMovedToOrigin" );
            }
    
            @Override
            public void onCardClicked( int index ) {
                Log.d( TAG, "onCardClicked: " + index );
            }
        };`

Is there a simple solution for this issue?
Thanks a lot

how to get visible card by position

hi, i'm using app:stackFrom="top"
and i need to get the root view of the card that is located under current card. how can i do it?
I can get current card using getTopView

btw thanks for good library

Cannot set visibleCount to 1

I set app:visibleCount="1"

Expected result: after the card was swiped all the way out of the screen, the next one will show.

Current result: as soon as the card is about to exit the screen, the app crushes.

Recyclerview

Hi team,

It was awesome library. But i need to know, will this adapter support for recycler view.

How to add an action to a swipe?

How do i add a specific action when the user swipes to a certain direction?
I want the swipe to perform a task. how can i do that?

re-adding an item doesn't work

Whenever I add an item, remove it, and adding another one, doesn't work.

After debugging for a bit, I've discovered it's related to topIndex, because once you remove an item from the adapter, this index is not updated. I'll try to fork the lib and dig into it, but if you could have a look would be amazing :-)

Thanks in advance.

Blinking effects on touch event

I want to start with thank you for making this library.

Now the issue, If i were to click or drag the card, a flickering/blinking effect will occur, I noticed that this only happened when my card is rich with layouts (layouts within layouts).

No flickering happened if its just a simple tree layout though just like in the demo. I tried to make mine simple but some widget like Ratingbar is still flickering inside the card, any solutions?

Overlay applies to CardStackView instead of just the CardView

Hey,
First, very nice work with this library!

I'm trying to achieve overlay effect only at the CardView, e.g: changing its color while swiping left/right.
Currently the color change effects all the CardStackView and it looks bad if you have a CardView which is half size the total CardStackView.

Also, is it possible to add overlay effect to top/bottom drag aswell?

App crashes using CoordinatorLayout

Using the CoordinatorLayout in the card item xml makes the app to crash.
Just try to add a CoordinatorLayout in the item_tourist_spot_card.xml in the sample project, and see the issue.

getting current object

Hi, wonderful library. I have a question, how do i get object for current card? Also, how do i disable top swipe?
Thanks.

Fast swiping procduces null pointer

NullPointer logcat on fast swiping

java.lang.NullPointerException: Attempt to invoke interface method 'android.view.ViewParent android.view.ViewParent.getParent()' on a null object reference
                                                                                  at com.yuyakaido.android.cardstackview.internal.CardContainerView.onTouchEvent(CardContainerView.java:91)
                                                                                  at android.view.View.dispatchTouchEvent(View.java:10110)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2776)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2408)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2810)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2782)
                                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2422)
                                                                                  at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:435)
                                                                                  at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1836)
                                                                                  at android.app.Activity.dispatchTouchEvent(Activity.java:3072)
                                                                                  at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
                                                                                  at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
                                                                                  at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:397)
                                                                                  at android.view.View.dispatchPointerEvent(View.java:10341)
                                                                                  at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4928)
                                                                                  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4787)
                                                                                  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4293)
                                                                                  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4346)
                                                                                  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4312)
                                                                                  at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4459)
                                                                                  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4320)
                                                                                  at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4516)
                                                                                  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4293)
                                                                                  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4346)
                                                                                  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4312)
                                                                                  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4320)
                                                                                  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4293)
                                                                                  at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6817)
                                                                                  at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6791)
                                                                                  at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6734)
                                                                                  at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6989)
                                                                                  at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
                                                                                  at android.os.MessageQueue.nativePollOnce(Native Method)
                                                                                  at android.os.MessageQueue.next(MessageQueue.java:328)
                                                                                  at android.os.Looper.loop(Looper.java:148)
                                                                                  at android.app.ActivityThread.main(ActivityThread.java:6361)
                                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                              	at com.android.internal.

Disable left or right swipe?

Hello again,

I have a question regarding swipe direction.
I know there is

<com.yuyakaido.android.cardstackview.CardStackView
    app:swipeEnabled="true"
    or
    app:swipeEnabled="false"/>

OR

CardStackView#setSwipeEnabled(true);
or
CardStackView#setSwipeEnabled(false);

for enable or disable swipe.

But is there any way I can allow swiping only in one direction?
i.e, if I can disable swipping to right and only allow to swipe left or viceversa.

Thanks.

Swipe is buggy (Not smooth)

Swipe is not smooth in some android devices like OPPO CPH1701. How to make the swipe smoother in all devices?

Card gets hanged

Thanks for the wonderful library.

I faced an issues in case we swipe the card partially to the bottom and without releasing our card if we minimise our app using the home button of device and come back again to the app, the card remains stuck and does not returns to the original position.

Bug on quadrant detected after automatic swipe

Thank you for the code, is very nice!

I noticed that using the automatic swipe CardStackView.swipe, the quadrant result on the callback onCardSwiped is always BottomLeft, indipendently of the SwipeDirection used.

Elevation cards

How can I remove the card's elevation to set cardview in fullscreen?

Thx

Disable Vertical Swipe

Hi,
First of all thanks to this awesome library, I just want to develop animation like Bumble App, to acheive this i have to disable card swiping vertically ( Up and down ). Please suggest some method to this
Thanks
Rajat Arora

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.