wrapper for this:https://github.com/rs/SDWebImage
log
the file I've sent to Erel by email
and you can compile it by youself after
git clone https://git.oschina.net/icefairy/b4xlibs_tk.git
it's in path:b4xlibs\b4ilibs\iSDWebImage
or you can download it(compiled version) from google drive:https://drive.google.com/file/d/0B6W0AEYAT5c1djRXQWZ5cl9QeDg/view?usp=sharing
B4X:
'Code module
#Region Project Attributes
#ApplicationLabel: B4i Example
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 8
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
Private ImageView1 As ImageView
Private ImageView2 As ImageView
Private ImageView3 As ImageView
Private ImageView4 As ImageView
Private ImageView6 As ImageView
Private ImageView5 As ImageView
Private sdimgldr As iSDWebImage
Dim bmpholder As Bitmap
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.LoadLayout("laytest")
NavControl.ShowPage(Page1)
'image url should start with https://
Dim url() As String=Array As String("https://app.kaopuedu.com/Uploads/touxiang/2016-10-02/57f0cdbdee7f4.jpg","https://app.kaopuedu.com/Uploads/touxiang/2016-10-17/5804b1b4114e5.jpg","https://app.kaopuedu.com/Uploads/touxiang/2016-10-12/57fdbe355efbf.jpg","https://app.kaopuedu.com/Uploads/houduan/2016-10-15/58020cc774c3b.jpg")
Dim ivs() As ImageView=Array As ImageView(ImageView1,ImageView2,ImageView3,ImageView4,ImageView5,ImageView6)
bmpholder=LoadBitmap(File.DirAssets,"test_tecbg.png")
For i=0 To url.Length-1
' comm.loadimg(url(i),ivs(i))
sdimgldr.setImageWithURL("img",ivs(i),url(i),bmpholder)
Next
End Sub
Sub img_sdComplete(m As Map)
Log("img_sdComplete")
Log(m)
End Sub
Sub img_sdProgress(nRec As Int,nTot As Int,sdUrl As String)
Log(nRec&"/"&nTot&" "&sdUrl)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
End Sub
Private Sub Application_Background
End Sub
B4X:
Application_Start
Application_Active
img_sdComplete
NSMapTable {
[1] bmp -> <UIImage: 0x17e8ff70>, {500, 500}
[2] url -> https://app.kaopuedu.com/Uploads/touxiang/2016-10-02/57f0cdbdee7f4.jpg
[12] finished -> 1
}
img_sdComplete
NSMapTable {
[1] bmp -> <UIImage: 0x17d76990>, {499, 500}
[2] url -> https://app.kaopuedu.com/Uploads/touxiang/2016-10-17/5804b1b4114e5.jpg
[12] finished -> 1
}
img_sdComplete
NSMapTable {
[1] bmp -> <UIImage: 0x17e8df20>, {432, 432}
[2] url -> https://app.kaopuedu.com/Uploads/touxiang/2016-10-12/57fdbe355efbf.jpg
[12] finished -> 1
}
img_sdComplete
NSMapTable {
[1] bmp -> <UIImage: 0x17e88630>, {101, 101}
[2] url -> https://app.kaopuedu.com/Uploads/houduan/2016-10-15/58020cc774c3b.jpg
[12] finished -> 1
}
the file I've sent to Erel by email
and you can compile it by youself after
git clone https://git.oschina.net/icefairy/b4xlibs_tk.git
it's in path:b4xlibs\b4ilibs\iSDWebImage
or you can download it(compiled version) from google drive:https://drive.google.com/file/d/0B6W0AEYAT5c1djRXQWZ5cl9QeDg/view?usp=sharing
Attachments
Last edited: