B4A Library [B4X] [XUI] AS Swipe Card - a tinder like swipeable card view [Payware]

alimanam3386

Active Member
Licensed User
Longtime User
How can I fix the size of ASSwipeCard1.CardBackground ?

 

Attachments

  • Card_Example.zip
    2.9 KB · Views: 297

Alexander Stolte

Expert
Licensed User
Longtime User
How can I fix the size of ASSwipeCard1.CardBackground ?
i'm lost, last time i used the iamir_glide i used the hosted builder and I was wondering why I can't compile...
How can I fix the size of ASSwipeCard1.CardBackground ?
by using this, a sleep:
B4X:
    Sleep(250)
    ASSwipeCard1.IniParent(xpnl_swipecard_background)
because the layout is resizing with a animation if you start the page...
It is not without reason that i have built a sleep into the example project at the beginning.

The view looks nice with the images.
 

alimanam3386

Active Member
Licensed User
Longtime User

Works nice thank you so much. I made a small donate for your fantastic job.
 

ykucuk

Well-Known Member
Licensed User
Longtime User
Hello,
I have 2 questions.
1- i tried add CustomListView or scrollview into xpnl_cardbase but unfortunately it didn't work. Is there way to add such view into xpnl_cardbase.
2-is it possible show icon or paint xpnl_cardbase (red /green) during swipe event
 

Alexander Stolte

Expert
Licensed User
Longtime User
1- i tried add CustomListView or scrollview into xpnl_cardbase but unfortunately it didn't work. Is there way to add such view into xpnl_cardbase.
No, not without losing the touch gestures.
2-is it possible show icon or paint xpnl_cardbase (red /green) during swipe event
The " SwipeStateChanged" is triggered when you swipes or returns to the neutral position.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.02
    • Add Event "SwipeStateChange" - Triggers when the card is moved with the finger in one direction e.g. LEFT,RIGHT,TOP,BOTTOM or NEUTRAL
    • Event "SwipeStateChanged" - Triggers now only when the user has released the card
    • Add Clear - clears all cards
 

alimanam3386

Active Member
Licensed User
Longtime User

the attached file has password ?
 

Alexander Stolte

Expert
Licensed User
Longtime User

Alexander Stolte

Expert
Licensed User
Longtime User
Can one swipe the cards randomly depending on a timer? For example, id like to use them on my main activity as soon as it starts and they can just play a loop.
you can set the CurrentIndex, example:
B4X:
ASSwipeCard1.CurrentIndex = Rnd(0,ASSwipeCard1.Size -1)
 

Drago Bratko

Active Member
Licensed User
Longtime User
No, read the text below, it says why.
Yes, that's true in scenario when control is used to 'remove' the card from the list.

In my case, I have bunch of cards, and swipe left moves to the previous card (if on the first, go to last) and swipe right moves to next card (if on last, move to the first).
What do you suggest, how can I implement that?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • V1.03
    • get CurrentIndex is now readable
In my case, I have bunch of cards, and swipe left moves to the previous card (if on the first, go to last) and swipe right moves to next card (if on last, move to the first).
What do you suggest, how can I implement that?
B4X:
Private Sub ASSwipeCard1_SwipeStateChanged(state As Int)
    If state = ASSwipeCard1.SwipeState_LEFT Then
        ASSwipeCard1.CurrentIndex = ASSwipeCard1.CurrentIndex +1
    End If
End Sub
-SwipeStateChanged - Triggers only when the user has released the card
 

Drago Bratko

Active Member
Licensed User
Longtime User
-SwipeStateChanged - Triggers only when the user has released the card

You are more than great! Thank you.

Now, only issue which I see is when I slide to right (so I go one card back), then first is shown next card for a split of a second, and then it's replaced with previous one.
Any idea how to handle that?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…