Receive a warm greeting.
Please help me with the following:
I do not have a cell phone, I'm learning from the emulator.
I have placed 10 images (in file) of a frog in white and another 10 frogs in color, I store them in an array. To save Kb ImageView by code (Img.Initialize ("Imageview")). When loading the activity I show the 10 white frogs, I give a CLICK event and change that frog (tag) to the color tag. UNTIL ALL GOOD !!!.
The problem starts with the ImageView_longClick event, I want to do the opposite but using the longClick, that is, the color frog goes to white, but this event stays in infinity and does not make me the change I want.
I want to do it this way because a customer can erase a choice in this way,
Place color frog CLICK
Back the frog to white LONGCLICK
Help me please.
I attach the code ... THANKS
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim Azar As Short
Dim PosH, PosV As Short
Dim ImgRana(11) As ImageView
Dim Panel1 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LayoutJugar")
Pro_Crear_Ranas
End Sub
'---------FIN------------------FIN------------------FIN---------------------- FIN -----------------------FIN-----------
Sub Pro_Crear_Ranas ' Estas son las ranas mostradas al arrancar el activity de Jugar
Dim b As Short
PosH = 1
For b = 1 To 10
Dim Img As ImageView
Img.Initialize("Imageview")
Img.Tag = b
Img.Gravity = Gravity.FILL
ImgRana(b) = Img
Select b
Case 1: ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca1.jpg"))
Case 2:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca2.jpg"))
Case 3:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca3.jpg"))
Case 4:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca4.jpg"))
Case 5:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca5.jpg"))
Case 6:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca6.jpg"))
Case 7:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca7.jpg"))
Case 8:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca8.jpg"))
Case 9:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca9.jpg"))
Case 10:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca10.jpg"))
End Select
Panel1.AddView(ImgRana(b), PosH, 180, 44, 44)
PosH = PosH + 45
Next
End Sub
Sub Pro_Recambio (rr As Short)
Select rr
Case 1:ImgRana(1).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor1.png"))
Case 2:ImgRana(2).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor2.png"))
Case 3:ImgRana(3).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor3.png"))
Case 4:ImgRana(4).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor4.png"))
Case 5:ImgRana(5).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor5.png"))
Case 6:ImgRana(6).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor6.png"))
Case 7:ImgRana(7).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor7.png"))
Case 8:ImgRana(8).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor8.png"))
Case 9:ImgRana(9).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor9.png"))
Case 10:ImgRana(10).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor10.png"))
End Select
End Sub
Sub Pro_cambio(w As Short )
Select w
Case 1: ImgRana(1).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca1.jpg"))
Case 2:ImgRana(2).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca2.jpg"))
Case 3:ImgRana(3).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca3.jpg"))
Case 4:ImgRana(4).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca4.jpg"))
Case 5:ImgRana(5).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca5.jpg"))
Case 6:ImgRana(6).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca6.jpg"))
Case 7:ImgRana(7).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca7.jpg"))
Case 8:ImgRana(8).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca8.jpg"))
Case 9:ImgRana(9).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca9.jpg"))
Case 10:ImgRana(10).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca10.jpg"))
End Select
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ImageView_Click
Dim I As ImageView
I = Sender
Pro_Recambio(I.Tag )
End Sub
Sub ImageView_LongClick
Dim I As ImageView
I = Sender
Log(I)
Pro_cambio(I.Tag )
End Sub
Please help me with the following:
I do not have a cell phone, I'm learning from the emulator.
I have placed 10 images (in file) of a frog in white and another 10 frogs in color, I store them in an array. To save Kb ImageView by code (Img.Initialize ("Imageview")). When loading the activity I show the 10 white frogs, I give a CLICK event and change that frog (tag) to the color tag. UNTIL ALL GOOD !!!.
The problem starts with the ImageView_longClick event, I want to do the opposite but using the longClick, that is, the color frog goes to white, but this event stays in infinity and does not make me the change I want.
I want to do it this way because a customer can erase a choice in this way,
Place color frog CLICK
Back the frog to white LONGCLICK
Help me please.
I attach the code ... THANKS
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim Azar As Short
Dim PosH, PosV As Short
Dim ImgRana(11) As ImageView
Dim Panel1 As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("LayoutJugar")
Pro_Crear_Ranas
End Sub
'---------FIN------------------FIN------------------FIN---------------------- FIN -----------------------FIN-----------
Sub Pro_Crear_Ranas ' Estas son las ranas mostradas al arrancar el activity de Jugar
Dim b As Short
PosH = 1
For b = 1 To 10
Dim Img As ImageView
Img.Initialize("Imageview")
Img.Tag = b
Img.Gravity = Gravity.FILL
ImgRana(b) = Img
Select b
Case 1: ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca1.jpg"))
Case 2:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca2.jpg"))
Case 3:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca3.jpg"))
Case 4:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca4.jpg"))
Case 5:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca5.jpg"))
Case 6:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca6.jpg"))
Case 7:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca7.jpg"))
Case 8:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca8.jpg"))
Case 9:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca9.jpg"))
Case 10:ImgRana(b).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca10.jpg"))
End Select
Panel1.AddView(ImgRana(b), PosH, 180, 44, 44)
PosH = PosH + 45
Next
End Sub
Sub Pro_Recambio (rr As Short)
Select rr
Case 1:ImgRana(1).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor1.png"))
Case 2:ImgRana(2).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor2.png"))
Case 3:ImgRana(3).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor3.png"))
Case 4:ImgRana(4).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor4.png"))
Case 5:ImgRana(5).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor5.png"))
Case 6:ImgRana(6).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor6.png"))
Case 7:ImgRana(7).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor7.png"))
Case 8:ImgRana(8).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor8.png"))
Case 9:ImgRana(9).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor9.png"))
Case 10:ImgRana(10).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranacolor10.png"))
End Select
End Sub
Sub Pro_cambio(w As Short )
Select w
Case 1: ImgRana(1).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca1.jpg"))
Case 2:ImgRana(2).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca2.jpg"))
Case 3:ImgRana(3).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca3.jpg"))
Case 4:ImgRana(4).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca4.jpg"))
Case 5:ImgRana(5).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca5.jpg"))
Case 6:ImgRana(6).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca6.jpg"))
Case 7:ImgRana(7).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca7.jpg"))
Case 8:ImgRana(8).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca8.jpg"))
Case 9:ImgRana(9).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca9.jpg"))
Case 10:ImgRana(10).SetBackgroundImage (LoadBitmap (File.DirAssets, "ranablanca10.jpg"))
End Select
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ImageView_Click
Dim I As ImageView
I = Sender
Pro_Recambio(I.Tag )
End Sub
Sub ImageView_LongClick
Dim I As ImageView
I = Sender
Log(I)
Pro_cambio(I.Tag )
End Sub