B4A Library B4APhotoPager v3.85

B4APhotoPager v3.80 By Giuseppe Salvi


B4APhotoPager
Author: Giuseppe Salvi
Version: 3.8

  • Properties:
    • FromAssets As String [read only]
      Returns a references to the file added to the files tab. These file are read-only.
    • FromExtSdCard As String [read only]
      Returns image is located on the local file system or external SD card.
    • FromHttp As String [read only]
      Returns image is located in the network.
    • FromHttps As String [read only]
      Returns the image is located in the network.
    • FromSdCard As String [read only]
      Returns image is located on the local file system or SD card

  • Fields:
    • Compress_Format_JPG As CompressFormat
      Compression Format JPG
    • Compress_Format_PNG As CompressFormat
      Compression Format PNG

  • Fields:
    • Accordion As Int
    • BgToFg As Int
    • CardSlide As Int
    • Default As Int
    • DeptPage As Int
    • FadeInOut As Int
    • FgToBg As Int
    • FlipHorizontal As Int
    • FlipVertical As Int
    • HorizontalCube As Int
    • HorizontalElastic As Int
    • RotateDown As Int
    • RotateUp As Int
    • Rotation As Int
    • RotationSquare As Int
    • ScaleBgToFg As Int
    • Stack As Int
    • Tablet As Int
    • Transition_01 As Int
    • Transition_02 As Int
    • Transition_03 As Int
    • VerticalCube As Int
    • VerticalElastic As Int
    • ZoomIn As Int
    • ZoomOut As Int
    • ZoomOutSlide As Int

  • Fields:
    • Center As ScaleType
      Center the image in the view, but perform no scaling.
    • Center_Crop As ScaleType
      Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image
      will be equal to or larger than the corresponding dimension of the view (minus padding).
    • Center_Inside As ScaleType
      Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image
      will be equal to or less than the corresponding dimension of the view (minus padding).
    • Fit_Center As ScaleType
      Scale the image using CENTER.
    • Fit_End As ScaleType
      Scale the image using END.
    • Fit_Start As ScaleType
      Scale the image using START.
    • Fit_XY As ScaleType
      Scale the image using FILL.
  • PhotoPager
    Events:
    • Click
    • LongClick
    • MatrixChanged (Left As Int, Top As Int, Right As Int, Bottom As Int, Width As Int, Height As Int, CenterX As Int, CenterY As Int)
    • PageScrollStateChanged (State As Int)
    • PageScrolled (Position As Int, PositionOffset As Float, PositionOffsetPixels As Int)
    • PageSelected (Position As Int)
    • Ready
    • ScaleChanged (ScaleFactor As Int, FocusX As Int, FocusY As Int)
    Methods:
    • AddImage (dir As String, file As String)
      Add an image from sdcard or AssetsDir at the end of the view pager .
    • AddImageAt (index As Int, dir As String, file As String)
      Add an image from sdcard or AssetsDir to the desired position in the view pager.
    • AddImageFromWeb (address As String)
      Add an image from web and from Dropbox at the end of the view pager.
    • AddImageFromWebAt (index As Int, address As String)
      Add an image from web and from Dropbox to the desired position in the view pager.
    • AddView (view As View)
      Adds a view to the page.
      view: View
    • AddView2 (view As View, left As Int, top As Int, width As Int, height As Int)
      Adds a view to the page.
      view: View
      left: Left
      top: Top
      width: Width
      height: Height
    • AddViewAt (index As Int, view As View)
      Adds a view to the specified index.
      index: Page index
      view: View
    • AddViewAt2 (index As Int, view As View, left As Int, top As Int, width As Int, height As Int)
      Adds a view to the specified index.
      view: View
      left: Left
      top: Top
      width: Width
      height: Height
    • BringToFront
    • ClearDiskCache
      Clears disk cache.
    • ClearMemoryCache
      Clears memory cache.
    • DestroyEngine
      Stops ImageLoader and clears current configuration. Use this option on exit app.
    • GetArrayList As List
      Get array from GridView, Gallery, PhotoFlow.
    • GetImageListFromAssets (path As String, sort As Boolean) As List
      Get entire list of images stored in assets or sub-folder
      Examples:
      <code>
      Dim lv as ListView
      Dim l as list
      l.Initialize
      lv.Initialize("lv")
      Sub Menu_Click
      Activity.AddView(lv,0,0,100%x,100%y)
      l = vp.GetImageListFromAssets("Here the Images folder stored in Assets")
      or
      l = vp.GetImageListFromAssets(File.DirAssets)
      or
      l = vp.GetImageListFromAssets("")
      For n = 0 To l.Size-1
      lv.AddSingleLine(l.Get(n))
      next
      End Sub
      </code>
    • GetItem (position As Int) As String
      Returns Item
      Example:
      i.Bitmap=LoadBitmap("",g.GetItem(Position))
    • GetPageTag (index As Int) As Object
      Get or Sets the tag associated with this views. A tag can be used to mark
      a view in its hierarchy and does not have to be unique within the
      hierarchy. Tags can also be used to store data within a view without
      resorting to another data structure.
      index: the index of the page
      tag: return the Object stored in this view as a tag, or null if not set
    • GoToPage (item As Int, smoothScroll As Boolean)
      Get or Sets the currently selected page.
    • Initialize (EventName As String, initializeView As Boolean)
      Initialize the object
    • IsDoubleTapEnabled As Boolean
      Gets double tap from the page.
    • IsFadeEnabled As Boolean
      Gets fade from the page.
    • IsInitialized As Boolean
    • IsLockEnabled As Boolean
      Gets lock from the page.
    • IsPageEnabled (index As Int) As Boolean
      Returns the enabled status for this view. The interpretation of the
      enabled state varies by subclass.
      index: Page index
      Return type: @return:True if this view is enabled, false otherwise.
    • IsPageVisible (index As Int) As Boolean
      Returns the enabled status for this view. The interpretation of the
      enabled state varies by subclass.
      index: Page index
      Return type: @return:True if the view in this page is visible, false otherwise.
    • IsZoomEnabled As Boolean
      Gets zoom from the page.
    • LoadBitmap (Dir As String, FileName As String) As Bitmap
      Loads and decodes image synchronously.
      FileName: Image
      Example:
      <code>
      File.FromAssets,"image.png"
      or
      "assets://","image.png"
      File.FromSdCard,"image.png"
      or
      "file:///mnt/sdcard/","image.png"
      File.FromExtSdCard,"image.png"
      or
      "file:///mnt/extSdCard/","image.png"

      File.FromHttp,"image.png",width,height
      or
      "http://","site.com/image.png",width,height
      File.FromHttps,"image.png",width,height
      or
      "https://","site.com/image.png",width,heigh
      </code>
      Result image Bitmap. Can be <b>null</b> if image loading/decoding was failed or cancelled.
    • LoadBitmap2 (Dir As String, FileName As String, width As Int, height As Int) As Bitmap
      Loads and decodes image synchronously
      FileName: Image
      width: ImageSize
      height: ImageSize
      Example:
      <code>
      File.FromAssets,"image.png",width,height
      or
      "assets://","image.png",width,height
      File.FromSdCard,"image.png",width,height
      or
      "file:///mnt/sdcard/","image.png",width,height
      File.FromExtSdCard,"image.png",width,height
      or
      "file:///mnt/extSdCard/","image.png",width,height
      File.FromHttp,"image.png",width,height
      or
      "http://","site.com/image.png",width,height
      File.FromHttps,"image.png",width,height
      or
      "https://","site.com/image.png",width,heigh
      </code>
      targetImageSize: Minimal size for bitmap which will be returned. Downloaded image will be decoded
      and scaled to bitmap of the size which is <b>equal or larger</b> (usually a bit
      larger) than incoming targetImageSize.
      Result image Bitmap. Can be <b>null</b> if image loading/decoding was failed or cancelled.
    • LoadLayout (FileName As String)
      Loads a layout file(.bal) to PhotoPager as a view.
      LayoutFile: Load a LayoutFile created with designer
    • LoadLayout2 (index As Int, FileName As String)
      Loads a layout file(.bal) to PhotoPager to the specified index.
      index: Page index
      FileName: Load a LayoutFile created with designer
    • PauseEngine
      Pause ImageLoader. All new load and display tasks won't be executed until ImageLoader is resumed.
      Already running tasks are not paused.
    • RemoveAllViews
      Removes all child views.
    • RemoveViewAt (index As Int)
      Removes the view that is stored in specified index.
      index: Page index
    • ResumeEngine
      Resumes waiting load and display tasks.
    • SetArrayList (array As ArrayList)
      Set an array passed from, gallery, grid view, cover flow.
    • SetPageBackgroundColor (index As Int, color As Int)
      Sets Background Color to the page.
      index: Page index
      color: Page color
    • SetPageBackgroundImage (index As Int, bitmap As Bitmap)
      Sets Background bitmap to the page.
      index: Page index
      bitmap: Page bitmap
    • SetPageEnabled (index As Int, enabled As Boolean)
      Set the enabled state of this view. The interpretation of the enabled
      state varies by subclass.
      index: Page index
      enabled: True if this view is enabled, false otherwise.
    • SetPageTag (index As Int, tag As Object)
      Get or Sets the tag associated with this views. A tag can be used to mark
      a view in its hierarchy and does not have to be unique within the
      hierarchy. Tags can also be used to store data within a view without
      resorting to another data structure.
      index: the index of the page
      tag: set the Object stored in this view as a tag
    • SetPageVisible (index As Int, visible As Boolean)
      Set the enabled state of this view.
      index: Page index
      visibility: True if this view is enabled, false otherwise.
    • SetPanelBackgroundColor (index As Int, color As Int)
      Sets Background Color to the panel.
      index: Panel index
      color: Panel color
    • SetPanelBackgroundImage (index As Int, bitmap As Bitmap)
      Sets Background bitmap to the panel.
      index: Panel index
      bitmap: Panel bitmap
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • ShowFromAssets (path As String, sort As Boolean)
      show images from assets or sub-folder not from sdcard.
    • ShowFromBucket (path As String, sort As Boolean)
      Show from media bucket
      path:
      sort:
    • ShowFromMediaStore (sort As Boolean)
      show images from media store.
    • ShowFromSdCard (dir As String, path As String, sort As Boolean)
      show images from sdcard not from assets.
    • ShowFromWeb (webStrings() As String, sort As Boolean)
      show images from web.
    • StopEngine
      Cancels all running and scheduled display image tasks.
      <b>NOTE:</b> This method doesn't shutdown if you set them.
      ImageLoader still can be used after calling this method.
    • SwapView (i As Int, j As Int)
      Swaps the elements at the specified positions in the specified list.
      (If the specified positions are equal, invoking this method leaves
      the list unchanged.)
      i: the index of one element to be swapped.
      j: the index of the other element to be swapped.
    Permissions:
    • android.permission.INTERNET
    • android.permission.MEDIA_CONTENT_CONTROL
    • android.permission.READ_EXTERNAL_STORAGE
    • android.permission.WRITE_EXTERNAL_STORAGE
    Properties:
    • AdjustViewBounds As Boolean
      Get or Sets this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.
    • BackGroundColor As Object [write only]
      Get or Sets the background color for this view.
      Example:
      BackGroundColor = Color.Aqua
      BackGroundColor = "#88666666"
      or
      BackGroundColor = Colors.ARGB(100,20,20,20) or Colors.RGB(20,20,20)
    • Background As Drawable
    • BackgroundColorRandomly As Boolean [write only]
      Set the Background Color Randomly.
    • CacheInMemory As Boolean [write only]
      Sets whether loaded image will be cached in memory - by default false.
    • CacheOnDisk As Boolean [write only]
      Sets whether loaded image will be cached on disk - by default false.
    • Color As Colors
      Returns one of the Color value in the list
    • CompressFormat As PhotoPagerBitmaCompression
      Get or Sets the known formats a bitmap can be compressed into [ JPG or PNG ]
    • CompressQuality As Int
      Get or Sets the quality of a bitmap, that can be compressed. [ 0 = low -> 100 = high ]
    • CurrentItem As Void
      Get or Sets the currently selected page.
    • DoubleTapEnabled As Boolean [write only]
      Sets double tap to the page.
    • FadeEnabled As Boolean [write only]
      Sets fade to the page.
    • FadeInTime As Int [write only]
      Duration of "fade-in" animation (in milliseconds)
      Whether animation should be played if image is loaded from network
      Whether animation should be played if image is loaded from disk cache
      Whether animation should be played if image is loaded from memory cache.
    • File As Files [read only]
      Return File:
      File.FromAssets
      File.FromSdCard
      File.FromExtSdCard
      File.FromHttp
      File.FromHttps
    • Length As Int [read only]
      Returns length.
    • LockEnabled As Boolean [write only]
      Sets lock to the page.
    • MaximumScale As Float [write only]
      Sets the maximum scale
    • MediumScale As Float [write only]
      Sets the medium scale
    • MinimumScale As Float [write only]
      Sets the minimum scale
    • OutlineColor As Int [write only]
      Sets outline color to photo pager.
    • OutlineEnabled As Boolean [write only]
      Enable or disable outline to photo pager.
    • Parent As Object [read only]
    • ProgressBarVisible As Boolean [write only]
      Set the enabled state of this view. - by default is true.
    • ScaleType As PhotoPagerScaleType
      Controls how the image should be resized or moved to match the size of this ImageView.
      by default is Fit_Center.
    • SetImageForEmptyUri As String [write only]
      Sets own icon on loading.
    • SetImageOnFail As String [write only]
      Sets own icon on fail.
    • ShowMessageError As Boolean [write only]
      Set to true if you want to display an error message.
    • Tag As Object
      Get or Sets the tag associated with PhotoPager. A tag can be used to mark
      a view in its hierarchy and does not have to be unique within the
      hierarchy. Tags can also be used to store data within a view without
      resorting to another data structure.
    • Top As Int
    • Transition As PagerTransitionEffects
      Get or Sets transition effect
    • Version As String [read only]
      Return Author and Version of the library
    • ZoomEnabled As Boolean [write only]
      Sets zoom to the page.


 

