This is a wrap for this github project. I got inspired by the lib posted and i found it nice... So i build it
SwipeCard
Version: 1
This library is Donationware. You can download the library, you can test the library. But if you want to USE the library in your App you need to Donate for it.
Please click here to donate (You can donate any amount you want to donate for the library (or my work)
SwipeCard
Version: 1
- Card
Methods:- Initialize (Name As CharSequence, Image As String, color As Int, bgcolor As Int)
- IsInitialized As Boolean
- SwipeCardView
Events:- onAdapterAboutToEmpty (itemsInAdapter As Int)
- onCardExit (position As String, dataObject As Object)
- onItemClicked (position As Int, dataObject As Object)
- onScroll (scrollProgressPercent As Float)
- ba As BA
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String, cards As ArrayList)
- Invalidate
- Invalidate2 (arg0 As Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As Bitmap)
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- addListener
- restart
- setAdapterItems (cards As ArrayList)
- throwBottom
- throwLeft
- throwRight
- throwTop
- Background As Drawable
- Color As Int [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- MaxVisible As Int [write only]
- MinStackInAdapter As Int [write only]
- Padding()() As Int
- Parent As Object [read only]
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int
B4X:
[CODE]Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private SwipeCard As SwipeCardView
Dim cs As CSBuilder
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
Dim cards As List
cards.Initialize
Dim c1 As Card
'cs.Initialize.Typeface(Typeface.FONTAWESOME).Color(0xFF01FF20).Size(40).Append(Chr(0xF17B)).popall
c1.Initialize(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(20).Color(0xFF01FF20).Append(Chr(0xF17B)).Append(" rulez!").PopAll,"androidapple", Colors.Black, Colors.Gray)
cards.Add(c1)
Dim c2 As Card
c2.Initialize("Face 1","faces1", Colors.White, Colors.Black)
cards.Add(c2)
Dim c3 As Card
c3.Initialize("Face 2","faces2", Colors.Black, Colors.White)
cards.Add(c3)
Dim c4 As Card
c4.Initialize("Face 3","faces3", Colors.Black, Colors.White)
cards.Add(c4)
Dim c5 As Card
c5.Initialize("Face 4","faces4", Colors.Black, Colors.White)
cards.Add(c5)
Dim c6 As Card
c6.Initialize("Face 5","faces5", Colors.Black, Colors.White)
cards.Add(c6)
Dim c7 As Card
c7.Initialize("Face 6","faces6", Colors.Black, Colors.White)
cards.Add(c7)
Dim c8 As Card
c8.Initialize("Face 7","faces7", Colors.Black, Colors.White)
cards.Add(c8)
Dim c9 As Card
c9.Initialize("Face 8","faces8", Colors.Black, Colors.White)
cards.Add(c9)
Dim c10 As Card
c10.Initialize("Face 9","faces9", Colors.Black, Colors.White)
cards.Add(c10)
Dim c11 As Card
c11.Initialize("Face 10","faces10", Colors.Black, Colors.White)
cards.Add(c11)
Dim c12 As Card
c12.Initialize("Face 11","faces11", Colors.Black, Colors.White)
cards.Add(c12)
SwipeCard.setAdapterItems(cards)
SwipeCard.addListener
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub SwipeCard_onItemClicked(position As Int, dataObject As Object)
Log($"SwipeCard_onItemClicked(${position})"$)
End Sub
Sub SwipeCard_onCardExit(position As String, dataObject As Object)
Log($"SwipeCard_onCardExit(${position})"$)
End Sub
Sub SwipeCard_onAdapterAboutToEmpty(itemsInAdapter As Int)
Log($"SwipeCard_onAdapterAboutToEmpty(${itemsInAdapter})"$)
If itemsInAdapter = 0 Then
SwipeCard.restart
End If
End Sub
Sub SwipeCard_onScroll(scrollProgressPercent As Float)
'Log($"SwipeCard_onScroll(${scrollProgressPercent})"$)
End Sub
This library is Donationware. You can download the library, you can test the library. But if you want to USE the library in your App you need to Donate for it.
Please click here to donate (You can donate any amount you want to donate for the library (or my work)
Attachments
Last edited: