فقط ی مشکلی هست،اونم اینه که باید از برنامه خارج بشی و داخل بشی تا تغیرات تنظیمات اعمال بشه.
مشکل کجاست؟
اینم کد.
Sub Process_Globals
Dim m As MediaPlayer
End Sub
Sub Globals
Dim h As Boolean
Private ScrollView1 As ScrollView
Private Label1 As Label
Private Panel1 As Panel
Dim c As Cursor
Dim s As SQL
Dim x As Int=1%y
Dim sFontSize,sFontColor,sFontFamily As String
Dim set As AHPreferenceManager
Private Button1 As Button
Dim s1 As SlidingMenu
Private Button2 As Button
Private ScrollView1 As ScrollView
Private Label2 As Label
End Sub
Sub SetlineSacing(Lbl As Label,add As Float,mult As Float)
Dim jo As JavaObject=Label1
jo.RunMethod("setLineSpacing",Array As Object(add,mult))
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("b")
aa.createMenu(s1)
If File.Exists(File.DirInternal,"123.db")= False Then
File.Copy(File.DirAssets,"123.db",File.DirInternal,"123.db")
End If
s.Initialize(File.DirInternal,"123.db",False)
c=s.ExecQuery("SELECT * FRom A1")
For i=0 To c.RowCount-1
c.Position=i
Dim p As Panel
p.Initialize("p")
ScrollView1.Panel.AddView(p,0,x,100%x,100%y)
x=x+42%y
p.LoadLayout("a")
'------------------------------------------------------------
sFontSize = set.GetString("fontSize")
sFontColor = set.GetString("fontColor")
sFontFamily = set.GetString("fontFamily")
'------------------------------------------------------------
Label1.Text=c.GetString("see")
Label1.Typeface=Typeface.LoadFromAssets("Mj_Shafigh_ Emperor.Ir.TTF")
Label1.Gravity=Gravity.CENTER
Label1.TextColor=Colors.Black
Label1.TextSize=25
SetlineSacing(Label1,1.5,1.5)
Label1.Top=0dip
'--------------------------------------------------
Try
Label1.TextSize = sFontSize
Catch
End Try
If sFontColor = "Red" Then
Label1.TextColor = Colors.Red
Else If sFontColor = "Green" Then
Label1.TextColor= Colors.Green
Else If sFontColor = "Blue" Then
Label1.TextColor = Colors.Blue
Else If sFontColor = "Yellow" Then
Label1.TextColor = Colors.Yellow
End If
Try
Label1.Typeface = Typeface.LoadFromAssets(sFontFamily)
Catch
End Try
'--------------------------------------------------
ScrollView1.Panel.Height=x
Label1.Tag=c.GetInt("id")'''''''''''''''''''''''''''
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button2_Click
If s1.Visible=True Then
s1.HideMenus
Else
s1.ShowMenu
End If
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_MENU Then
If s1.Visible = False Then
s1.ShowMenu
Else
s1.HideMenus
End If
Return True
End If
End Sub
Sub panelMenu_ItemClick (Position As Int,Value As Object)
Select Value
Case "about"
Dim c1 As CustomDialog
Dim p1 As Panel
p1.Initialize("")
c1.AddView(p1,0,0,490,250)
p1.LoadLayout("5")
c1.Show("درباره ما","خب","","",Null)
Case "setting"
setting
Case "exit"
If Msgbox2("آیا می خواهید از برنامه خارج شوید؟","خروج","بله","خیر","",Null) = DialogResponse.POSITIVE Then
Activity.Finish
ExitApplication
ToastMessageShow("التماس دعا",True)
End If
End Select
End Sub
Sub setting
'StartActivity("ss")
Dim a1 As AHPreferenceScreen
a1.Initialize("تنظیمات","تنظیمات مربوط به نمایش")
a1.AddList("fontSize","اندازه قلم","حالت پیشفرض سایز قلم 18","18","",Array As String("20","21","22","28","36","40","52"))
a1.AddList("fontColor","رنگ قلم","رنگ پیشفرض قلم سیاه است","black","",Array As String("Red","Green","Blue","Yellow"))
a1.AddList("fontFamily","نوع قلم","","byekan.ttf","",Array As String("IranNastaliq.ttf","lcn.otf"))
StartActivity(a1.CreateIntent)
End Sub
سوال
siroos12 14
سلام علیکم.
دوستان من از تنظیمات خود اندروید استفاده کردم.
فقط ی مشکلی هست،اونم اینه که باید از برنامه خارج بشی و داخل بشی تا تغیرات تنظیمات اعمال بشه.
مشکل کجاست؟
اینم کد.
لینک ارسال
به اشتراک گذاری در سایت های دیگر
8 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.