Attachments

  • B4APhotoPager_lib_v2.20.zip
    388.7 KB · Views: 774
  • B4APhotoPager_v3.80.zip
    396 KB · Views: 521
  • B4APhotoPager_v3.85.zip
    399 KB · Views: 726
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi All, B4APhotoPager is Update to v2.0.

B4APhotoPager_Demo v2.0.zip
B4APhotoPager_Library v2.0.zip


Wath's new:

Updated the engine

Changed:

Initialize("",true) instead of Initialize("")

PauseEngine instead of Pause



Added:


SetPageTag - Sets the tag to the page at the specified index

GetPageTag - Returns the tag of the page at the specified index


************************************

File - Returns associated files below:

File.FromAssets
File.FromSdCard
File.FromExtSdCard
File.FromHttp
File.FromHttps

************************************

Color - Returns more than 400 various colors associated with:

************************************

LoadBitmap - Loads and decodes image synchronously

LoadBitmap2 - Loads and decodes image synchronously

SetPageBackgroundImage - Sets a bitmap to the page

SetPanelBackgroundImage - Sets a bitmap to the panel

SetPageBackgroundColor - Sets a color to the page

SetPanelBackgroundColor - Sets a color to the panel

SetPageVisible - Sets the visible state of the page

IsPageVisible - Returns the visible state of the page

SetPageEnabled - Sets the enabled state of the page

IsPageEnabled - Returns the enabled state of the page

SwapView - Swaps two pages

AddView - Adds view

AddView2 - Adds view with specified size

AddViewAt - Adds view to the specified index

AddViewAt2 - Adds any view

RemoveViewAt - Remove view to the specified index

RemoveAllViews - Remove All view

LoadLayout - Load a layout created with designer

LoadLayout2 - Load a layout created with designer to the specified index

Any comment or bug please report it.
 
Last edited:

itgirl

Active Member
Licensed User
Longtime User
hello and thanks for the great update , i was wondering if you worked about the bug ive posted HERE and applied the fix mentioned HERE
 

itgirl

Active Member
Licensed User
Longtime User
Hi itgirl, still get error? and for the onInterceptTouchEvent I'm sorry I forgot to implement it.
Hey, yes i still get the error it's a bug in the original code and they didnt find a solution for it yet :/ only a work around so you dont get force close
 

itgirl

Active Member
Licensed User
Longtime User
i got Samsung galaxy s4 which is running android 5.1.1 i get the error whenever i pinch and zoom without release 4-5 times repeatedly ....
This does not happen always but it happens everytime after having added android.support.v4.widget.DrawerLayout which is used by MSMaterialDrawer
 

