Giter Site home page Giter Site logo

viewpagercards's Introduction

ViewPagerCards

ViewPager cards inspired by Duolingo

From my blog post: https://rubensousa.github.io/2016/08/viewpagercards

This is just a sample project.

There's support included for Fragments and normal Views. Check the CardPagerAdapter and CardFragmentPagerAdapter classes.

Left - Duolingo implementation

Right - This sample

What you could do with this:

  1. Showcasing premium features
  2. An app intro
  3. A small gallery of images

License

Copyright 2016 Rúben Sousa

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.

viewpagercards's People

Contributors

rubensousa 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  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

viewpagercards's Issues

Button Config

Sorry to disturb Ruben, but I had 1 more question.
for example: When u click on cool card it should open another page or print toast. if clicked some other card it does something else.

I have been trying it since you added array list system but no luck

// Fixed it

Display multiple view-pages at the same time.

Hi,

Thank you for the lovely implementation.
I was trying around with the code aiming to display 2 or more views at the same time and all the centre views having scaling enables.

I tried with
@OverRide
public float getPageWidth(int position) {
return super.getPageWidth(position) / 2;
}

in the adapter, but it isn't working as intended.

So if you get a chance to look into this, do share.
Thanks

Rtl ViewPager

Hi Thank you for your nice solution.
How can i set ShadowTransformer for Rtl ViewPager?

How to add new fragment

I want to add a new Card Fragment named CardFragment2 , how do i add like similier:

addCardFragment(new CardFragment2));
for(int i = 0; i< 2; i++){
addCardFragment(new CardFragment());
}

Setting different texts to each card

Hello,

Thanks for the implementation, it is of great help.

I am having some trouble with changing the content of each card dynamically. not from the layout xml. I would like to set different texts to each card. How can I achive this by using the adapter you've designed?

Thank you

Card align left

Hi,
great library.

Is it possible to make the first card align to the left rather than center ?

I try this, but does not work;

<android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/line_color"
            android:layout_gravity="start"
            android:gravity="start"
            android:clipToPadding="false"
            android:overScrollMode="never"
            android:paddingEnd="@dimen/card_padding"
            android:paddingLeft="@dimen/card_padding"
            android:paddingRight="@dimen/card_padding"
            android:paddingStart="@dimen/card_padding" />
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/tools"
    android:id="@+id/cardView"
    app:cardUseCompatPadding="true"
    android:layout_width="436dp"
    android:layout_height="match_parent"
    android:layout_gravity="left">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:weightSum="1"
            android:gravity="start|left"
            android:layout_gravity="left">
...

Thanks

ViewPager card distance

Hi, great tutorial you wrote!

I was wondering if it's possible to increase the distance between the fragments in the viewpager?

How do you Know the swiped card details

How do you Know the swiped card details.
when i swipe cards i want know the card details
EX: card name like 1 , 2 , 3, 4 .....
when i swipe need show the card name in toast ..help me

Buttons and Images

Hi
There are two problems with the source:
Can't use buttons for starting activities.
Can't use Images for each cards:
mCardAdapter.addCardItem(new CardItem(R.string.title_1, R.string.title_1 ));
I want use images for second argument.

How can I do these?

Card view scale

Hi...
how to set default scaleX/scaleY to 1.1f without using the checkbox ??

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.