A wrap for this Github project. Posting:
1. B4A sample project
2. B4A library files.
Take note of the B4A project's /Objects/res/... folder and the files they contain.
Sample code:
Library:
ShineButton
Author: Github: Chad Song, Wrapped by: Johan Schoeman
Version: 1
1. B4A sample project
2. B4A library files.
Take note of the B4A project's /Objects/res/... folder and the files they contain.
Sample code:
B4X:
#Region Project Attributes
#ApplicationLabel: ShineButton
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#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 sb1 As ShineButton
Private sb2 As ShineButton
Private sb3 As ShineButton
Private sb4 As ShineButton
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")
sb1.ShapeResource = "heart"
sb1.BtnColor = Colors.Gray
sb1.BtnFillColor = Colors.Red
sb1.AllowRandomColor = True
sb1.EnableFlashing = True
sb1.BigShineColor = Colors.Yellow
sb1.ClickAnimDuration = 200
sb1.AnimDuration = 1000
sb1.ShineTurnAngle = 180
sb1.SmallShineColor = Colors.Green
sb2.ShapeResource = "like"
sb2.BtnColor = Colors.Gray
sb2.BtnFillColor = Colors.Blue
sb2.AllowRandomColor = True
sb2.EnableFlashing = True
sb2.BigShineColor = Colors.Green
sb2.ClickAnimDuration = 200
sb2.AnimDuration = 1000
sb2.ShineTurnAngle = 180
sb2.SmallShineColor = Colors.Yellow
sb3.ShapeResource = "smile"
sb3.BtnColor = Colors.Gray
sb3.BtnFillColor = Colors.Yellow
sb3.AllowRandomColor = True
sb3.EnableFlashing = True
sb3.BigShineColor = Colors.Red
sb3.ClickAnimDuration = 200
sb3.AnimDuration = 1000
sb3.ShineTurnAngle = 180
sb3.SmallShineColor = Colors.Green
sb4.ShapeResource = "star"
sb4.BtnColor = Colors.Gray
sb4.BtnFillColor = Colors.Green
sb4.AllowRandomColor = True
sb4.EnableFlashing = True
sb4.BigShineColor = Colors.Magenta
sb4.ClickAnimDuration = 200
sb4.AnimDuration = 1000
sb4.ShineTurnAngle = 180
sb4.SmallShineColor = Colors.Red
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub sb1_check_changed (check As Boolean)
Log("Button sb1 status = " & check)
'If check = True Then sb1.Checked = False
End Sub
Sub sb1_button_clicked
Log("sb1 clicked")
End Sub
Sub sb2_check_changed (check As Boolean)
Log("Button sb2 status = " & check)
'If check = True Then sb2.Checked = False
End Sub
Sub sb2_button_clicked
Log("sb2 clicked")
End Sub
Sub sb3_check_changed (check As Boolean)
Log("Button sb3 status = " & check)
'If check = True Then sb3.Checked = False
End Sub
Sub sb3_button_clicked
Log("sb3 clicked")
End Sub
Sub sb4_check_changed (check As Boolean)
Log("Button sb4 status = " & check)
'If check = True Then sb4.Checked = False
End Sub
Sub sb4_button_clicked
Log("sb4 clicked")
End Sub
Library:
ShineButton
Author: Github: Chad Song, Wrapped by: Johan Schoeman
Version: 1
- ShineButton
Events:- button_clicked, check_changed (check As Boolean)
- 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)
- setCancel
- showAnim
- AllowRandomColor As Boolean [write only]
- AnimDuration As Int [write only]
- Background As Drawable
- BigShineColor As Int [write only]
- BtnColor As Int [write only]
- BtnFillColor As Int [write only]
- Checked As Boolean [write only]
- ClickAnimDuration As Int [write only]
- Color As Int [write only]
- EnableFlashing As Boolean [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- Parent As Object [read only]
- ShapeResource As String [write only]
- ShineCount As Int [write only]
- ShineDistanceMultiple As Float [write only]
- ShineTurnAngle As Float [write only]
- SmallShineColor As Int [write only]
- SmallShineOffAngle As Float [write only]
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int