#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim size As Int
Dim font As String
Dim color1 As String
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.
Private Label1 As Label
Private Label2 As Label
Private Label3 As Label
Private Label4 As Label
Private Label5 As Label
Private fontsize As SeekBar
Private fonttype As Spinner
Private color As Spinner
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("tanzimat")
Label1.TextSize = fontsize.Value
fonttype.AddAll(Array As String("BElham","BMitraBd","BNazaninBNaznnBD","BTitrBd","list","matn","Mj_Afaaq","Rooznameh"))
color.AddAll(Array As String("قرمز","آبی","زرد","سبز","مشکی","سفید","قهوه ای"))
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub fontsize_ValueChanged (Value As Int, UserChanged As Boolean)
Label1.TextSize = fontsize.Value
size = fontsize.Value
End Sub
Sub fonttype_ItemClick (Position As Int, Value As Object)
Label1.Typeface = Typeface.LoadFromAssets(Value&".ttf")
font = Value&".ttf"
End Sub
Sub color_ItemClick (Position As Int, Value As Object)
If Value = "قرمز" Then
Label1.TextColor=Colors.Red
Else If Value = "آبی" Then
Label1.TextColor=Colors.Blue
Else If Value = "زرد" Then
Label1.TextColor=Colors.Yellow
Else If Value = "سبز" Then
Label1.TextColor=Colors.Green
Else If Value = "مشکی" Then
Label1.TextColor=Colors.Black
Else If Value = "سفید" Then
Label1.TextColor=Colors.White
Else If Value = "قهوه ای" Then
Label1.TextColor=Colors.Cyan
End If
color1=Value
End Sub
خب
حالا متن لیبل تو همون صفحه تغییر میکنه
اما نمیتونم به اکتیویتی text منتقل کنم
یعنی اگه تو اکتیویتی تنظیمات فونت رو عوض کردم ذخیره بشه و تو اکتیویتی text نمایش داده بشه
سوال
cloner0101 10
سلام دوستان
من کاربر جدیدم
کمک کنید مشکلم حل شه
من یه اکتیویتی به اسم tanzimat ساختم اینم کدش::
#Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. Dim size As Int Dim font As String Dim color1 As String 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. Private Label1 As Label Private Label2 As Label Private Label3 As Label Private Label4 As Label Private Label5 As Label Private fontsize As SeekBar Private fonttype As Spinner Private color As Spinner End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("tanzimat") Label1.TextSize = fontsize.Value fonttype.AddAll(Array As String("BElham","BMitraBd","BNazaninBNaznnBD","BTitrBd","list","matn","Mj_Afaaq","Rooznameh")) color.AddAll(Array As String("قرمز","آبی","زرد","سبز","مشکی","سفید","قهوه ای")) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub fontsize_ValueChanged (Value As Int, UserChanged As Boolean) Label1.TextSize = fontsize.Value size = fontsize.Value End Sub Sub fonttype_ItemClick (Position As Int, Value As Object) Label1.Typeface = Typeface.LoadFromAssets(Value&".ttf") font = Value&".ttf" End Sub Sub color_ItemClick (Position As Int, Value As Object) If Value = "قرمز" Then Label1.TextColor=Colors.Red Else If Value = "آبی" Then Label1.TextColor=Colors.Blue Else If Value = "زرد" Then Label1.TextColor=Colors.Yellow Else If Value = "سبز" Then Label1.TextColor=Colors.Green Else If Value = "مشکی" Then Label1.TextColor=Colors.Black Else If Value = "سفید" Then Label1.TextColor=Colors.White Else If Value = "قهوه ای" Then Label1.TextColor=Colors.Cyan End If color1=Value End Subخب
حالا متن لیبل تو همون صفحه تغییر میکنه
اما نمیتونم به اکتیویتی text منتقل کنم
یعنی اگه تو اکتیویتی تنظیمات فونت رو عوض کردم ذخیره بشه و تو اکتیویتی text نمایش داده بشه
متنم رو هم از دیتابیس گرفتم
ممنون
لینک ارسال
به اشتراک گذاری در سایت های دیگر
1 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده