B4A Library [Moved] xImageSliderIG

Brandsum

Well-Known Member
Licensed User
there is no error.
Sorry! Unfortunately, I don't have Samsung Note 8. I have tested on,
  1. Oneplus 6, 6t, 7
  2. Redmi 3s, 4, Y3, K20, 7A
  3. Honor P20 lite
  4. Iphone 6s, 7, XR
The attached example works fine in all the devices.
 

Angel Garcia

Member
Licensed User
Is there a way to add images from an URL? on the SetImages method?, or catch the swipe event and perform download image and later show it on the slider?
All this in order to avoid the slow performance on first download the list of images and then bind it to the slider, or there is another workaround?
Many thanks in advance!
 

Brandsum

Well-Known Member
Licensed User
Is there a way to add images from an URL? on the SetImages method?, or catch the swipe event and perform download image and later show it on the slider?
All this in order to avoid the slow performance on first download the list of images and then bind it to the slider, or there is another workaround?
Many thanks in advance!
I will try to add support for lazy loading.
 

Angel Garcia

Member
Licensed User
Thank you,
I think with a simple swipe event could be enough to perform the loading of the images from an URL.
You can first load some void or null images and then after the first swipe perform the downloading and then get back to the slider to bind the image.
 

Brandsum

Well-Known Member
Licensed User
Thank you,
I think with a simple swipe event could be enough to perform the loading of the images from an URL.
You can first load some void or null images and then after the first swipe perform the downloading and then get back to the slider to bind the image.

Extract the bas file inside the b4xlib file using any zip extrator. It is a simple class (bas file). You can modify as you want for your project.
 

Angel Garcia

Member
Licensed User
Thanks, i would try to adapt to my needs.
Currently i tried with a single image slider on an activty in my project and i get this error when trying to pinch and zoom:
When i disable the SetZoom method works fine, but of course without the pinch and zoom feature.
I'm using Samsung galaxy S8+, B4A 9.3
Its weird because your example it's installed also on my phone and works fine.
Is there a special requirement for the slider?,the size or something?
Please let me know.

Error occurred on line: 158 (xImageSliderIG)
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])' on a null object reference
at anywheresoftware.b4a.shell.Shell.runGoodChain(Shell.java:479)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:293)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at flm.b4a.gesturedetector.GestureDetectorForB4A.access$9(GestureDetectorForB4A.java:1158)
at flm.b4a.gesturedetector.GestureDetectorForB4A$1.onTouch(GestureDetectorForB4A.java:129)
at android.view.View.dispatchTouchEvent(View.java:13480)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3216)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2888)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
 

KZero

Active Member
Licensed User
Longtime User
Thanks for sharing this gr8 library :D
ShowNext always going to the last image not the next one
 

Alexander Stolte

Expert
Licensed User
Longtime User
On Android 28 i had this Error:
B4X:
Error occurred on line: 388 (xImageSliderIG)
java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
The Error causes on the "SetHidden" Sub and i fix it with:
dotCir.SetLayoutAnimated(dotTransitionDuration,dotSize/2,dotSize/2,1dip,1dip)
i set the 2 0 values to 1dip.
 

Brandsum

Well-Known Member
Licensed User
On Android 28 i had this Error:
B4X:
Error occurred on line: 388 (xImageSliderIG)
java.lang.IllegalArgumentException: Cannot set 'scaleX' to Float.NaN
The Error causes on the "SetHidden" Sub and i fix it with:
dotCir.SetLayoutAnimated(dotTransitionDuration,dotSize/2,dotSize/2,1dip,1dip)
i set the 2 0 values to 1dip.
ok I will check that.

Is there a way to clear the image collection to set a new List of images or URL's?
thanks :)
No, currently not. I will add that option tomorrow.
 
Top