How to implement Actionbar and ViewPager as in Tinder

2

I need to implement a ActionBar and ViewPager as in Tinder.

When Tinder opens, you can slide through all the tabs.

The second tab is a ListView or a ListFragment and when you tap an item, it is taken to another series of tabs. You can slide back and it will be in the previous tab series.

How can I do this smoothly and elegantly?

    
asked by anonymous 02.03.2016 / 18:32

1 answer

0

I selected this Lib: CardStackView

  

How to use

Declare the layout

<com.yuyakaido.android.cardstackview.CardStackView
    android:id="@+id/activity_main_card_stack"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="30dp"
    android:clipChildren="false"
    android:clipToPadding="false"/>

Now implement the Reverse Button.

final CardStackView cardStackView = (CardStackView) findViewById(R.id.activity_main_card_stack_view);
cardStackView.setAdapter(adapter);

View reverseButton = findViewById(R.id.activity_main_reverse_button);
reverseButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        cardStackView.reverse();
    }
});

This is the easiest way to implement, however the above link has explanations of custom deployments.

    
13.12.2016 / 19:37