Sub InitializeImage
Dim xml As XmlLayoutBuilder
Dim p As JavaObject
p.InitializeStatic("android.graphics.PorterDuff.Mode")
Dim bddowne As BitmapDrawable = xml.GetDrawable("wifidown")
Dim bddownd As BitmapDrawable = xml.GetDrawable("wifidown")
Dim bdupe As BitmapDrawable = xml.GetDrawable("wifiup")
Dim bdupd As BitmapDrawable = xml.GetDrawable("wifiup")
Dim jo As JavaObject = bddowne : jo.RunMethod("setColorFilter",Array(Utils.Azzurro,p.GetField("SRC_IN")))
Dim jo As JavaObject = bddownd : jo.RunMethod("setColorFilter",Array(Utils.greydisabled,p.GetField("SRC_IN")))
Dim jo As JavaObject = bdupe : jo.RunMethod("setColorFilter",Array(Utils.Azzurro,p.GetField("SRC_IN")))
Dim jo As JavaObject = bdupd : jo.RunMethod("setColorFilter",Array(Utils.greydisabled,p.GetField("SRC_IN")))
Dim mdown As Map = CreateMap(True:bddowne,False:bddownd)
Dim mup As Map = CreateMap(True:bdupe,False:bdupd)
mapBdWifi = CreateMap("utils5":mdown,"utils6":mup)
End sub
Sub click(....)
'Some stuff..
'Notif is a class. Every time i call this sub, i change notif.enabled..
If mapBdWifi.IsInitialized = False Then InitializeImage("wifi")
cs.Color(Utils.IIF(notif.enabled,Utils.Black,Utils.GreyDisabled)).Append(" • ").Color(Utils.Azzurro).Pop.Pop
cs.Append(notif.custom.Get("time"))
cs.Color(Utils.IIF(notif.enabled,Utils.Black,Utils.GreyDisabled)).Append(" • ").Color(Utils.Azzurro).Pop.Pop
cs.Append(Utils.GetWifiRete(notif.idrete).name)
Dim m As Map = mapBdWifi.Get(Utils.loc.GetLocalizeKey(notif.custom.Get("event")))
img.Background = m.Get(notif.enabled)
Log(img.Background)
Log(notif.enabled)
End sub