Sub Globals
Dim prrecy As PersianRecyclerLayout
Dim p As Picasso
Type MyModel(id As String,name As String,link As String)
Dim h As HttpJob
Dim mylist As List
Dim myylist As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
prrecy.Builder("pr").NormalRecycler.BALayout.ListView.RecyclerView.withDefaultDividier(prrecy.Oriantation_Vertical).Build
Activity.AddView(prrecy,0,0,100%x,100%y)
myylist.Initialize
h.Initialize("h",Me)
h.Download("http://fntop.ir/apk/heyyat_apk/nava.php")
p.Initialize
prrecy.ShowRecycler
End Sub
Sub jobdone (job As HttpJob)
If (job.Success=True)Then
If(job.JobName.EqualsIgnoreCase("h"))Then
Dim json As JSONParser
json.Initialize(job.GetString)
Dim mymap As Map
mylist.Initialize
mymap.Initialize
mylist=json.NextArray
For i = 0 To mylist.Size-1
mymap=mylist.Get(i)
Dim mymdl As MyModel
mymdl.Initialize
mymdl.id=mymap.get("id")
mymdl.name=mymap.get("name")
mymdl.link=mymap.get("link")
myylist.Add(mymdl)
Next
prrecy.notifyDataSetChanged
End If
Else
ToastMessageShow("h",True)
End If
End Sub
Private Sub prrecy_getItemCount As Int
Return myylist.Size
End Sub
Private Sub prrecy_onCreateViewHolder(layoutitem As Object,viewtype As Int) As Object
Dim pnl As Panel=layoutitem
Dim lbl As Label
lbl.Initialize("")
pnl.AddView(lbl,0,0,100%x-100dip,100dip)
Dim img As ImageView
img.Initialize("")
pnl.AddView(img,100%x-100dip,0,100dip,100dip)
Return Null
End Sub
Private Sub prrecy_onBindViewHolder(layoutitem As Object,position As Int,viewtype As Int)
Dim pnl As Panel=layoutitem
pnl.Width=100%x
pnl.Height=100dip
Dim lbl As Label=pnl.GetView(0)
Dim img As ImageView=pnl.GetView(1)
Dim mymdl As MyModel=myylist.Get(position)
lbl.Text=mymdl.name
p.LoadUrl(mymdl.link).IntoImageView(img)
End Sub
سوال
[email protected] 3
سلام چرا اطلاعات دیتابیس رو نشون نمیده؟؟
Sub Globals Dim prrecy As PersianRecyclerLayout Dim p As Picasso Type MyModel(id As String,name As String,link As String) Dim h As HttpJob Dim mylist As List Dim myylist As List End Sub Sub Activity_Create(FirstTime As Boolean) prrecy.Builder("pr").NormalRecycler.BALayout.ListView.RecyclerView.withDefaultDividier(prrecy.Oriantation_Vertical).Build Activity.AddView(prrecy,0,0,100%x,100%y) myylist.Initialize h.Initialize("h",Me) h.Download("http://fntop.ir/apk/heyyat_apk/nava.php") p.Initialize prrecy.ShowRecycler End Sub Sub jobdone (job As HttpJob) If (job.Success=True)Then If(job.JobName.EqualsIgnoreCase("h"))Then Dim json As JSONParser json.Initialize(job.GetString) Dim mymap As Map mylist.Initialize mymap.Initialize mylist=json.NextArray For i = 0 To mylist.Size-1 mymap=mylist.Get(i) Dim mymdl As MyModel mymdl.Initialize mymdl.id=mymap.get("id") mymdl.name=mymap.get("name") mymdl.link=mymap.get("link") myylist.Add(mymdl) Next prrecy.notifyDataSetChanged End If Else ToastMessageShow("h",True) End If End Sub Private Sub prrecy_getItemCount As Int Return myylist.Size End Sub Private Sub prrecy_onCreateViewHolder(layoutitem As Object,viewtype As Int) As Object Dim pnl As Panel=layoutitem Dim lbl As Label lbl.Initialize("") pnl.AddView(lbl,0,0,100%x-100dip,100dip) Dim img As ImageView img.Initialize("") pnl.AddView(img,100%x-100dip,0,100dip,100dip) Return Null End Sub Private Sub prrecy_onBindViewHolder(layoutitem As Object,position As Int,viewtype As Int) Dim pnl As Panel=layoutitem pnl.Width=100%x pnl.Height=100dip Dim lbl As Label=pnl.GetView(0) Dim img As ImageView=pnl.GetView(1) Dim mymdl As MyModel=myylist.Get(position) lbl.Text=mymdl.name p.LoadUrl(mymdl.link).IntoImageView(img) End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر
1 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.