The attached project warps the bare essentials of this Github project. There are files in the /Objects/res/xxx folders that are write protected and that the project depends on. Thus, if you want to use this project you need to use it as your base to start working from.
It raises a toggle event in the B4A project whenever the "like" view is clicked.
Posting the following:
1. The B4A project demonstrating this wrapper
2. The library files (2 x jar and 1 x xml) - copy them to your additional library folder.
3. The Java code - change it to your liking.
Below some pics of the animation that I caught in action:
The library as it stands at present:
LikeButtonView
Author: Github: Miroslaw Stanek, Wrapped by: Johan Schoeman
Version: 1
Sample Code:
It raises a toggle event in the B4A project whenever the "like" view is clicked.
Posting the following:
1. The B4A project demonstrating this wrapper
2. The library files (2 x jar and 1 x xml) - copy them to your additional library folder.
3. The Java code - change it to your liking.
Below some pics of the animation that I caught in action:
The library as it stands at present:
LikeButtonView
Author: Github: Miroslaw Stanek, Wrapped by: Johan Schoeman
Version: 1
- LikeAnimation
Events:- like_toggled
- ba As BA
- BringToFront
- DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
- Initialize (EventName As String)
- 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)
- Background As Drawable
- Color As Int [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int
Sample Code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aLikeButtonView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private lbv1 As LikeAnimation
Private lbv2 As LikeAnimation
Private lbv3 As LikeAnimation
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("main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub lbv1_like_toggled
Log("lbv1 toggled")
End Sub
Sub lbv2_like_toggled
Log("lbv2 toggled")
End Sub
Sub lbv3_like_toggled
Log("lbv3 toggled")
End Sub
Attachments
Last edited: