Android Question How can i make a simple scrollable picture activity ?

GMan

Well-Known Member
Licensed User
Longtime User
Hoi Friends,

how (means with which lib or View) can I make a scrollable list of pictures ?
Zooming would be nice, but is no "must have"

Thx in advance
 

DonManfred

Expert
Licensed User
Longtime User
The simplest is a ListView
Customlistview more advanced possibilities
But you should use a Recycling view... You will fast run into Memory problems when using lot of images
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Hoi Manfred,
Thx for that - i read about the memory problem but there a only these some pictures, which i will scale down, too :)
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
I used a listview, but the pics are very small.
Is there a way to Zoom when touching OR displaying the Picx larger ?
Here it my code so far for 3 Pics:

B4X:
    ListViewFoto.AddTwoLinesAndBitmap("PFLASTERARBEITEN", "Beispiel 1", LoadBitmap(File.DirAssets,"1.jpg"))
     ListViewFoto.AddTwoLinesAndBitmap("PFLASTERARBEITEN", "Beispiel 2", LoadBitmap(File.DirAssets,"2.jpg"))
      ListViewFoto.AddTwoLinesAndBitmap("PFLASTERARBEITEN", "Beispiel 3", LoadBitmap(File.DirAssets,"3.jpg"))
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
You can define the dimensions for the entries, but the same for all entries
B4X:
ltvTest.TwoLinesAndBitmap.ItemHeight

ltvTest.TwoLinesAndBitmap.Label.Left
ltvTest.TwoLinesAndBitmap.Label.Top
ltvTest.TwoLinesAndBitmap.Label.Width
ltvTest.TwoLinesAndBitmap.Label.Height

ltvTest.TwoLinesAndBitmap.SecondLabel.Left
ltvTest.TwoLinesAndBitmap.SecondLabel.Top
ltvTest.TwoLinesAndBitmap.SecondLabel.Width
ltvTest.TwoLinesAndBitmap.SecondLabel.Height

ltvTest.TwoLinesAndBitmap.ImageView.Left
ltvTest.TwoLinesAndBitmap.ImageView.Top
ltvTest.TwoLinesAndBitmap.ImageView.Width
ltvTest.TwoLinesAndBitmap.ImageView.Height
You must define this before you add any entry.
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Thx a lot U2 - works like a charm ;-)
But looks like...not what i wanted.
The .Text1. appears in white (not good)
The .Text2. appears in black (good)

So, (nearly i'd wrote HTF ;-) ) how can i change the color to black, too ?
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Thx U2 ;-)
on some devices (depending on the RAm i think) the App hung when calling the picture gallery.
So i simply reduced the amount of pics and placed a link to the Web-picture gallery.
The external browsers can handle that better i think, too
 
Upvote 0
Top