Android Tutorial Simple Photogallery using a Scollview

Discussion in 'Tutorials & Examples' started by ilan, Dec 29, 2018.

  1. ilan

    ilan Expert Licensed User

    hi,

    this is a simple example that shows how you can use a scrollview and create a photo gallery.

    (source code is included)

    have fun :)
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    In most cases there is no good reason to use ScrollView directly. Use xCustomListView instead. It will be simpler and it includes many features that you will need to implement anyway. In this case it would have been better to use lazy loading and only load the images when needed.
    xCustomListView is also cross platform.
    https://www.b4x.com/android/forum/threads/87930/#content
     
    MarcoRome likes this.
  3. KMatle

    KMatle Expert Licensed User

    Why? Is there any technical reason? Or is it just because of the existing and better views?
     
  4. ilan

    ilan Expert Licensed User

    maybe in most cases it is true anyway in my case its not. clv is creating 1 item per row but here you can see that i am creating more then one. But the lazyloading is a nice feature that could be implemented in my case too. anyway i noticed that showing a scrollviewwith 200-300 items does not have any effect on performance. at least not on my galaxy s8 so i guess in some case you can use your own implementation and in maybe most clv would be simpler (maybe)
     
    Filippo and KMatle like this.
  5. KMatle

    KMatle Expert Licensed User

    I mostly have apps showing some sort of a table, so I got used to use SV's ;-) Never had any issues. Aaaand... It's good to learn how to handle views.
     
    Filippo and ilan like this.
  6. Erel

    Erel Administrator Staff Member Licensed User

    xCustomListView is a ScrollView with additional features. Sooner or later you will need to implement some of the features yourself anyway.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Last edited: Jan 11, 2019
  8. Mahares

    Mahares Well Known Member Licensed User

    You are absolutely correct. It is difficult. I tried for several hours without success to have each 4 images in a single row and displaying all 200 images in succession. I managed something, but only if I display image files at random. It would be interesting to see how you manage to do it using your project with the link in post#7.
    I used your quote in post #7 verbatim, because I have a feeling you meant to say: 'It should NOT be difficult'.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    You are of course correct...

    Start a new thread for this and I'll post an example next week.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice