Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Private rp As RuntimePermissions
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 ListModelView As ListView
Private addPlusButton As Button
Dim ListModel(10) As String
Type ListViewData (FirstRow As String, SecondRow As String, Picture As Bitmap)
' Private ModelViewPanel As Panel
' Private BackModelWiewButton As Button
' Dim ModelName As String
' Dim Component1 As String
' Dim Component2 As String
' Dim Component3 As String
' Dim Component4 As String
' Dim Component5 As String
' Dim Component6 As String
' Dim Component7 As String
' Private ModelnameLabel As Label
' Private Component1Label As Label
' Private Component2Label As Label
' Private Component3Label As Label
' Private Component4Label As Label
' Private Component5Label As Label
' Private Component6Label As Label
' Private Component7Label As Label
'
'
'
' Private DeleteModelWiewButton As Button
' Private FlyModelWiewButton As Button
' Private MaintenanceModelWiewButton As Button
'
' Private DesComponent1Label As Label
' Private DesComponent2Label As Label
' Private DesComponent3Label As Label
' Private DesComponent4Label As Label
' Private DesComponent5Label As Label
' Private DesComponent6Label As Label
' Private DesComponent7Label As Label
' Private DesModelNameLabel As Label
'
' Private ModelName As EditText
' Private Component1 As EditText
' Private Component2 As EditText
' Private Component3 As EditText
' Private Component4 As EditText
' Private Component5 As EditText
' Private Component6 As EditText
' Private Component7 As EditText
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("Layout1")
Activity.LoadLayout("Main")
Activity.Title = "RC hangar"
LoadListModel 'Forse è meglio metterlo in Resume? da testare
' ModelViewPanel.Visible = False
'ToastMessageShow("if there are no models here, click on add model button",True)
'MsgboxAsync("se non ci sono modelli inseriscili cliccando sul pulsante + in basso a destra", "Ecco il tuo Hangar")
End Sub
Sub Activity_Resume
' LoadListModel 'per ora sta in Create da testare, e invece sembra vada bene qui!
' ModelViewPanel.Visible = False
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub addPlusButton_Click
StartActivity(AggiungiModello)
End Sub
Sub LoadListModel
ListModelView.Clear
Dim List1 As List
If File.Exists(File.DirRootExternal, "RCHangar/ListModel.txt") = False Then
'MsgboxAsync("if there are no models, enter them by clicking on the button + bottom right", "Here is your Hangar")
MsgboxAsync("se non ci sono modelli inseriscili cliccando sul pulsante + in basso a destra", "Ecco il tuo Hangar")
End If
'controllo se esiste il file di testo
If File.Exists(File.DirRootExternal, "RCHangar/ListModel.txt") Then
'se il file esiste carico i dati dal file di testo
List1 =File.ReadList(File.DirRootExternal, "RCHangar/ListModel.txt")
Dim Bitmap1 As Bitmap
For i = 0 To 9
ListModel(i) = List1.Get(i)
'creo un mini array con tutte le parti della riga esaminata
Dim stringArray() As String = Regex.Split("\|",ListModel(i))
If ListModel(i) <> "0" Then
Dim lvd As ListViewData
lvd.Initialize
Bitmap1.Initialize(File.DirAssets, "planeApp.png")
lvd.FirstRow = stringArray(0)
lvd.SecondRow = "Efficiente/In Manutenzione" 'Lo implementerò successivamente con un boolean
lvd.Picture = Bitmap1
ListModelView.AddTwoLinesAndBitmap2(lvd.FirstRow,lvd.SecondRow,lvd.Picture, lvd)
' imposto i colori
ListModelView.TwoLinesAndBitmap.Label.TextColor = Colors.RGB(0,0,0)
ListModelView.TwoLinesAndBitmap.SecondLabel.TextColor = Colors.RGB(254,0,0)
ListModelView.TwoLinesAndBitmap.ItemHeight = 80dip
End If
Next
End If
End Sub
Sub ListModelView_ItemClick (Position As Int, Value As Object)
StartActivity(VediModello)
' addPlusButton.Visible = False
'
' Dim ListTemp As List
'
' 'controllo se esiste il file di testo
' If File.Exists(File.DirRootExternal, "RCHangar/ListModel.txt") Then
' 'se il file esiste carico i dati dal file di testo
' ListTemp =File.ReadList(File.DirRootExternal, "RCHangar/ListModel.txt")
'
' End If
'
' Dim stringTemp As String = ListTemp.Get(Position)
'
' Dim stringArray() As String = Regex.Split("\|",stringTemp)
'
' ModelName = stringArray(0)
' Component1 = stringArray(1)
' Component2 = stringArray(2)
' Component3 = stringArray(3)
' Component4 = stringArray(4)
' Component5 = stringArray(5)
' Component6 = stringArray(6)
' Component7 = stringArray(7)
'
'
' ModelViewPanel.Visible = True
'
' ModelnameLabel.Text = ModelName
' Component1Label.Text = Component1
' Component2Label.Text = Component2
' Component3Label.Text = Component3
' Component4Label.Text = Component4
' Component5Label.Text = Component5
' Component6Label.Text = Component6
' Component7Label.Text = Component7
End Sub
'Sub BackModelWiewButton_Click
' ModelViewPanel.Visible = False
' addPlusButton.Visible = True
'End Sub
'Sub MaintenanceModelWiewButton_Click
'
'End Sub
'Sub FlyModelWiewButton_Click
'
'End Sub
'Sub DeleteModelWiewButton_Click
' Dim ListDelete As List
'
'' 'controllo se esiste il file di testo
'' If File.Exists(File.DirRootExternal, "RCHangar/ListModel.txt") Then
'
' 'se il file esiste carico i dati dal file di testo
' ListDelete = File.ReadList(File.DirRootExternal, "RCHangar/ListModel.txt")
'
'' Dim stringTemp As String
'
' ListDelete.Get(PositionTemp)
'
'
'
'
' Dim Trovato As Boolean
' Trovato = False
'
' For i = 0 To 9
'
' ListModel(i) = PositionTemp
'
' If ListModel(i) = "0" And Trovato = False Then
' 'Riempio lo slot con i valori da registrare
' ListModel(i) = "0"
' 'imposto la boolean a true
' Trovato = True
' End If
'
' Next
'
'
' File.Writelist(File.DirRootExternal, "RCHangar/ListModel.txt", ListModel) 'Salvo l'array nel file di testo
'
'' StartActivity(Main)
'End Sub