From 10f1c820a081802247d5a8bc3cb55a06d2fd46c0 Mon Sep 17 00:00:00 2001 From: cheveguerra Date: Tue, 19 Sep 2023 20:37:26 -0600 Subject: [PATCH] 19/9/23 - Listview de servidores por customListView y servidor de Azure - Se cambio el oistview de los servidores predeterminados por un customListView. - Se agrego el servidor de Azure a la lista de servidores predeterminados.. --- .gitignore | 3 +-- B4A/B4XMainPage.bas | 29 +++++++++++++++++++++++++++++ B4A/C_Subs.bas | 6 +++--- B4A/Files/listitem.bal | Bin 0 -> 2046 bytes B4A/Files/login.bal | Bin 15171 -> 16060 bytes B4A/Monitor-Keymon.b4a | 24 +++++++++++++++--------- B4A/Monitor-Keymon.b4a.meta | 27 +++++++++++++++++++++++++++ 7 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 B4A/Files/listitem.bal create mode 100644 B4A/Monitor-Keymon.b4a.meta 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 0000000000000000000000000000000000000000..bc8b8d08ed02b84864b84a6f21fd0869eb000287 GIT binary patch literal 2046 zcmbtVy>Am)5MPrxhrz({dBEKfz6oGV2;We^DmKE0*??n+bOqsM_a%PEde?gU;t(n% z8pLrD5)z`Nr=_5{iUy)|P*HLJ0d&{-<~R1PlfzV4nt3yC=FOY=&AfHmvaD>%vR2W$ zvO~6OR8yJxA4$*0%7hk;hSc!!CnKqwQm=u%ET*L2F{WvQb)0NW`YJLdBkSW`?`tAh z=FNH^dE-ZE@NWfi?DZ2N7?TYPtY=t^#(ym5@D|@J%%bG{_ zz51Hh*4F3G_TQqo=ZSEq8&&5U@)wc{QzBAsz91tt6G)xEDvgMNL6(O6dZD$RY$8x~ zVN@6tW;L%!-qT`EO!;zukKl!lEk7Fip^mkm$TJ@wTW$hIE_^d2$fgX8BkB^@#5tn7 z)3d%m?rJH6ENLom{aH^|mGRm05788;7S#lF8ud4XrdT9!H;kCUMFuAjj|EN){frbC)k|t$;;Tla?r~3?F{cP{c8cIox@=I;U# zB9jc-1WZ`i00E|rL>zAu3F*{k;(c3)r95JIdMs>>1vHa)wnHGYevSnw{rG0|{R##( zvx69?K1f2hqMh+JD%wRffO2*damaR!tyXJKyhE$izn2&eSo?_5DXtx#kt7vP?k(*w z0=P1%grR`*0irD9f$9@Hl1h_u+IVo`2-yXOlr}IB*bag39wC9VLCr}dnEwyV5bZHA z2TAx|U=C4?%wb|nfXR`11pEATCV`NueE{}5K7LFW{kT@c4hzlG!bLA4gv5CA$9KP{yW_QM;+4&f}zn$*WG%X9W72oo` zboU5B)eWxsj0cQwgJ;by`@(B1IBexAw_7d7=}sK%r1W)N&&#)owRQ$4+o2Jt$2$}r z1@DB$pj`@Q!MmXxG_G)7;XMjZC_EYSqBa#fT0!Bx3hx8&hYmmop=qcHl@zuVKBVyB z9?N|4lm4djGkM%d%;eQ{y(}wR}dpasqv4wq> z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