lonleystar

Well-Known Member
Licensed User
Longtime User
i got Samsung galaxy s4 which is running android 5.1.1 i get the error whenever i pinch and zoom without release 4-5 times repeatedly ....
This does not happen always but it happens everytime after having added android.support.v4.widget.DrawerLayout which is used by MSMaterialDrawer
Hi, It's compiled with android 5.0.1 please can U send to my email [ salvigiuseppe@libero.it ] Your email so I compile it with android 6.0 and send to U via email and test it and after tell in the forum if U get still the error if not I'll put it as update .
 

itgirl

Active Member
Licensed User
Longtime User
Hi, It's compiled with android 5.0.1 please can U send to my email [ salvigiuseppe@libero.it ] Your email so I compile it with android 6.0 and send to U via email and test it and after tell in the forum if U get still the error if not I'll put it as update .
Yes :) the problem is solved with the new version thank you so much for this great lib along with the great support ;) works like a charm now
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Yes :) the problem is solved with the new version thank you so much for this great lib along with the great support ;) works like a charm now

Hi itgirl, I'm happy it work fine but can U tell me which one U got working the first I sent or the second please let me know so I put it as update here.

Thank you for reminding me the problem.
 

itgirl

Active Member
Licensed User
Longtime User
Hi itgirl, I'm happy it work fine but can U tell me which one U got working the first I sent or the second please let me know so I put it as update here.

