Giter Club home page Giter Club logo

androidswipeablecardstack's Introduction

AndroidSwipeableCardStack

Android Arsenal

Change log:

  • provide option to infinitly swipe in a loop
  • card rotation setting
  • card gravity setting
  • undo animation

Thanks for contributions from: https://github.com/raee https://github.com/rebus007

image

A tinder like swipeable card stack component. Provide "swipe to like" effects. Easy to customize card views.

See youtube demo : https://www.youtube.com/watch?v=YsMnLJeouf8&feature=youtu.be A Demo App is also included in the source.

Installation

Use jitpack

repositories {
   maven { url "https://jitpack.io" }
}

dependencies {
   compile 'com.github.wenchaojiang:AndroidSwipeableCardStack:0.*.*'
}

OR manually

  1. Download released .aar file [Download current release] (https://github.com/wenchaojiang/AndroidSwipeableCardStack/releases/)

  2. put it into your project lib dir, "libs" for example.

  3. put following lines to your gradle.build file

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile(name:'android-card-stack-0.*.*', ext:'aar')
}

Configuration

Put CardStack in your layout file

<com.wenchao.cardstack.CardStack
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:gravity="center"
        android:padding="10dp"
        app:card_enable_loop="true"
        app:card_enable_rotation="true"
        app:card_gravity="top"
        app:card_margin="10dp"
        app:card_stack_size="4"/>

Create your card view layout file.

Example: card_layout.xml, contain only a TextView

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    />

</LinearLayout>

Implement your own adapter for the card stack. The CardStack will accept ArrayAdapter. The Following example extends a simple ArrayAdapter, overriding getView() to supply your customized card layout

public class CardsDataAdapter extends ArrayAdapter<String> {

    @Override
    public View getView(int position, final View contentView, ViewGroup parent){
        //supply the layout for your card
        TextView v = (TextView)(contentView.findViewById(R.id.content));
        v.setText(getItem(position));
        return contentView;
    }

}

Get the CardStack instance in your activity

  protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);

        mCardStack = (CardStack)findViewById(R.id.container);

        mCardStack.setContentResource(R.layout.card_content);
        mCardStack.setStackMargin(20);
        
  }

Finally, set the adapter

    mCardAdapter = new CardsDataAdapter(getApplicationContext(),0);
    mCardAdapter.add("test1");
    mCardAdapter.add("test2");
    mCardAdapter.add("test3");
    mCardAdapter.add("test4");
    mCardAdapter.add("test5");
    
    mCardStack.setAdapter(mCardAdapter);

Listening to card stack event

implement CardStack.CardEventListener, and set it as listener mCardStack.setListener(yourListener);

Class YourListener extends CardStack.CardEventListener{
    //implement card event interface
    @Override
    public boolean swipeEnd(int direction, float distance) {
        //if "return true" the dismiss animation will be triggered 
        //if false, the card will move back to stack
        //distance is finger swipe distance in dp
        
        //the direction indicate swipe direction
        //there are four directions
        //  0  |  1
        // ----------
        //  2  |  3
        
        return (distance>300)? true : false;
    }

    @Override
    public boolean swipeStart(int direction, float distance) {
    
        return true;
    }

    @Override
    public boolean swipeContinue(int direction, float distanceX, float distanceY) {
        
        return true;
    }

    @Override
    public void discarded(int id, int direction) {
       //this callback invoked when dismiss animation is finished. 
    }
    
    @Override
    public void topCardTapped() {
         //this callback invoked when a top card is tapped by user. 
    }
}

androidswipeablecardstack's People

Contributors

cprakashagr avatar juanpabloprado avatar raee avatar ravidsrk avatar wenchaojiang 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

androidswipeablecardstack's Issues

Control Swipe Direction

I want to enable the swipe direction to be right alone.(i.e right to left). Can you help me?

