B4A Library B4APhotoPager v3.85

bluedude

Well-Known Member
Licensed User
Longtime User
Is there a way to get the exact path to the images downloaded? I'm also missing a way to get the URL of the image by an image index.

Can both be added?
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi all, B4APhotoPager is updated v1.70 what's new:

.Mp4 supported just thumb.

Added:

GetItem return the full path.

Changed:

ToggleZoom,ToggleLock,ToggleFade,ToggleDoubleTap


B4X:
Sub p_Click

If (vp.ToggleZoom) Then
   vp.ToggleZoom = False
Else
   vp.ToggleZoom = True
End If

End Sub
 

bluedude

Well-Known Member
Licensed User
Longtime User
It still isn't perfect. I use two sliders, one on one activity and a second one on another activity. If someone clicks on activity one it opens activity two which has a slider that can zoom and tab.

However, because I need to do AddImageFromweb again to show it the same URL also gets loaded again in my first activity. Is there a way to load a cached image from the disk cache in these kind of situations?

AddImageFromWeb actually adds the same images to the cache (same URL's) again.

Cheers.
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi, I'm back and I'll give a luck thanks to report it.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Is there a way to know where the cache is stored and what the file names are? I cannot always use the slider in an activity.

Would be great to add images from memory (I use imag downloader service) or MYSQL through for example keyvaluestore.
 

Shahid Saeed

Active Member
Licensed User
Longtime User
@lonleystar is there a way to get the cached image path, I'm trying to share the image with Android Stream Intent and it requires the local path for the image, by using GetItem() I am able to get the full URL but it would be great if we can also get the cached image path.
 

Juanmavalero

Member
Licensed User
Longtime User
Hello lonleystar,
I am testing the version 1.70
Using ShowFromSdCard everything works fine but when I use AddImage the application closes without errors
I need to add the images manually.
Thanks for everything
 

lonleystar

Well-Known Member
Licensed User
Longtime User


Hi, the local path is the package name U'll find it in Android/data/
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hello lonleystar,
I am testing the version 1.70
Using ShowFromSdCard everything works fine but when I use AddImage the application closes without errors
I need to add the images manually.
Thanks for everything


Hi, I'll check it thank U to report the issue.
 

Shahid Saeed

Active Member
Licensed User
Longtime User
Hi, the local path is the package name U'll find it in Android/data/
@lonleystar I do understand the local path and can see the cached items in there. but the thing is all cached files has different names and I how do I get this name? also I want to access locally stored image because I want to USE share intent to share the specific image with other apps like Facebook twitter and without a local path it won't work. is there any possible way to do that?
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi, I'll implement a command to acces locally stored image.
 

johnB

Active Member
Licensed User
Longtime User
Hi lonelystar

I'm getting the following error

Gallery.SetArrayList(Gallery.GetArrayList) - SetArrayList Unknown Member

I have version 3.55 of GalleryView and V1.70 of PhotoPager

Regards
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi lonelystar

I'm getting the following error

Gallery.SetArrayList(Gallery.GetArrayList) - SetArrayList Unknown Member

I have version 3.55 of GalleryView and V1.70 of PhotoPager

Regards

Hi johnB, I'm sorry I forgot to say: ArrayList instead of GetArrayList,SetArrayList.

Code:

Gallery.ArrayList(Gallery.ArrayList) instead of Gallery.SetArrayList(Gallery.GetArrayList)
 

johnB

Active Member
Licensed User
Longtime User
Thanks lonelystar for prompt reply, I'll give that a go
 

johnB

Active Member
Licensed User
Longtime User
Thanks for the reply but I'm sorry to say that I couldn't get it didn't work.

Also, when you click on a thumbnail in the horizontal list, for me, it doesn't display the full screen

No problem with both, I'm using a different tack at the moment

Regards
 

Shahid Saeed

Active Member
Licensed User
Longtime User
@johnB there must be something you are missing. I am using both the GridView 3.50 and Pager 1.7 in my Application and I have no such error. below is what my code looks like. I am loading images from web through JSON code. My application uses full screen mode portrait mode and for PagerView it works full screen portrait and landscape. You can try the application here: https://play.google.com/store/apps/details?id=com.prcamels

This is the example code from Grid View:
B4X:
Sub Process_Globals    
    Dim PictureUrl As String = "http://www.domainname.com/pictures.json"
    Dim PictureJson As String
    Dim fromWeb As List
    Dim AlbumID As Int    
    Dim posSelected As Int
End Sub

Sub Globals        
    Dim GridView As PhotoGridView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("pictures")   
           
    GridView.initialize("GridView")    
    GridView.CacheInMemory = False
    GridView.CacheOnDisk = True   
    
        Activity.AddView(GridView,10dip,50dip,100%x-20dip,100%y-160dip)
        GridView.ItemWidth= GridView.Width / 3
        GridView.ItemHeight= GridView.ItemWidth
        GridView.HorizontalSpacing=4dip   
        GridView.VerticalSpacing=4dip
        GridView.NumColumns= 3       

    GridView.Gravity=Gravity.CENTER
    GridView.ScaleType = GridView.ScaleType.Fit_XY
   
    GridView.SetNoEffect = False
    GridView.FadeInTime = 300
    GridView.RoundedBitmap = False
    GridView.SetBorderColor = Colors.RGB(133,22,30)
    GridView.SetBorderWidth =1

    GridView.ProgressBarIndeterminate = True
    GridView.ProgressBarVisible = True

    GridView.TextColor = Colors.Black
    GridView.TextSize = 12
    GridView.ShowText = False
    GridView.TextGravity = Gravity.CENTER
    GridView.TextPosition = GridView.TextPosition.Text_Bottom_Inside
   
    GridView.TextStyle =  GridView.TextTypeFace.Style_Italic
    GridView.CompressFormat = GridView.CompressFormat.Compress_Format_JPG
    GridView.CompressQuality = 80
   
    GridView.SetImageOnLoading = "empty_photo1.png"
    GridView.SetImageOnFail = "ic_error1.png"
   
    Dim GetPage As HttpJob
    GetPage.Initialize("GetPageJob", Me)
    GetPage.Download(PictureUrl)
    ProgressDialogShow2("please wait loading...", False)
   
End Sub

Sub ParseJSON(json As String)
    Dim parser As JSONParser
    parser.Initialize(json)
   
    Dim root As Map = parser.NextObject
    Dim albums As List = root.Get("albums")
    Dim actAlbum As Int = -1   
    For Each col_albums As Map In albums
        actAlbum = actAlbum +1         
        Dim album_title As String = col_albums.Get("album_title")
        fromWeb.Initialize
        If actAlbum = AlbumID Then       
        Dim pictures As List = col_albums.Get("pictures")
            Dim pic_row As Int = -1
            For Each album_pictures As Map In pictures
            pic_row = pic_row +1
            Dim picture_title As String = album_pictures.Get("picture_title")
            Dim picture_image As String = album_pictures.Get("picture_image")
           
            GridView.AddImageFromWeb(picture_image)
            GridView.SetText2(pic_row, picture_title)   
            fromWeb.Add(picture_image)           
            Next
            GridView.SetArrayList(fromWeb)                   
        Page_title.Text = album_title
        End If       
    Next   
End Sub

Sub JobDone(job As HttpJob)
    If job.Success = True Then
        PictureJson = job.GetString
        ParseJSON(PictureJson)
        ProgressDialogHide
    Else
        Log("Error: " & job.ErrorMessage)
    End If       
End Sub

Sub Activity_Resume
    GridView.ResumeEngine
End Sub
Sub Activity_Pause (UserClosed As Boolean)
    GridView.StopEngine
End Sub

Sub GridView_ItemClick(Position As Int, Value As Object)  
    posSelected = Position
    Picture.a.Initialize
    Picture.a.AddAll(GridView.GetArrayList)   
    StartActivity(Picture)       
End Sub

This will be the code for PagerView:
B4X:
Sub Process_Globals    
    Dim a As List
    Dim NewPos As Int
End Sub

Sub Globals
    Dim vp As PhotoPager    
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("picture")

    vp.Initialize("vp")
    If Activity.Width > Activity.Height Then
    Activity.AddView(vp, 0, 12.5%y, 100%x, 100%y-12.5%y)
    Else
    Activity.AddView(vp, 0, 8.33%y, 100%x, 100%y-8.33%y)   
    End If
    vp.Color = Colors.Black
    vp.ScaleType = vp.ScaleType.Fit_Center   
    vp.ToggleFade = True
    vp.ToggleLock = True
    vp.OutlineEnabled = False
    vp.OutlineColor = Colors.Transparent
    vp.Effect = vp.Effect.FlipHorizontal
    vp.ToggleDoubleTap = True    
    vp.CacheOnDisk = True
    vp.ProgressBarVisible = True

    vp.SetArrayList(a)
    vp.CurrentItem = Pictures.posSelected  
   
End Sub

Sub vp_PageSelected(Position As Int)    
    NewPos = Position   
End Sub

Sub Activity_Resume
    
End Sub

Sub Activity_Pause (UserClosed As Boolean)    
    Pictures.posSelected = NewPos
End Sub

Sub vp_LongClick
    vp.ClearDiskCache
    vp.DestroyEngine
    Activity.Finish
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…