Thank you for reminding me the problem.
the second one you sent worked i didnt try the first one , was happy coz it worked lol
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi All, B4APhotoPager is Update to v2.20.

Wath's new:

fix:


the problem as reported by itgirl into the post #127

MinimumScale - work fine
MediumScale - work fine
MaximumScale - work fine

******************************************************

working with views and layout created with designer:

OutlineEnabled
OutlineColor

FadeEnabled
IsFadeEnabled

LockEnabled
IsLockEnabled

******************************************************

Added 2 new events:

MatrixChanged
ScaleChanged


B4X:
Sub vp_ScaleChanged(ScaleFactor As Int,FocusX As Int, FocusY As Int)

   Label1.Text = ScaleFactor&" , "&FocusX&" , "&FocusY

End Sub

Sub vp_MatrixChanged(Left As Int, Top As Int, Right As Int, Bottom As Int, Width As Int, Height As Int, CenterX As Int, CenterY As Int)

   Label1.Text = Left&" , "&Top&" , "&Right&" , "&Bottom&" , "&Width&" , "&Height&" , "&CenterX&" , "&CenterY

End Sub

Changed:

LockEnabled instead ToggleLock
IsLockEnabled instead ToggleLock

B4X:
Sub DisableLock_Click

   If (vp.IsLockEnabled) Then

     vp.LockEnabled = False
  
   End If

End Sub

Sub EnableLoock_Click

   vp.LockEnabled = True

End Sub


ZoomEnabled instead ToggleZoom
IsZoomEnabled instead ToggleZoom

B4X:
Sub DisableZoom_Click

   If (vp.IsZoomEnabled) Then

     vp.ZoomEnabled = False
  
   End If

End Sub

Sub EnableZoom_Click

   vp.ZoomEnabled = True

End Sub


DoubleTapEnabled instead ToggleDoubleTap
IsDoubleTapEnabled instead ToggleDoubleTap

B4X:
Sub DisableDoubleTap_Click

   If (vp.IsDoubleTapEnabled) Then

     vp.DoubleTapEnabled = False
  
   End If

End Sub

Sub EnableDoubleTap_Click

   vp.DoubleTapEnabled = True

End Sub


FadeEnabled instead ToggleFade
IsFadeEnabled instead ToggleFade

B4X:
Sub DisableFade_Click

   If (vp.IsFadeEnabled) Then

     vp.FadeEnabled = False
  
   End If

End Sub

Sub EnableFade_Click

   vp.FadeEnabled = True

End Sub



************************** I wish you all a happy New Year. **************************
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Small bug: CurrentItem is shown as readable/writable in the IDE interface help. However, when reading the currentItem, I get:
B4X:
Error description: Property: CurrentItem is writeonly.
 

wimpie3

Well-Known Member
Licensed User
Longtime User
More bugs.

1. When the file cannot be found, the image set in SetImageOnFail is shown. However, this image is zoomable, which does not seem normal to me as it's function is to simply indicate an error.

2. The image set by SetImageForEmptyUri is not shown when ProgressBarVisible=True. This might be the correct behavior, however, this is missing in the docs.

3. When I do this:
B4X:
vp.AddImage(vp.File.FromAssets,"play.png")
, the image in SetImageForEmptyUri is shown, and not the play.png from my Files directory.
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello
i test this library, and is very nice
but have a some problems...

-when compile from debug, at the moment INITIALIZE >>>> java.lang.StackOverflowError
-if put release work fine (without more libraries... only one proyect very light, if i put on a proyect with more librarys and more code dont work)

some one know to fix that ???
thank a lot



