Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to create stack. #27

Closed
harminderclabs opened this issue Dec 11, 2014 · 5 comments
Closed

how to create stack. #27

harminderclabs opened this issue Dec 11, 2014 · 5 comments

Comments

@harminderclabs
Copy link

I want to create a stack of 3 cards to be shown at once i.e little layer of below card to be shown.
So user get to know that there is more cards below.

Your library do have methods of class SwipeFlingAdapterView but these doesn't work or this indicate something different that I am not able to understand.

  1. setMinStackInAdapter(3);
  2. setMaxVisible(3);

Please help if there is any method regarding this.

Thanks in Advance.

@Diolor
Copy link
Owner

Diolor commented Dec 19, 2014

The maxVisible is the number of cards drawn. The MinStackInAdapter is the remainder number of cards that you will allow before create e.g. a network call to your API endpoint.

In order to do the 100% same behavior like Tinder (with 1 visible and 2 subtly visible) you need to change the drawing location on the AdapterView of the 1,2,3 first cards separately.

If you want to add the animation 4th card becoming -> 3rd card then you have to redraw those cards on the Listener file which controls the touches.

Hope it helps.

@jainrocks
Copy link

@Diolor Can you please explain it, I am unable to understand how these cards are placed in the layout and method onAdapterAboutToEmpty() is called only when I am on card "CSS" after removing the initial 6 cards according to example, it doesn't matter whether app:min_adapter_stack="6" or 5 or 1 used.

@kh0r
Copy link

kh0r commented May 20, 2015

Quick and dirty:

        arrayAdapter = new ArrayAdapter<String>(this, R.layout.item, R.id.helloText, al ) {
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                View v = super.getView(position, convertView, parent);
                // make a nice stack of cards
                v.setTranslationY(position*10);
                return v;
            }
        };

@hy9be
Copy link

hy9be commented Jul 25, 2015

@kh0r I set a drawable as the border of the card. Using setTranslationX, setTranslationY, the border drawable is still presented after I swiped and removed the card. Any idea?

@hy9be
Copy link

hy9be commented Jul 25, 2015

@kh0r I had it resolved by calling the invalidate() method of SwipeFlingAdapterView in removeFirstObjectInAdapter callback. But do have performance concern.

@Diolor Diolor closed this as completed Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants