Type=Activity
Version=4.3
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: False
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

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.

	Dim chkmute As CheckBox
	Dim chkchangeaudio As CheckBox
	Dim lbltitle As Label
	Dim lblmute As Label
	Dim lblchangeaudio As Label
	Dim btn3 As Button
	Dim rb1 As RadioButton
	Dim rb2 As RadioButton
	Dim imgbackground As ImageView
	Dim rb3,rb4 As RadioButton
End Sub

Sub Activity_Create(FirstTime As Boolean)
Dim s1,s2 As String
Activity.LoadLayout("setting")
common.changeTheme(imgbackground)
lblmute.Typeface = Typeface.LoadFromAssets("BNazanin.ttf")
lbltitle.Typeface = Typeface.LoadFromAssets("BNazanin.ttf")
lblchangeaudio.Typeface = Typeface.LoadFromAssets("BNazanin.ttf")
s1 = settings.getData("settingApp.app","muteBG")
If s1 <> "" Then
 chkmute.Checked = s1
End If
s2 = settings.getData("settingApp.app","audioBG")
If s2 <> "" Then
 chkchangeaudio.Checked = True
End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub chkmute_CheckedChange(Checked As Boolean)
settings.saveData("settingApp.app","muteBG",chkmute.Checked)
End Sub
Sub chkchangeaudio_CheckedChange(Checked As Boolean)
If Checked = True Then
	Dim f1 As FileDialog
	f1.FastScroll = True
	f1.FileFilter = ".mp3"
	f1.Show("لطفا آهنگ را انتخاب کنید","انتخاب","انصراف","",Null)
	If f1.Response = DialogResponse.POSITIVE AND f1.ChosenName <> "" Then
	 settings.saveData("settingApp.app","audioBG",f1.ChosenName)
	 File.Copy(f1.FilePath,f1.ChosenName,File.DirInternal,f1.ChosenName)
	 Msgbox("آهنگ زمینه بازی تغییر داده شد","پیام")
	Else
     chkchangeaudio.Checked = False
	 Return
	End If
Else
 settings.RemoveData("settingApp.app","audioBG")
End If
End Sub
Sub lblmute_Click
 chkmute.Checked = Not(chkmute.Checked)
 chkmute_CheckedChange(chkmute.Checked)
End Sub
Sub lblchangeaudio_Click
chkchangeaudio.Checked = Not(chkchangeaudio.Checked)
 chkchangeaudio_CheckedChange(chkchangeaudio.Checked)	
End Sub
Sub btn3_Click
 Activity.Finish
 StartActivity(Main)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
  If KeyCode = KeyCodes.KEYCODE_BACK Then
   Activity.Finish
   StartActivity(Main)
  End If
End Sub
Sub rb1_CheckedChange(Checked As Boolean)
 settings.saveData("settingApp.app","theme","login.jpg")
End Sub
Sub rb2_CheckedChange(Checked As Boolean)
 settings.saveData("settingApp.app","theme","bg2.jpg")
 ToastMessageShow("برای نمایش نتیجه تم وارد بازی شوید",False)
End Sub
Sub rb3_CheckedChange(Checked As Boolean)
 settings.saveData("settingApp.app","theme","bg3.jpg")
 ToastMessageShow("برای نمایش نتیجه تم وارد بازی شوید",False)	
End Sub
Sub rb4_CheckedChange(Checked As Boolean)
 settings.saveData("settingApp.app","theme","bg4.jpg")
 ToastMessageShow("برای نمایش نتیجه تم وارد بازی شوید",False)	
End Sub
