diff --git a/.gitignore b/.gitignore index 618d244..af94e9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ **/Objects -**/AutoBackups -*.meta \ No newline at end of file +**/AutoBackups \ No newline at end of file diff --git a/B4A/B4XMainPage.bas b/B4A/B4XMainPage.bas index 9bbda8c..5b8414b 100644 --- a/B4A/B4XMainPage.bas +++ b/B4A/B4XMainPage.bas @@ -49,6 +49,9 @@ Sub Class_Globals Private Label1 As Label Private b_notifAccess As Button Dim logger As Boolean = False + Private clv_server As CustomListView + Private p_listItemServer As Panel + Private l_server As Label End Sub Public Sub Initialize @@ -65,6 +68,11 @@ Private Sub B4XPage_Created (Root1 As B4XView) l_version.Text = Application.VersionName lv_server.AddSingleLine("http://keymon.lat:1782") lv_server.AddSingleLine("http://10.0.0.205:1782") + lv_server.AddSingleLine("http://40.123.36.38:1782") + + clv_server.Add(CreateListItem("http://keymon.lat:1782", clv_server.AsView.Width, 35dip), "http://keymon.lat:1782") + clv_server.Add(CreateListItem("http://10.0.0.205:1782", clv_server.AsView.Width, 35dip), "http://10.0.0.205:1782") + clv_server.Add(CreateListItem("http://40.123.36.38:1782", clv_server.AsView.Width, 35dip), "http://40.123.36.38:1782") et_server.Text = Starter.DBReqServer #if not(DEBUG) logger = False @@ -159,6 +167,17 @@ Private Sub lv_server_ItemClick (Position As Int, Value As Object) ToastMessageShow($"Servidor modificado"$, False) End Sub + +Private Sub clv_server_ItemClick (Index As Int, Value As Object) + If logger Then Log(Value) + et_server.Text = Value + Starter.DBReqServer = Value + Starter.skmt.ExecNonQuery($"delete from cat_variables where nombre = 'servidor'"$) + Starter.skmt.ExecNonQuery($"insert into cat_variables (nombre, valor) values ("servidor", '${Value}')"$) + CallSubDelayed(Monitor, "reinicializaReqManager") + ToastMessageShow($"Servidor modificado"$, False) +End Sub + Private Sub b_server_Click Starter.DBReqServer = et_server.text Starter.skmt.ExecNonQuery($"delete from cat_variables where nombre = 'servidor'"$) @@ -212,3 +231,13 @@ Sub b_notifAccess_Click In.Initialize("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS", "") StartActivity(In) End Sub + +Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel 'ignore + Dim p As B4XView = xui.CreatePanel("") + p.SetLayoutAnimated(0, 0, 0, Width, Height) + p.LoadLayout("listItem") + l_server.Height = Height + l_server.Text = Text +' i_prod.Bitmap = img + Return p +End Sub diff --git a/B4A/C_Subs.bas b/B4A/C_Subs.bas index a3e1e67..ab34c6a 100644 --- a/B4A/C_Subs.bas +++ b/B4A/C_Subs.bas @@ -20,7 +20,6 @@ Sub Class_Globals Private subsLogs As Boolean = False End Sub - 'You can add more parameters here. Public Sub Initialize As Object Return Me @@ -414,7 +413,7 @@ Sub CreateNotification (Body As String) As Notification Dim notification As Notification notification.Initialize2(notification.IMPORTANCE_LOW) notification.Icon = "icon" - notification.SetInfo("Tester", Body, Main) + notification.SetInfo("Activo", Body, Main) Return notification End Sub @@ -445,4 +444,5 @@ Sub notiLowReturn(title As String, Body As String, id As Int) As Notification 'i notification.Notify(id) ' Log("notiLowReturn SetInfo") Return notification -End Sub \ No newline at end of file +End Sub + diff --git a/B4A/Files/listitem.bal b/B4A/Files/listitem.bal new file mode 100644 index 0000000..bc8b8d0 Binary files /dev/null and b/B4A/Files/listitem.bal differ diff --git a/B4A/Files/login.bal b/B4A/Files/login.bal index b27e55a..89a045e 100644 Binary files a/B4A/Files/login.bal and b/B4A/Files/login.bal differ diff --git a/B4A/Monitor-Keymon.b4a b/B4A/Monitor-Keymon.b4a index 666b194..04d966b 100644 --- a/B4A/Monitor-Keymon.b4a +++ b/B4A/Monitor-Keymon.b4a @@ -1,17 +1,23 @@ Build1=Default,kmtMonitor.keymon.com.mx,HU2_PUBLIC File1=engrane.png -File2=login.bal -File3=logo_keymon.png -File4=MainPage.bal +File2=kmt.db +File3=listItem.bal +File4=login.bal +File5=logo_keymon.png +File6=MainPage.bal FileGroup1=Default Group FileGroup2=Default Group FileGroup3=Default Group FileGroup4=Default Group +FileGroup5=Default Group +FileGroup6=Default Group Group=Default Group Library1=b4xpages -Library10=runtimepermissions -Library11=sql -Library12=replyauto +Library10=replyauto +Library11=runtimepermissions +Library12=sql +Library13=xcustomlistview +Library14=xui Library2=byteconverter Library3=core Library4=fusedlocationprovider @@ -28,15 +34,15 @@ Module4=DBRequestManager Module5=Monitor Module6=NotificationService Module7=Starter -NumberOfFiles=4 -NumberOfLibraries=12 +NumberOfFiles=6 +NumberOfLibraries=14 NumberOfModules=7 Version=12.5 @EndOfDesignText@ #Region Project Attributes #ApplicationLabel: Monitor Keymon #VersionCode: 1 - #VersionName: 3.09.17 + #VersionName: 3.09.19 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: portrait #CanInstallToExternalStorage: False diff --git a/B4A/Monitor-Keymon.b4a.meta b/B4A/Monitor-Keymon.b4a.meta new file mode 100644 index 0000000..1c4dd39 --- /dev/null +++ b/B4A/Monitor-Keymon.b4a.meta @@ -0,0 +1,27 @@ +ModuleBookmarks0= +ModuleBookmarks1= +ModuleBookmarks2= +ModuleBookmarks3= +ModuleBookmarks4= +ModuleBookmarks5= +ModuleBookmarks6= +ModuleBookmarks7= +ModuleBreakpoints0= +ModuleBreakpoints1= +ModuleBreakpoints2= +ModuleBreakpoints3= +ModuleBreakpoints4= +ModuleBreakpoints5= +ModuleBreakpoints6= +ModuleBreakpoints7= +ModuleClosedNodes0= +ModuleClosedNodes1=2 +ModuleClosedNodes2= +ModuleClosedNodes3= +ModuleClosedNodes4= +ModuleClosedNodes5=8,10 +ModuleClosedNodes6= +ModuleClosedNodes7= +NavigationStack=B4XMainPage,b_timeout_Click,207,0,B4XMainPage,Initialize,53,0,B4XMainPage,b_notifAccess_Click,216,0,B4XMainPage,CreateListItem,226,3,Visual Designer,login.bal,-100,3,B4XMainPage,clv_server_ItemClick,164,0,B4XMainPage,b_monitorActivo_Click,149,0,B4XMainPage,lv_server_ItemClick,160,0,Visual Designer,listItem.bal,-100,6,B4XMainPage,B4XPage_Created,60,6 +SelectedBuild=0 +VisibleModules=1,7,3,5,6,4