I have ListView that holds 500 items...
Item1
Item2
Item3
Item4
.
.
.
Item497
Item498
Item499
Item500
When i scroll down by one i call Job Download whitch downloads image from server...this works excellent if i scroll by one with small delay between item scroll down or up...if i scroll fast down 3x times i get image from 1item, 2item and 3item..how i get only 3 item?
Example:
I im at Item1, a press on remote control to scroll down fast 3 times button down so i get at Item4, on imageview i see then item1 image, then item2 image, item3 image and finally item4 image...how could i get image 4 display?
So that i display from item1 image to item4 image? To not to download images between?
I im using this code:
Item1
Item2
Item3
Item4
.
.
.
Item497
Item498
Item499
Item500
When i scroll down by one i call Job Download whitch downloads image from server...this works excellent if i scroll by one with small delay between item scroll down or up...if i scroll fast down 3x times i get image from 1item, 2item and 3item..how i get only 3 item?
Example:
I im at Item1, a press on remote control to scroll down fast 3 times button down so i get at Item4, on imageview i see then item1 image, then item2 image, item3 image and finally item4 image...how could i get image 4 display?
So that i display from item1 image to item4 image? To not to download images between?
I im using this code:
B4X:
'GET - KeyUp
Sub Activity_KeyUp (KeyCode As Int) As Boolean
'SELECT - Remote Code
Select KeyCode
Case KeyCodes.KEYCODE_DPAD_DOWN
'UPDATE - Movies
UpdateMovies(ScrolledMovie)
'GET - MovieCover
GetMovieCover(Movies(ScrolledMovie, 14))
Case KeyCodes.KEYCODE_DPAD_UP
'UPDATE - Movies
UpdateMovies(ScrolledMovie)
'GET - MovieCover
GetMovieCover(Movies(ScrolledMovie, 14))
Case 92
'UPDATE - Movies
UpdateMovies(ScrolledMovie)
'GET - MovieCover
GetMovieCover(Movies(ScrolledMovie, 14))
Case 93
'UPDATE - Movies
UpdateMovies(ScrolledMovie)
'GET - MovieCover
GetMovieCover(Movies(ScrolledMovie, 14))
End Select
End Sub
'GET - MovieCover
Sub GetMovieCover(CoverID As Int)
'DEFINE - Jobs
Dim Job0 As HttpJob
'INITIALIZE - Job0
Job0.Initialize("Job0", Me)
'GET - MovieCover
Job0.Download("http://myurl/moviecoverID.jpg")
End Sub
'DONE - Jobs
Sub JobDone(Job As HttpJob)
'DEFINE - RSImageEffects
Dim RSImageEffects1 As RSImageEffects
'CHECK - Jobs
If Job.Success = True Then
Select Job.JobName
Case "Job0"
'CHECK - Return EPGs
If (Job.GetBitmap.Width > 0) Then
'CENTER - Bitmaps
imgPreview.Gravity = Gravity.FILL
'SET - Bitmaps
imgPreview.SetBackgroundImage(Job.GetBitmap)
'ROUND - Bitmaps
imgPreview.Bitmap = RSImageEffects1.RoundCorner(Job.GetBitmap, 5)
End If
End Select
End If
'RELEASE - Jobs
Job.Release
End Sub