Sub spBkgColour_ItemClick (Position As Int, Value As Object)
Dim strValue As String
Dim bd As BitmapDrawable
Log("spBkgColour Position is :" & Position & " and Value is " & Value)
If Value = "Black" Then strValue = "1440x2560BLA.jpg"
If Value = "Blue" Then strValue = "1440x2560BLU.jpg"
If Value = "Green" Then strValue = "1440x2560GRE.jpg"
If Value = "Orange" Then strValue = "1440x2560ORA.jpg"
If Value = "Red" Then strValue = "1440x2560RXD.jpg"
If Value = "Light Blue Plain" Then strValue = "1440x2560BUP.jpg"
Main.BKG_IMAGE = strValue
Log("Background file to load is " & strValue)
If File.Exists(File.DirAssets, strValue) Then
bd.Initialize(LoadBitmap(File.DirAssets,strValue))
bd.Gravity = Gravity.FILL
Activity.Background = bd
Else
Log("The file does not exist!!")
End If
End Sub
Sub btnSave_Click
'save all settings to file
'1) background filename
'2) Night Mode 1,2,3 1=On 2=Off 3=Auto
'3) Night Mode ON time
'4) Night Mode OFF time
'5) Thumbnail Type 1=flower 2=cosmos 3=arabic
'6) Reserved
Dim us1, us2, us3, us4, us5, us6, lineData As String
If Main.THUMBNAIL_IMAGE = "flower" Then Main.THUMBNAIL_IMAGE = "1"
If Main.THUMBNAIL_IMAGE = "cosmos" Then Main.THUMBNAIL_IMAGE = "2"
If Main.THUMBNAIL_IMAGE = "arabic" Then Main.THUMBNAIL_IMAGE = "3"
us1 = Main.BKG_IMAGE
us2 = Main.NIGHT_MODE
us3 = Main.NIGHT_MODE_ON
us4 = Main.NIGHT_MODE_OFF
us5 = Main.THUMBNAIL_IMAGE
us6 = Main.SETTINGS_RESERVE
lineData = us1 & us2 & us3 & us4 & us5 & us6
Log("userSettings Write data is " & lineData)
'make file
Dim writeLine As TextWriter
writeLine.Initialize(File.OpenOutput(File.DirInternal,"userSettings.txt",False))
writeLine.WriteLine(lineData)
writeLine.Close
Activity.Finish
End Sub