#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
Sub Process_Globals
Dim i As Intent
Dim lslinkmyket As List
Dim lslinkbazar As List
Dim lsname As List
Dim lstozih As List
Dim lsicon As List
Dim lslinkavval As List
End Sub
Sub Globals
Dim aria As AriaListView
Dim adapter As AriaAdapterWithImage
End Sub
Sub Activity_Create(FirstTime As Boolean)
If File.Exists(File.DirInternal,"ourapps.txt") Then
Else
File.Copy(File.DirAssets,"ourapps.txt",File.DirInternal,"ourapps.txt")
End If
lsicon.Initialize
lslinkbazar.Initialize
lslinkavval.Initialize
lslinkmyket.Initialize
lsname.Initialize
lstozih.Initialize
Activity.SetBackgroundImage(LoadBitmap(File.DirAssets,"gb.png"))
aria.Initialize("aria")
Activity.AddView(aria,0,0,100%x,100%y)
parsing(File.ReadString(File.DirInternal,"ourapps.txt"))
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub parsing (text As String)
lsicon.clear
lslinkbazar.clear
lslinkavval.clear
lslinkmyket.clear
lsname.clear
lstozih.clear
' Dim pica As Picasso
Dim parser As JSONParser
parser.Initialize(text)
Dim root As Map = parser.NextObject
Dim apps As List = root.Get("apps")
For Each colapps As Map In apps
Dim linkmyket As String = colapps.Get("linkmyket")
Dim linkbazar As String = colapps.Get("linkbazar")
Dim name As String = colapps.Get("name")
Dim tozih As String = colapps.Get("tozih")
Dim icon As String = colapps.Get("icon")
Dim linkavval As String = colapps.Get("linkavval")
' Log(name)
lsicon.Add(icon)
lslinkbazar.Add(linkbazar)
lslinkavval.Add(linkavval)
lslinkmyket.Add(linkmyket)
lsname.Add(name)
lstozih.Add(tozih)
Next
adapter.Initialize(adapter.Layouts.LAYOUT_IMAGE_RIGHT,lsname,lstozih,lsicon).ToListView(aria)
adapter.NotifyDataSetChanged
End Sub
Sub aria_imagelongclicked (ParentEventName As String,position As Int)
Log("ddd")
End Sub
Sub aria_select (ParentEventName As String,position As Int)
Dim t As String
t=lslinkbazar.Get(position)
ToastMessageShow(t,False)
ToastMessageShow(ParentEventName,False)
i.Initialize(i.ACTION_VIEW,t)
StartActivity(i)
End Sub
کد json لینکها
{
"apps":[
{"name":"کارت ملی هوشمند","tozih":" کارت ملیتو هوشمند کن","icon":"http://peem.ir/zelzele/icons/smart.png","linkbazar":"http://goo.gl/zanjfnq","linkmyket":"http://goo.gl/esSpL","linkavval":""},
{"name":"کنجد","tozih":"قفل ساعتی زیبا ","icon":"http://peem.ir/zelzele/icons/lock.png","linkbazar":"http://goo.gl/D6i99G","linkmyket":"http://goo.gl/uj4ofE","linkavval":""},
{"name":"قفل صفحه ال جی","tozih":"قفل صفحه گوشیتو مثل گوشی ال جی کن","icon":"http://peem.ir/zelzele/icons/lglock.png","linkbazar":"http://goo.gl/UWFJbK","linkmyket":"http://goo.gl/e5zArb","linkavval":""},
{"name":"چاقی صورت","tozih":"صورتتو چاق کن","icon":"http://peem.ir/zelzele/icons/face.png","linkbazar":"http://goo.gl/pfqKKA","linkmyket":"http://goo.gl/2KAfq4","linkavval":""}
]
}
سوال
mehran3d 75
عکسها و نوشته ها اوکی هستن
عکسها لود میشن ولی رویداد کلیک عمل نمی کنه
آریا لیست ویو نسخه 8.2
#Region Activity Attributes #FullScreen: True #IncludeTitle: False #End Region Sub Process_Globals Dim i As Intent Dim lslinkmyket As List Dim lslinkbazar As List Dim lsname As List Dim lstozih As List Dim lsicon As List Dim lslinkavval As List End Sub Sub Globals Dim aria As AriaListView Dim adapter As AriaAdapterWithImage End Sub Sub Activity_Create(FirstTime As Boolean) If File.Exists(File.DirInternal,"ourapps.txt") Then Else File.Copy(File.DirAssets,"ourapps.txt",File.DirInternal,"ourapps.txt") End If lsicon.Initialize lslinkbazar.Initialize lslinkavval.Initialize lslinkmyket.Initialize lsname.Initialize lstozih.Initialize Activity.SetBackgroundImage(LoadBitmap(File.DirAssets,"gb.png")) aria.Initialize("aria") Activity.AddView(aria,0,0,100%x,100%y) parsing(File.ReadString(File.DirInternal,"ourapps.txt")) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub parsing (text As String) lsicon.clear lslinkbazar.clear lslinkavval.clear lslinkmyket.clear lsname.clear lstozih.clear ' Dim pica As Picasso Dim parser As JSONParser parser.Initialize(text) Dim root As Map = parser.NextObject Dim apps As List = root.Get("apps") For Each colapps As Map In apps Dim linkmyket As String = colapps.Get("linkmyket") Dim linkbazar As String = colapps.Get("linkbazar") Dim name As String = colapps.Get("name") Dim tozih As String = colapps.Get("tozih") Dim icon As String = colapps.Get("icon") Dim linkavval As String = colapps.Get("linkavval") ' Log(name) lsicon.Add(icon) lslinkbazar.Add(linkbazar) lslinkavval.Add(linkavval) lslinkmyket.Add(linkmyket) lsname.Add(name) lstozih.Add(tozih) Next adapter.Initialize(adapter.Layouts.LAYOUT_IMAGE_RIGHT,lsname,lstozih,lsicon).ToListView(aria) adapter.NotifyDataSetChanged End Sub Sub aria_imagelongclicked (ParentEventName As String,position As Int) Log("ddd") End Sub Sub aria_select (ParentEventName As String,position As Int) Dim t As String t=lslinkbazar.Get(position) ToastMessageShow(t,False) ToastMessageShow(ParentEventName,False) i.Initialize(i.ACTION_VIEW,t) StartActivity(i) End Sub
کد json لینکها
{ "apps":[ {"name":"کارت ملی هوشمند","tozih":" کارت ملیتو هوشمند کن","icon":"http://peem.ir/zelzele/icons/smart.png","linkbazar":"http://goo.gl/zanjfnq","linkmyket":"http://goo.gl/esSpL","linkavval":""}, {"name":"کنجد","tozih":"قفل ساعتی زیبا ","icon":"http://peem.ir/zelzele/icons/lock.png","linkbazar":"http://goo.gl/D6i99G","linkmyket":"http://goo.gl/uj4ofE","linkavval":""}, {"name":"قفل صفحه ال جی","tozih":"قفل صفحه گوشیتو مثل گوشی ال جی کن","icon":"http://peem.ir/zelzele/icons/lglock.png","linkbazar":"http://goo.gl/UWFJbK","linkmyket":"http://goo.gl/e5zArb","linkavval":""}, {"name":"چاقی صورت","tozih":"صورتتو چاق کن","icon":"http://peem.ir/zelzele/icons/face.png","linkbazar":"http://goo.gl/pfqKKA","linkmyket":"http://goo.gl/2KAfq4","linkavval":""} ] }
لینک ارسال
به اشتراک گذاری در سایت های دیگر
1 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.