Here is a small wrap for this Github project. Posting the following:
1. B4A project
2. B4A library files - copy them to your additional library folder
3. AdditionalLibsResource.zip - extract the folder and copy the folder to the root of your additional library folder.
4. The Java code - change it to your liking. Note that you need to create a libs folder on the same folder level as the src folder and then copy android-support-v4.jar and android-support-v7-appcompat.jar into the libs folder in order to compile the Java code.
I have made a simple "digital" clock with it for demonstration purposes.
Sample Code:
Library:
NumberMorphView
Author: Github: Even201314, Wrapped by: Johan Schoeman
Version: 1
1. B4A project
2. B4A library files - copy them to your additional library folder
3. AdditionalLibsResource.zip - extract the folder and copy the folder to the root of your additional library folder.
4. The Java code - change it to your liking. Note that you need to create a libs folder on the same folder level as the src folder and then copy android-support-v4.jar and android-support-v7-appcompat.jar into the libs folder in order to compile the Java code.
I have made a simple "digital" clock with it for demonstration purposes.
Sample Code:
B4X:
#Region Project Attributes
#ApplicationLabel: NumberMorphView
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: C:\Users\----------2\Documents\Basic 4 Android\JOHAN APPS\JHS LIBS\resource\b4a_appcompat, de.amberhome.objects.appcompat
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\design\res, android.support.design
#Extends: android.support.v7.app.AppCompatActivity
#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.
Dim t As Timer
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 nmv1 As NumberMorphView
Private nmv2 As NumberMorphView
Private nmv3 As NumberMorphView
Private nmv4 As NumberMorphView
Private nmv5 As NumberMorphView
Private nmv6 As NumberMorphView
Dim prevsec As Long
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")
t.Initialize("t", 10)
nmv6.NumberColor = Colors.Green
nmv6.NumberStrokeWidth = 12
nmv5.NumberColor = Colors.Red
nmv5.NumberStrokeWidth = 12
nmv4.NumberColor = Colors.Blue
nmv4.NumberStrokeWidth = 12
nmv3.NumberColor = Colors.Yellow
nmv3.NumberStrokeWidth = 12
nmv2.NumberColor = Colors.Cyan
nmv2.NumberStrokeWidth = 12
nmv1.NumberColor = Colors.Magenta
nmv1.NumberStrokeWidth = 12
End Sub
Sub Activity_Resume
t.Enabled = True
prevsec = DateTime.GetSecond(DateTime.Now)
End Sub
Sub Activity_Pause (UserClosed As Boolean)
t.Enabled = False
End Sub
Sub t_tick
Dim hr As Long = DateTime.GetHour(DateTime.Now)
Dim mn As Long = DateTime.GetMinute(DateTime.Now)
Dim sec As Long = DateTime.GetSecond(DateTime.Now)
If sec <> prevsec Then
prevsec = sec
nmv6.CurrentNumber = sec mod 10
nmv5.CurrentNumber = (sec - (sec mod 10)) / 10
nmv4.CurrentNumber = mn mod 10
nmv3.CurrentNumber = (mn - (mn mod 10)) / 10
nmv2.CurrentNumber = hr mod 10
nmv1.CurrentNumber = (hr - (hr mod 10)) / 10
End If
End Sub
Library:
NumberMorphView
Author: Github: Even201314, Wrapped by: Johan Schoeman
Version: 1
- NumberMorphView
Fields:- 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]
- CurrentNumber As Int [write only]
- Enabled As Boolean
- Height As Int
- Left As Int
- NumberColor As Int [write only]
- NumberStrokeWidth As Int [write only]
- Parent As Object [read only]
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int