A wrap for this Github project. Extract DemoRes.zip, LibRes.zip, and resource.zip and then copy the folders (with their contents) to be on the same folder level as that of the /Files and /Objects folders of the B4A project. Take note of the B4A manifest file.
You need to enable DesignSupport (V2.00) and AppCompat (V3.20) for the project to work. Copy the attached library files to your additional library folder.
Sample code:
Library:
SwitchDateTimePicker
Author: Github: Jeremy JAMET, Wrapped by: Johan Schoeman
Version: 1
What it looks like on KitKat:
What it looks like on Lollipop:
You need to enable DesignSupport (V2.00) and AppCompat (V3.20) for the project to work. Copy the attached library files to your additional library folder.
Sample code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aSwitchDateTimePicker
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: ..\LibRes
#AdditionalRes: ..\DemoRes
'#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'#AdditionalRes: C:\Android\extras\google\google-play-services\libproject\google-play-services_lib\res, com.google.android.gms
'#AdditionalRes: C:\Android\extras\android\support\design\res, android.support.design
'#ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby
'#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .gcm, .maps, .panorama
'#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.
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 Button1 As Button
Dim sdtp As SwitchDateTimePicker
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")
sdtp.Initialize("sdtp")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
sdtp.Start_Picker
End Sub
Sub sdtp_selected_date_time(year As Int, month As Int, day As Int, hour As Int, minute As Int, full_date As String)
Log("YEAR = " & year)
Log("MONTH = " & month)
Log("DAY = " & day)
Log("HOUR = " & hour)
Log("MINUTE = " & minute)
Log("FULL DATE = " & full_date)
End Sub
Sub sdtp_cancelled
Log("CANCELLED")
End Sub
Library:
SwitchDateTimePicker
Author: Github: Jeremy JAMET, Wrapped by: Johan Schoeman
Version: 1
- SwitchDateTimePicker
Events:- cancelled
- selected_date_time (year As Int, month As Int, day As Int, hour As Int, minute As Int, full_date As String)
- Initialize (paramString As String)
- IsInitialized As Boolean
- Start_Picker
What it looks like on KitKat:
What it looks like on Lollipop:
Attachments
Last edited: