Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("matn")
ScrollView2.initialize(100%y-96dip) spinner1.initialize("spinner") SeekBar1.initialize("SeekBar") spinner1.AddAll(Array As String("tahoma","kamran","mehdi","yekan","bnazanin","morvard","bziba","shekari")) For i=0 To label1.Length-1 label1(i).initialize("") Next
'منو اسلاید slide.initialize("slide") slide.BehindOffset = 30%x slide.Mode = slide.BOTH Dim color As ColorDrawable color.initialize(Colors.RGB(0, 210, 205),0) slide.SecondaryMenu.Background = color slide.Menu.Background = color
'راست اسلاید Dim h As Int h = 1%y Dim btnm(5) As Button For i=0 To btnm.Length-1 btnm(i).initialize("menu") btnm(i).TextColor = Colors.Green Dim b2 As BitmapDrawable b2.Initialize(LoadBitmap(File.DirAssets,"button2.png")) btnm(i).Background=b2 Next
btnm(1).Text = "برنامه های دیگر ما" btnm(1).Tag = "برنامه های دیگر ما" slide.SecondaryMenu.AddView(btnm(1),1%x,h,68%x,10%y) h=h+11%y
'چپ اسلاید
'منو اسلاید پایان Dim text As Label If File.Exists (File.Dirinternal,"mahbanu.db") = False Then File.Copy(File.DirAssets,"mahbanu.db",File.Dirinternal,"mahbanu.db") End If
If menu.s.isinitialized=False Then menu.s.initialize (File.Dirinternal,"mahbanu.db",True) End If Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0
If cur.GetString("link") <> Null Then ointent.initialize(ointent.ACTiON_ViEW,cur.GetString("link")) download.Visible = True End If
If cur.Getint("mark") = 0 Then bookmark_add.Visible = False Else bookmark_add.Visible = True End If
Dim h As Int For i = 0 To 14 'اضافه کردن متن If cur.GetString("matn"&i) <> Null Then Dim text As Label text.initialize("Label") text.text = cur.GetString("matn"&i) text.Gravity = Gravity.RIGHT text.TextColor = Colors.Black text.TextSize = menu.fontsize text.Typeface = Typeface.LoadFromAssets(menu.font &".ttf") ScrollView1.Panel.AddView(text,0,h+2%y,ScrollView1.Width-10,ScrollView1.Height) Dim su As StringUtils text.Height= su.MeasureMultilineTextHeight(text,text.text)+10 h = h + su.MeasureMultilineTextHeight(text,text.text) + 30 ScrollView1.Panel.Height = h End If
If cur.GetString("aks"&i) <> Null Then 'عکس دادن نشان
Dim imageView1 As ImageView imageView1.initialize("imageView") imageView1.tag = cur.GetString("aks"&i)
'اضافه کردن عکس ScrollView1.Panel.AddView(imageView1,0,h,ScrollView1.Width,ScrollView1.Height) imageView1.Bitmap = menu.Bitmap1(i)
If menu.Bitmap1(i).Width > 100%x Then imageView1.Width = 100%x imageView1.Height = (imageView1.Width / menu.Bitmap1(i).Width )*menu.Bitmap1(i).Height imageView1.Gravity = Gravity.Fill
Else imageView1.Width = menu.Bitmap1(i).Width imageView1.Height = menu.Bitmap1(i).Height imageView1.Left = (100%x - imageView1.Width)/2 imageView1.Gravity = Gravity.Fill End If h = h + imageView1.Height + 30 ScrollView1.Panel.Height = h End If 'عکس کردن باز
Next
'گرفتن تنظیمات tanzimat
End Sub
Sub btn_click Dim b As Button b = Sender menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub
Sub tanzimat Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM setting") cur.Position = 0 SeekBar1.Value = menu.fontsize spinner1.Selectedindex = cur.Getint("font") label1(2).Typeface = Typeface.LoadFromAssets(menu.font&".ttf")
End Sub
Sub action_bar_Click slide.ShowSecondaryMenu End Sub
If b.Tag = "تنظیمات" Then 'تنظیمات Dim btn As Button btn.initialize("") btn.Text = "تنظیمات" btn.color = Colors.RGB(120, 75, 215) slide.Menu.AddView(btn,0,h,70%x,48dip) ScrollView2.Height = 100%y Dim btn As Button btn.initialize("sabt") btn.Text = "ذخیره تنظیمات" btn.color = Colors.RGB(231, 76, 60) slide.Menu.AddView(btn,0,100%y-48dip,70%x,48dip) 'فونت سایز label1(0).Text = "اندازه متن" label1(0).TextColor = Colors.Black label1(0).Gravity = Gravity.CENTER ScrollView2.Panel.AddView(label1(0),1%x,h,68%x,48dip) h = h +label1(0).Height
ScrollView2.Panel.AddView(SeekBar1,1%x,h,68%x,48) SeekBar1.Max = 50 h = h + SeekBar1.Height ScrollView2.Panel.Height = h 'نوع فونت label1(1).Text = "نوع قلم" label1(1).TextColor = Colors.Black label1(1).Gravity = Gravity.CENTER ScrollView2.Panel.AddView(label1(1),1%x,h,68%x,48dip) h = h +label1(1).Height
spinner1.DropdownBackgroundColor = Colors.RGB(52, 152, 219) ScrollView2.Panel.AddView(spinner1,1%x,h,68%x,48dip) h = h + spinner1.Height ScrollView2.Panel.Height = h 'نمونه متن label1(2).Text = "متن نمونه" label1(2).TextColor = Colors.Red label1(2).Gravity = Gravity.CENTER ScrollView2.Panel.AddView(label1(2),1%x,h,68%x,70dip) h = h +label1(2).Height + 20 ScrollView2.Panel.Height = h +label1(2).Height + 20 End If
If b.Tag = "پنج ستاره دادن" Then
Dim ointent As Intent ointent.initialize(ointent.ACTiON_EDIT,"ماه بانو در کافه بازار برای اندروید") StartActivity(ointent) slide.HideMenus End If
If b.Tag = "درباره ما" Then 'تنظیمات Dim btn As Button btn.initialize("") btn.Text = "درباره ما" btn.color = Colors.RGB(120, 75, 215) slide.Menu.AddView(btn,0,h,70%x,48dip) ScrollView2.Height = 100%y
Dim h As Int Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM setting") cur.Position = 0 Dim label2 As Label label2.initialize("Label") label2.Text = cur.GetString("rahnama") label2.Gravity = Gravity.RiGHT label2.TextColor = Colors.Black label2.TextSize = menu.fontsize label2.Typeface = Typeface.LoadFromAssets(menu.font&".ttf") ScrollView2.Panel.AddView(label2,0,h+2%y,ScrollView2.Width-10,ScrollView2.Height) Dim su As StringUtils label2.Height= su.MeasureMultilineTextHeight(label2,label2.Text)+10 h = h + su.MeasureMultilineTextHeight(label2,label2.Text) + 30 ScrollView2.Panel.Height = h End If
If b.Tag = "منابع" Then 'تنظیمات Dim btn As Button btn.initialize("") btn.Text = "منابع" btn.color = Colors.RGB(120, 75, 215) slide.Menu.AddView(btn,0,h,70%x,48dip) ScrollView2.Height = 100%y
Dim h As Int Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM setting") cur.Position = 0 Dim label2 As Label label2.initialize("Label") label2.Text = cur.GetString("manabe") label2.Gravity = Gravity.CENTER label2.TextColor = Colors.Black label2.TextSize = menu.fontsize label2.Typeface = Typeface.LoadFromAssets(menu.font&".ttf") ScrollView2.Panel.AddView(label2,0,h+2%y,ScrollView2.Width-10,ScrollView2.Height) Dim su As StringUtils label2.Height= su.MeasureMultilineTextHeight(label2,label2.Text)+10 h = h + su.MeasureMultilineTextHeight(label2,label2.Text) + 30 ScrollView2.Panel.Height = h End If
If b.Tag = "برنامه های دیگر ما" Then
Dim ointent As Intent ointent.Initialize(ointent.ACTION_VIEW,"bazaar://collection?slug=by_author&aid=monir-2497") StartActivity(ointent) slide.HideMenus End If
End Sub Sub SeekBar_ValueChanged (Value As Int, UserChanged As Boolean) label1(2).TextSize = Value End Sub Sub spinner_itemClick (Position As Int, Value As Object)
label1(2).Typeface = Typeface.LoadFromAssets(Value&".ttf") End Sub
Sub amozesh_android_click Dim b As Button b = Sender menu.child = "amozeshandroid" menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub Sub amozesh_narmafzar_click Dim b As Button b = Sender menu.child = "amozeshnarmafzar" menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub Sub tarfandandroid_click Dim b As Button b = Sender menu.child = "tarfandandroid" menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub Sub moarefinarmafzar_click Dim b As Button b = Sender menu.child = "moarefinarmafzar" menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub Sub moarefibazi_click Dim b As Button b = Sender menu.child = "moarefibazi" menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub Sub ClashofClans_click Dim b As Button b = Sender menu.child = "ClashofClans" menu.fasl = b.Tag
If menu.picshow = 1 Then Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 For i = 0 To 14 If cur.GetString("aks"&i) <> Null Then menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width) End If Next End If StartActivity("safematn") End Sub Sub sabt_click Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM setting") cur.Position=0
menu.s.ExecNonQuery("UPDATE setting SET fontsize ="&SeekBar1.Value) menu.s.ExecNonQuery("UPDATE setting SET font ="&spinner1.Selectedindex)
menu.fontsize = SeekBar1.Value menu.font = spinner1.Getitem(spinner1.Selectedindex) slide.HideMenus ToastMessageShow("تنظیمات ذخیره شد",False) Activity.Finish StartActivity("safematn") End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then Activity.Finish End If
If KeyCode = KeyCodes.KEYCODE_MENU Then slide.ShowSecondaryMenu End If End Sub
Sub bookmark_Click
Dim cur As Cursor cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl) cur.Position=0 If bookmark_add.Visible = False Then
menu.s.ExecNonQuery("UPDATE "&menu.child&" SET mark=1 WHERE id="&menu.fasl) bookmark_add.Visible = True ToastMessageShow("به علاقه مندی ها اضافه شد",False) Else menu.s.ExecNonQuery("UPDATE "&menu.child&" SET mark=0 WHERE id="&menu.fasl) bookmark_add.Visible = False ToastMessageShow("از علاقه مندی ها حذف شد",False) End If
End Sub Sub download_Click
StartActivity(ointent)
End Sub Sub share_Click Dim text As Label text=Sender
Dim In As Intent In.Initialize(In.ACTION_SEND,"") In.SetType("text/plain") In.PutExtra("android.intent.extra.TEXT",text.Text) In.WrapAsIntentChooser("به اشتراک گذاری ...") StartActivity(In) End Sub
سوال
mehranarzani 39
دوستان کـــمـــک
چن ماهه الاف شدم
بابا کمکم کنید دا
کد اشتراک تو سورس های دیگه میذارم جواب میده ولی تو این سورس نمیدونم چرا جواب نمیده
مجبور شدم کل کد این بخش رو بذارم
گناه دارم دا چن ماهه الاف شدم لطفا کدو برام درست کنید
<
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("matn")
ScrollView2.initialize(100%y-96dip)
spinner1.initialize("spinner")
SeekBar1.initialize("SeekBar")
spinner1.AddAll(Array As String("tahoma","kamran","mehdi","yekan","bnazanin","morvard","bziba","shekari"))
For i=0 To label1.Length-1
label1(i).initialize("")
Next
action_bar.Bitmap = menu.action_bar_bitmap
bookmark.Bitmap = menu.bookmark
bookmark_add.Bitmap = menu.bookmark_add
'منو اسلاید
slide.initialize("slide")
slide.BehindOffset = 30%x
slide.Mode = slide.BOTH
Dim color As ColorDrawable
color.initialize(Colors.RGB(0, 210, 205),0)
slide.SecondaryMenu.Background = color
slide.Menu.Background = color
'راست اسلاید
Dim h As Int
h = 1%y
Dim btnm(5) As Button
For i=0 To btnm.Length-1
btnm(i).initialize("menu")
btnm(i).TextColor = Colors.Green
Dim b2 As BitmapDrawable
b2.Initialize(LoadBitmap(File.DirAssets,"button2.png"))
btnm(i).Background=b2
Next
btnm(0).text = "تنظیمات"
btnm(0).Tag = "تنظیمات"
slide.SecondaryMenu.AddView(btnm(0),1%x,h,68%x,10%y)
h=h+11%y
btnm(2).text = "پنج ستاره دادن"
btnm(2).Tag = "پنج ستاره دادن"
slide.SecondaryMenu.AddView(btnm(2),1%x,h,68%x,10%y)
h=h+11%y
btnm(4).text = "درباره ما"
btnm(4).Tag = "درباره ما"
slide.SecondaryMenu.AddView(btnm(4),1%x,h,68%x,10%y)
h=h+11%y
btnm(3).text = "منابع"
btnm(3).Tag = "منابع"
slide.SecondaryMenu.AddView(btnm(3),1%x,h,68%x,10%y)
h=h+11%y
btnm(1).Text = "برنامه های دیگر ما"
btnm(1).Tag = "برنامه های دیگر ما"
slide.SecondaryMenu.AddView(btnm(1),1%x,h,68%x,10%y)
h=h+11%y
'چپ اسلاید
'منو اسلاید پایان
Dim text As Label
If File.Exists (File.Dirinternal,"mahbanu.db") = False Then
File.Copy(File.DirAssets,"mahbanu.db",File.Dirinternal,"mahbanu.db")
End If
If menu.s.isinitialized=False Then
menu.s.initialize (File.Dirinternal,"mahbanu.db",True)
End If
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
If cur.GetString("link") <> Null Then
ointent.initialize(ointent.ACTiON_ViEW,cur.GetString("link"))
download.Visible = True
End If
If cur.Getint("mark") = 0 Then
bookmark_add.Visible = False
Else
bookmark_add.Visible = True
End If
Dim h As Int
For i = 0 To 14
'اضافه کردن متن
If cur.GetString("matn"&i) <> Null Then
Dim text As Label
text.initialize("Label")
text.text = cur.GetString("matn"&i)
text.Gravity = Gravity.RIGHT
text.TextColor = Colors.Black
text.TextSize = menu.fontsize
text.Typeface = Typeface.LoadFromAssets(menu.font &".ttf")
ScrollView1.Panel.AddView(text,0,h+2%y,ScrollView1.Width-10,ScrollView1.Height)
Dim su As StringUtils
text.Height= su.MeasureMultilineTextHeight(text,text.text)+10
h = h + su.MeasureMultilineTextHeight(text,text.text) + 30
ScrollView1.Panel.Height = h
End If
If cur.GetString("aks"&i) <> Null Then
'عکس دادن نشان
Dim imageView1 As ImageView
imageView1.initialize("imageView")
imageView1.tag = cur.GetString("aks"&i)
'اضافه کردن عکس
ScrollView1.Panel.AddView(imageView1,0,h,ScrollView1.Width,ScrollView1.Height)
imageView1.Bitmap = menu.Bitmap1(i)
If menu.Bitmap1(i).Width > 100%x Then
imageView1.Width = 100%x
imageView1.Height = (imageView1.Width / menu.Bitmap1(i).Width )*menu.Bitmap1(i).Height
imageView1.Gravity = Gravity.Fill
Else
imageView1.Width = menu.Bitmap1(i).Width
imageView1.Height = menu.Bitmap1(i).Height
imageView1.Left = (100%x - imageView1.Width)/2
imageView1.Gravity = Gravity.Fill
End If
h = h + imageView1.Height + 30
ScrollView1.Panel.Height = h
End If
'عکس کردن باز
Next
'گرفتن تنظیمات
tanzimat
End Sub
Sub btn_click
Dim b As Button
b = Sender
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub tanzimat
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM setting")
cur.Position = 0
SeekBar1.Value = menu.fontsize
spinner1.Selectedindex = cur.Getint("font")
label1(2).Typeface = Typeface.LoadFromAssets(menu.font&".ttf")
End Sub
Sub action_bar_Click
slide.ShowSecondaryMenu
End Sub
Sub menu_click
Dim b As Button
b = Sender
slide.Menu.RemoveAllViews
ScrollView2.Panel.RemoveAllViews
slide.Menu.AddView(ScrollView2,0,48dip,70%x,ScrollView2.Panel.Height)
slide.ShowMenu
Dim h As Int
h= 0
If b.Tag = "تنظیمات" Then
'تنظیمات
Dim btn As Button
btn.initialize("")
btn.Text = "تنظیمات"
btn.color = Colors.RGB(120, 75, 215)
slide.Menu.AddView(btn,0,h,70%x,48dip)
ScrollView2.Height = 100%y
Dim btn As Button
btn.initialize("sabt")
btn.Text = "ذخیره تنظیمات"
btn.color = Colors.RGB(231, 76, 60)
slide.Menu.AddView(btn,0,100%y-48dip,70%x,48dip)
'فونت سایز
label1(0).Text = "اندازه متن"
label1(0).TextColor = Colors.Black
label1(0).Gravity = Gravity.CENTER
ScrollView2.Panel.AddView(label1(0),1%x,h,68%x,48dip)
h = h +label1(0).Height
ScrollView2.Panel.AddView(SeekBar1,1%x,h,68%x,48)
SeekBar1.Max = 50
h = h + SeekBar1.Height
ScrollView2.Panel.Height = h
'نوع فونت
label1(1).Text = "نوع قلم"
label1(1).TextColor = Colors.Black
label1(1).Gravity = Gravity.CENTER
ScrollView2.Panel.AddView(label1(1),1%x,h,68%x,48dip)
h = h +label1(1).Height
spinner1.DropdownBackgroundColor = Colors.RGB(52, 152, 219)
ScrollView2.Panel.AddView(spinner1,1%x,h,68%x,48dip)
h = h + spinner1.Height
ScrollView2.Panel.Height = h
'نمونه متن
label1(2).Text = "متن نمونه"
label1(2).TextColor = Colors.Red
label1(2).Gravity = Gravity.CENTER
ScrollView2.Panel.AddView(label1(2),1%x,h,68%x,70dip)
h = h +label1(2).Height + 20
ScrollView2.Panel.Height = h +label1(2).Height + 20
End If
If b.Tag = "پنج ستاره دادن" Then
Dim ointent As Intent
ointent.initialize(ointent.ACTiON_EDIT,"ماه بانو در کافه بازار برای اندروید")
StartActivity(ointent)
slide.HideMenus
End If
If b.Tag = "درباره ما" Then
'تنظیمات
Dim btn As Button
btn.initialize("")
btn.Text = "درباره ما"
btn.color = Colors.RGB(120, 75, 215)
slide.Menu.AddView(btn,0,h,70%x,48dip)
ScrollView2.Height = 100%y
Dim h As Int
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM setting")
cur.Position = 0
Dim label2 As Label
label2.initialize("Label")
label2.Text = cur.GetString("rahnama")
label2.Gravity = Gravity.RiGHT
label2.TextColor = Colors.Black
label2.TextSize = menu.fontsize
label2.Typeface = Typeface.LoadFromAssets(menu.font&".ttf")
ScrollView2.Panel.AddView(label2,0,h+2%y,ScrollView2.Width-10,ScrollView2.Height)
Dim su As StringUtils
label2.Height= su.MeasureMultilineTextHeight(label2,label2.Text)+10
h = h + su.MeasureMultilineTextHeight(label2,label2.Text) + 30
ScrollView2.Panel.Height = h
End If
If b.Tag = "منابع" Then
'تنظیمات
Dim btn As Button
btn.initialize("")
btn.Text = "منابع"
btn.color = Colors.RGB(120, 75, 215)
slide.Menu.AddView(btn,0,h,70%x,48dip)
ScrollView2.Height = 100%y
Dim h As Int
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM setting")
cur.Position = 0
Dim label2 As Label
label2.initialize("Label")
label2.Text = cur.GetString("manabe")
label2.Gravity = Gravity.CENTER
label2.TextColor = Colors.Black
label2.TextSize = menu.fontsize
label2.Typeface = Typeface.LoadFromAssets(menu.font&".ttf")
ScrollView2.Panel.AddView(label2,0,h+2%y,ScrollView2.Width-10,ScrollView2.Height)
Dim su As StringUtils
label2.Height= su.MeasureMultilineTextHeight(label2,label2.Text)+10
h = h + su.MeasureMultilineTextHeight(label2,label2.Text) + 30
ScrollView2.Panel.Height = h
End If
If b.Tag = "برنامه های دیگر ما" Then
Dim ointent As Intent
ointent.Initialize(ointent.ACTION_VIEW,"bazaar://collection?slug=by_author&aid=monir-2497")
StartActivity(ointent)
slide.HideMenus
End If
End Sub
Sub SeekBar_ValueChanged (Value As Int, UserChanged As Boolean)
label1(2).TextSize = Value
End Sub
Sub spinner_itemClick (Position As Int, Value As Object)
label1(2).Typeface = Typeface.LoadFromAssets(Value&".ttf")
End Sub
Sub amozesh_android_click
Dim b As Button
b = Sender
menu.child = "amozeshandroid"
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub amozesh_narmafzar_click
Dim b As Button
b = Sender
menu.child = "amozeshnarmafzar"
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub tarfandandroid_click
Dim b As Button
b = Sender
menu.child = "tarfandandroid"
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub moarefinarmafzar_click
Dim b As Button
b = Sender
menu.child = "moarefinarmafzar"
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub moarefibazi_click
Dim b As Button
b = Sender
menu.child = "moarefibazi"
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub ClashofClans_click
Dim b As Button
b = Sender
menu.child = "ClashofClans"
menu.fasl = b.Tag
If menu.picshow = 1 Then
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
For i = 0 To 14
If cur.GetString("aks"&i) <> Null Then
menu.bitmap1(i).initializeSample(File.DirAssets,cur.GetString("aks"&i)&".jpg",Activity.Height,Activity.Width)
End If
Next
End If
StartActivity("safematn")
End Sub
Sub sabt_click
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM setting")
cur.Position=0
menu.s.ExecNonQuery("UPDATE setting SET fontsize ="&SeekBar1.Value)
menu.s.ExecNonQuery("UPDATE setting SET font ="&spinner1.Selectedindex)
menu.fontsize = SeekBar1.Value
menu.font = spinner1.Getitem(spinner1.Selectedindex)
slide.HideMenus
ToastMessageShow("تنظیمات ذخیره شد",False)
Activity.Finish
StartActivity("safematn")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Activity.Finish
End If
If KeyCode = KeyCodes.KEYCODE_MENU Then
slide.ShowSecondaryMenu
End If
End Sub
Sub bookmark_Click
Dim cur As Cursor
cur = menu.s.ExecQuery ("SELECT * FROM "&menu.child &" WHERE id= "&menu.fasl)
cur.Position=0
If bookmark_add.Visible = False Then
menu.s.ExecNonQuery("UPDATE "&menu.child&" SET mark=1 WHERE id="&menu.fasl)
bookmark_add.Visible = True
ToastMessageShow("به علاقه مندی ها اضافه شد",False)
Else
menu.s.ExecNonQuery("UPDATE "&menu.child&" SET mark=0 WHERE id="&menu.fasl)
bookmark_add.Visible = False
ToastMessageShow("از علاقه مندی ها حذف شد",False)
End If
End Sub
Sub download_Click
StartActivity(ointent)
End Sub
Sub share_Click
Dim text As Label
text=Sender
Dim In As Intent
In.Initialize(In.ACTION_SEND,"")
In.SetType("text/plain")
In.PutExtra("android.intent.extra.TEXT",text.Text)
In.WrapAsIntentChooser("به اشتراک گذاری ...")
StartActivity(In)
End Sub
>
لینک ارسال
به اشتراک گذاری در سایت های دیگر
2 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.