Comments (8)
@dsuresh-ap The name getTopIndex
is a little confusing, this method returns adapter index displaying on top of card stack.
For example,
- An adapter has 10 items
- You swiped twice
- Third card is displayed on top
In this situation, getTopIndex returns 3.
If you want to know more detail, please see sample app in this repository.
from cardstackview.
@jemshit getTopIndex() - 1
should return the index of the swiped Object in your adapter
from cardstackview.
@ShrikantBadwaik-007 Thanks 😎
You can get top card by using CardStackView#getTopView()
.
If you want to disable swipe, call CardContainerView#setDraggable(boolean)
.
But, CardContainerView#setDraggable(boolean)
is an internal API, so this is subject to change without notice in future release.
from cardstackview.
method call you have mentioned gives me object of CardContainerView but that's not what i'm asking. Say, I have list of Profiles which i'm displaying in cardstackview, so how do i get object of Profile for the currently displayed card?
from cardstackview.
@ShrikantBadwaik-007 Oh, I misunderstood.
CardStackView doesn't have a method to return object like a Profile. But, CardStackView#getTopIndex()
returns top index of card stack, this index can be used as list index.
from cardstackview.
@yuyakaido Would there be a point where getTopIndex() would return a value other than 0? Since it is a stack wouldn't the top index always be 0?
from cardstackview.
@ShrikantBadwaik-007 When a card is swiped, I get the first item from my adapter
from cardstackview.
Hi @yuyakaido , is there any way to get index of swiped item?
from cardstackview.
Related Issues (20)
- how to set directions when i use swipe ?
- How can i use page indicator HOT 1
- Solution: Horizontal Scrolling Inside a Card
- How to obscure or add an overlay on top of the stack cards? HOT 1
- When i drag a card others views around the cardstacklayout cover the animation
- Issue when remove jcenter HOT 1
- Failed to resolve: com.yuyakaido.android:card-stack-view:2.3.4 HOT 2
- How to implement onCardClicked(int index) in the RecyclerView items? HOT 2
- Build Error maybe cannot find repo HOT 4
- stackFrom wont work
- No adapter attached; skipping layout HOT 1
- How to show previous card when swipe left HOT 2
- Is ther anyone who ran into 'rendering problems'? HOT 7
- How to disable Right Swipe. HOT 1
- java.lang.IllegalArgumentException Cannot set 'scaleX' to Float.NaN HOT 1
- Dependency from README doesn't work. HOT 2
- Scrollview inside cradStackView automatically get scrolled on swipe HOT 2
- Multiple automatic swipes not working HOT 2
- Vertical Recycler View
- Library not working on targetSdk 34 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cardstackview.