Updated cloneParams method for better performance in Latest Devices

    public static RelativeLayout.LayoutParams cloneParams(RelativeLayout.LayoutParams params) {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
            return new LayoutParams(params);
        } else {
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(params.width, params.height);
            layoutParams.leftMargin = params.leftMargin;
            layoutParams.topMargin = params.topMargin;
            layoutParams.rightMargin = params.rightMargin;
            layoutParams.bottomMargin = params.bottomMargin;
            int[] rules = params.getRules();
            for (int i = 0; i < rules.length; i++)
                layoutParams.addRule(i, rules[i]);
            //layoutParams.setMarginStart(params.getMarginStart());
            //layoutParams.setMarginEnd(params.getMarginEnd());
            return layoutParams;
        }
    }

Thanks to @GadgetCheck
from https://github.com/GadgetCheck/TinderView

Right Left Listener

Can you please help me...How can i know card is swiped right or swiped left ??
how can i implement that listener ??

regards

Long Card Pressed Listener

is it possible to set a long pressed or double tap listener for top card?

or is it possible for u to include the method of the class "SimpleGestureListener " onLongPress() and onDoubleTap() here -

    class MyGestureListener extends GestureDetector.SimpleOnGestureListener {
    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
                            float distanceY) {
        if(mListener == null) return true;
        if( mStarted == false){
            mListener.onDragStart(e1,e2,distanceX,distanceY);
            mStarted = true;
        }
        else{
            mListener.onDragContinue(e1,e2,distanceX,distanceY);
        }
        mOriginalEvent = e1;
        return true;
    }

    @Override
    public boolean onSingleTapUp(MotionEvent e) {

        return mListener.onTapUp();
    }
}

it will really come in handy for all.
And I need that too for my App.

But Good Work Man!! 👍

Swiping up and down

In addition to the swiping left and right to "like" or "dislike" something, is it possible to also add the ability to swipe up and down for other actions?

Overlays

Is it possible to get the "like" and "dislike" overlays as you swipe left and right, so that the user knows what action they are taking when swiping?

Just a question.

How to change the background color of the generated cards?I would like to set one color. If you could guide me to where the card background color is set or created. That would be appreciated. Cheers.

Drawable ic_launcher

Hi,

After integrating your project by using your instructions:

compile 'com.github.wenchaojiang:AndroidSwipeableCardStack:0.1.1'

I got the next error:

Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher_icon) from AndroidManifest.xml:20:9-48 is also present at [com.github.wenchaojiang:AndroidSwipeableCardStack:0.1.1] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher). Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest.xml:17:5-71:19 to override.

I applied the solution proposed by Android Studio and some other forums I googled including in my Manifest file the next:

<manifest
xmlns:tools="http://schemas.android.com/tools"
....
<application
tools:replace="android:icon"

However, after this, I got the next error:

Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/android-sdk-macosx-r24.1.2/build-tools/22.0.1/aapt'' finished with non-zero exit value 1

I have fully updated my Android Studio installation and all the SDK build-tools. All the forums references I found appoint to the problem is that your project contain the drawable ic_launcher.png and this is causing the error. The propose to rename my ic_launcher file and the folders in which is located. However this does not work and the error remains the same.

Logs

How to disable Debug logs in this one ?

OutOfmemoryError from getContentView when Inflating

That happen when I open and close the activity several times, the memory is not freed

