rubensousa / viewpagercards Goto Github PK
View Code? Open in Web Editor NEWViewPager cards inspired by Duolingo
License: Apache License 2.0
ViewPager cards inspired by Duolingo
License: Apache License 2.0
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
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
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
when enableScaling,there will be line in card
Is it possible to make selected fragment big but other fragments small smoothly just like this
there is the link of this app http://fir.im/tle2
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
I added androidX and latest gradle Support here at https://github.com/aminPial/ViewPagerCards. You can check that for latest dependencies for this repo.
Cheers!
hi, if i'd like let it cycle, how to fix it
Hi Thank you for your nice solution.
How can i set ShadowTransformer for Rtl ViewPager?
Hey Ruben, Can you please explain with example how to add unique data in each card from an array list or something
i used enableScaling = true but not become effective when data.Size = 1
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());
}
一个card 一个 Fragment ,有什么优缺点 请解释一下?
Hi, i use this ... Great !
but how to add onclick listener for each card view !?
i need go to another activity when click on each card view button !
thanks
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
Hi, is there is any listeners when i swap from one card to next?
how set item width? Disable the item width
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?
Hi, great tutorial you wrote!
I was wondering if it's possible to increase the distance between the fragments in the viewpager?
Hi...
how to set default scaleX/scaleY to 1.1f without using the checkbox ??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.