Skip to content

Commit

Permalink
Converted to B4X Template
Browse files Browse the repository at this point in the history
  • Loading branch information
pyhoon authored May 28, 2022
1 parent e033cd1 commit 075deae
Show file tree
Hide file tree
Showing 25 changed files with 929 additions and 0 deletions.
100 changes: 100 additions & 0 deletions Web API Client/B4A/$APPNAME$.b4a
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Build1=Default,b4a.webapi.client
File1=CategoryItem.bal
File2=MainPage.bal
File3=ProductItem.bal
File4=template_category.json
File5=template_product.json
FileGroup1=Default Group
FileGroup2=Default Group
FileGroup3=Default Group
FileGroup4=Default Group
FileGroup5=Default Group
Group=Default Group
Library1=b4xpages
Library2=b4xpreferencesdialog
Library3=core
Library4=okhttputils2
Library5=xui views
Library6=ime
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="30"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~CreateResourceFromFile(Macro, Themes.LightTheme)~\n~'End of default text.~\n~SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)~\n~CreateResourceFromFile(Macro, Core.NetworkClearText) ' Comment this if using https protocol
Module1=|relative|..\B4XMainPage
Module2=Starter
NumberOfFiles=5
NumberOfLibraries=6
NumberOfModules=2
Version=11.5
@EndOfDesignText@
#Region Project Attributes
#ApplicationLabel: Web API Client
#VersionCode: 4
#VersionName: 1.0.3
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region

'#BridgeLogger: True

Sub Process_Globals
Public ActionBarHomeClicked As Boolean
End Sub

Sub Globals
Private ime As IME
End Sub

Sub Activity_Create(FirstTime As Boolean)
ime.Initialize("IME")
ime.AddHeightChangedEvent
Dim pm As B4XPagesManager
pm.Initialize(Activity)
End Sub

Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
B4XPages.GetManager.RaiseEvent(B4XPages.GetManager.GetTopPage, "IME_HeightChanged", Array(NewHeight, OldHeight))
End Sub

'Template version: B4A-1.01
#Region Delegates

Sub Activity_ActionBarHomeClick
ActionBarHomeClicked = True
B4XPages.Delegate.Activity_ActionBarHomeClick
ActionBarHomeClicked = False
End Sub

Sub Activity_KeyPress (KeyCode As Int) As Boolean
Return B4XPages.Delegate.Activity_KeyPress(KeyCode)
End Sub

Sub Activity_Resume
B4XPages.Delegate.Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
B4XPages.Delegate.Activity_Pause
End Sub

Sub Activity_PermissionResult (Permission As String, Result As Boolean)
B4XPages.Delegate.Activity_PermissionResult(Permission, Result)
End Sub

Sub Create_Menu (Menu As Object)
B4XPages.Delegate.Create_Menu(Menu)
End Sub

#if Java
public boolean _onCreateOptionsMenu(android.view.Menu menu) {
processBA.raiseEvent(null, "create_menu", menu);
return true;

}
#End If
#End Region

'Program code should go into B4XMainPage and other pages.
Binary file added Web API Client/B4A/Files/categoryitem.bal
Binary file not shown.
Binary file added Web API Client/B4A/Files/mainpage.bal
Binary file not shown.
Binary file added Web API Client/B4A/Files/productitem.bal
Binary file not shown.
11 changes: 11 additions & 0 deletions Web API Client/B4A/Files/template_category.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Version": 1.1,
"Theme": "Light Theme",
"Items": [
{
"title": "Name",
"type": "Text",
"key": "Category Name",
"required": true
} ]
}
30 changes: 30 additions & 0 deletions Web API Client/B4A/Files/template_product.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"Version": 1.1,
"Theme": "Light Theme",
"Items": [
{
"title": "Category",
"type": "Options",
"key": "Category",
"required": true
},
{
"title": "Name",
"type": "Text",
"key": "Product Name",
"required": true
},
{
"title": "Code",
"type": "Text",
"key": "Product Code",
"required": true
},
{
"title": "Price",
"type": "Text",
"key": "Product Price",
"required": true
}
]
}
Binary file added Web API Client/B4A/Objects/res/drawable/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions Web API Client/B4A/Starter.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Service
Version=9.85
@EndOfDesignText@
#Region Service Attributes
#StartAtBoot: False
#ExcludeFromLibrary: 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 Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.

End Sub

Sub Service_Start (StartingIntent As Intent)
Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
End Sub

Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
End Sub

'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub

Sub Service_Destroy

End Sub
67 changes: 67 additions & 0 deletions Web API Client/B4J/$APPNAME$.b4j
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
AppType=JavaFX
Build1=Default,b4j.webapi.client
File1=CategoryItem.bjl
File2=icon.png
File3=MainPage.bjl
File4=ProductItem.bjl
File5=template_category.json
File6=template_product.json
FileGroup1=Default Group
FileGroup2=Default Group
FileGroup3=Default Group
FileGroup4=Default Group
FileGroup5=Default Group
FileGroup6=Default Group
Group=Default Group
Library1=b4xpages
Library2=b4xpreferencesdialog
Library3=jcore
Library4=jfx
Library5=xui views
Library6=jokhttputils2
Module1=|relative|..\B4XMainPage
NumberOfFiles=6
NumberOfLibraries=6
NumberOfModules=1
Version=9.5
@EndOfDesignText@
' Version 1.0.3
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region

Sub Process_Globals
Private fx As JFX
Private MainForm As Form
End Sub

Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
Dim PagesManager As B4XPagesManager
PagesManager.Initialize(MainForm)
End Sub

'Template version: B4J-1.0
#Region Delegates
Sub MainForm_FocusChanged (HasFocus As Boolean)
B4XPages.Delegate.MainForm_FocusChanged(HasFocus)
End Sub

Sub MainForm_Resize (Width As Double, Height As Double)
B4XPages.Delegate.MainForm_Resize(Width, Height)
End Sub

Sub MainForm_Closed
B4XPages.Delegate.MainForm_Closed
End Sub

Sub MainForm_CloseRequest (EventData As Event)
B4XPages.Delegate.MainForm_CloseRequest(EventData)
End Sub

Public Sub MainForm_IconifiedChanged (Iconified As Boolean)
B4XPages.Delegate.MainForm_IconifiedChanged(Iconified)
End Sub
#End Region
Binary file added Web API Client/B4J/Files/CategoryItem.bjl
Binary file not shown.
Binary file added Web API Client/B4J/Files/MainPage.bjl
Binary file not shown.
Binary file added Web API Client/B4J/Files/ProductItem.bjl
Binary file not shown.
Binary file added Web API Client/B4J/Files/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Web API Client/B4J/Files/template_category.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Version": 1.1,
"Theme": "Light Theme",
"Items": [
{
"title": "Name",
"type": "Text",
"key": "Category Name",
"required": true
} ]
}
30 changes: 30 additions & 0 deletions Web API Client/B4J/Files/template_product.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"Version": 1.1,
"Theme": "Light Theme",
"Items": [
{
"title": "Category",
"type": "Options",
"key": "Category",
"required": true
},
{
"title": "Name",
"type": "Text",
"key": "Product Name",
"required": true
},
{
"title": "Code",
"type": "Text",
"key": "Product Code",
"required": true
},
{
"title": "Price",
"type": "Text",
"key": "Product Price",
"required": true
}
]
}
Loading

0 comments on commit 075deae

Please sign in to comment.