01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: FATAL EXCEPTION: main
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: Process: com.swapcard.apps.android, PID: 25284
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: android.view.InflateException: Binary XML file line #144: Error inflating class
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:633)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.getContentView(CardStack.java:256)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.loadLast(CardStack.java:276)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.access$300(CardStack.java:20)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack$1.onAnimationEnd(CardStack.java:58)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardAnimator$3.onAnimationEnd(CardAnimator.java:180)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:854)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:580)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:549)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5430)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Native Method)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:607)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.getContentView(CardStack.java:256) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.loadLast(CardStack.java:276) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.access$300(CardStack.java:20) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack$1.onAnimationEnd(CardStack.java:58) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardAnimator$3.onAnimationEnd(CardAnimator.java:180) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:854) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:580) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:549) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5430) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: Caused by: java.lang.OutOfMemoryError: Failed to allocate a 64000012 byte allocation with 33554336 free bytes and 53MB until OOM
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:988)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.content.res.Resources.loadDrawableForCookie(Resources.java:2580)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.content.res.Resources.loadDrawable(Resources.java:2487)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.widget.ImageView.(ImageView.java:146)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.widget.ImageView.(ImageView.java:135)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.joooonho.SelectableRoundedImageView.(SelectableRoundedImageView.java:76)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.joooonho.SelectableRoundedImageView.(SelectableRoundedImageView.java:72)
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Native Method) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.getContentView(CardStack.java:256) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.loadLast(CardStack.java:276) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack.access$300(CardStack.java:20) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardStack$1.onAnimationEnd(CardStack.java:58) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.wenchao.cardstack.CardAnimator$3.onAnimationEnd(CardAnimator.java:180) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:854) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1171) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:722) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:738) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:580) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:549) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5430) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913) 
01-20 18:03:54.556 25284-25284/com.swapcard.apps.android E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) 

Get current top view

I have an "like" textview to show when card is swipped to right, but I can´t get the view to apply alpha when needed. How can I do it?

How to Change Images Visibility While in Swipe Action

Hello, I am developing an android app and need to find a solution for tinder like app. When I swipe the card left or right, I also want to change visibility of images which are elements of adapter 's view. Is there any solution you could recommend ?

Undo a Swiped card

First of all, thanks for the awesome library. It is working wonderfully, however, I didn't find any way to undo a recently dismissed card. I want the last dismissed card to be displayed back on a click of a button, if user dismissed it accidentally.

How should I do it?

Invisibility for background cards

Hi,

Is it possible from the existing API to hide the background cards?

Sometime in my app, my top card has a transparent color. The background card cards' child views overlap with my top card child views. Is it possible to hide the background cards and let the top card be only visible at a time?

Control visible cards transparency

I have 3 cards visible at a time. I'd like the top one to have 1.0f alpha, one below it 0.5f alpha and the third in the stack 0.3f alpha. Where in the code is the best place to add this functionality in? Unfortunately animations do not persist this effect without setFillAfter.

I want use this in api lever 14 but there are some error

I want use this in api level 14.There are some error in Androidstudio.
In class CardAnimator 54 line .
baseLayout = new RelativeLayout.LayoutParams(baseLayout);
there is no this method RelativeLayout.LayoutParams(RelativeLayout.LayoutParams source),in api level 14. Can you give some advise to me ?

Rotate the card stack

Is there any way to rotate the card stack, but keeping the touch actions the same?
I tried to .setRotate (180), but the touch actions were reversed as well.

Example:
examplecardstackinverse

Conflict Touch with Viewpager

I have s ViewPager in CardView, How to touch to move the card. It is conflicted touch event between Viewpager swipe and Cardview swipe left and right

Endless Swiping

Is it possible to create an endless swipe ?

When last card appears next card will be first card ?

Please remove the ix_launcher.png

Hi Great work,

Can you please remove the ic_launcher.png file in the library and post it maven as an update.
And how can trigger the swipe events on button clicks say 2 buttons left and right if i press left button card should swipe off to left edge of the screen and right button right edge of the screen.

[Android 4.4.4] [API 19] Top card disappears when trying to swipe it

Hello,

When testing the library on android Kit Kat 4.4.4, API 19 and when trying to swipe the top card. As soon as you hold it to swipe it disappears, although it is not removed because when you remove your finger the card reappears again ( not swiped more than the threshold)

I tried to debug, yet it seems only appearing on 4.4.4 emulator and devices. On 4.1.1 it does not appear. ( I have seen the closed issue where you mentioned that it works now on API 14, but it is not working on API 19 )

Can you please have a look?
Is this a known issue?

Thank you
Elie

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.