mirror of
https://github.com/KeymonSoft/Monitor-Keymon.git
synced 2026-04-17 21:06:19 +00:00
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..
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user