B4X:
LogCat connected to: emulator-5554
--------- beginning of /dev/log/system--------- beginning of /dev/log/main
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
java.lang.StackOverflowError
    at java.lang.Throwable.<init>(Throwable.java:67)
    at java.lang.Exception.<init>(Exception.java:47)
    at java.io.IOException.<init>(IOException.java:44)
    at java.io.FileNotFoundException.<init>(FileNotFoundException.java:42)
    at android.content.res.AssetManager.openAsset(Native Method)
    at android.content.res.AssetManager.open(AssetManager.java:316)
    at android.content.res.AssetManager.open(AssetManager.java:290)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1599)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitma
Message longer than Log limit (4000). Message was truncated.
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
java.lang.StackOverflowError
    at java.lang.Throwable.<init>(Throwable.java:67)
    at java.lang.Exception.<init>(Exception.java:47)
    at java.io.IOException.<init>(IOException.java:44)
    at java.io.FileNotFoundException.<init>(FileNotFoundException.java:42)
    at android.content.res.AssetManager.openAsset(Native Method)
    at android.content.res.AssetManager.open(AssetManager.java:316)
    at android.content.res.AssetManager.open(AssetManager.java:290)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1599)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitma
Message longer than Log limit (4000). Message was truncated.
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
java.lang.StackOverflowError
    at java.lang.Throwable.<init>(Throwable.java:67)
    at java.lang.Exception.<init>(Exception.java:47)
    at java.io.IOException.<init>(IOException.java:44)
    at java.io.FileNotFoundException.<init>(FileNotFoundException.java:42)
    at android.content.res.AssetManager.openAsset(Native Method)
    at android.content.res.AssetManager.open(AssetManager.java:316)
    at android.content.res.AssetManager.open(AssetManager.java:290)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1599)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitmapFromAssets(PhotoPagerMain.java:1601)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.getBitma
Message longer than Log limit (4000). Message was truncated.
** Activity (main) Resume **
 

cambopad

Active Member
Licensed User
Longtime User
Amazing, thank you very much works perfect.
Can you please upload the working demo project here so that I can also download to test.

I tested the old demo with latest version of this lib, but always got forced close error as below:

B4X:
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:345)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
    at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:112)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.LoadLayout(PhotoPagerMain.java:635)
    at it.giuseppe.salvi.photoviewpager.main._activity_create(main.java:379)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
    at it.giuseppe.salvi.photoviewpager.main.afterFirstLayout(main.java:102)
    at it.giuseppe.salvi.photoviewpager.main.access$000(main.java:17)
    at it.giuseppe.salvi.photoviewpager.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5001)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: rocky_beach_500x400.jpg
    at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:92)
    at anywheresoftware.b4a.objects.ImageViewWrapper.build(ImageViewWrapper.java:113)
    ... 24 more
Caused by: java.io.FileNotFoundException: rocky_beach_500x400.jpg
    at android.content.res.AssetManager.openAsset(Native Method)
    at android.content.res.AssetManager.open(AssetManager.java:316)
    at android.content.res.AssetManager.open(AssetManager.java:290)
    at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:202)
    at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:498)
    at anywheresoftware.b4a.objects.drawable.BitmapDrawable.build(BitmapDrawable.java:69)
    at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:90)
    ... 25 more
main_activity_create (java line: 379)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
    at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:112)
    at it.giuseppe.salvi.library.vp.core.PhotoPagerMain.LoadLayout(PhotoPagerMain.java:635)
    at it.giuseppe.salvi.photoviewpager.main._activity_create(main.java:379)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
    at it.giuseppe.salvi.photoviewpager.main.afterFirstLayout(main.java:102)
    at it.giuseppe.salvi.photoviewpager.main.access$000(main.java:17)
    at it.giuseppe.salvi.photoviewpager.main$WaitForLayout.run(main.java:80)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5001)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
    at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:71)
    at anywheresoftware.b4a.objects.ImageViewWrapper.innerInitialize(ImageViewWrapper.java:35)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:406)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:425)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:144)
    ... 18 more
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi guys, B4APhotoPager has been updated to version 3.80 what's new:

Can work as standalone or with mediabucket, gridview, gallery, photoflow

Changed: Transition instead of Effect

Added:

New effects total 25 effects instead of 12

ShowFromBucket
BackGroundColor

Removed all unnecessary code

Fix:
zoom is reset when the page is changing and others improvements.

qualsiasi commento sara apprezzato.

Best Regards
 

MarcoRome

Expert
Licensed User
Longtime User
Great work Giuseppe
Tried and all work ;)
( Davvero bel lavoro, complimenti Pe ;) )
 
Top