Android Question Particular Dialog

cirollo

Active Member
Licensed User
Longtime User
Hi! I need to create a particular dialog like the one on this image

tes1120250.jpg
http://www.bighouseshop.it/media/ca...9b4677d2e64ac78aa571b9bcfa/t/e/tes1120250.jpg

In the dialog I must show an image showing the product with some infos (price, dimensions, etc...) and UNDER THESE many small thumbnails that show the available colors of that product.

I don't know how many colors a product can have, it is variable.

I've would like to manage these colors with a grid, on each row should be present:

the color image, a brief description and a textbox to imput the order qty.

this is the perfect solution, if possible

ordinemodellovarianti256.png


search


So, is possible to do this with a library or not?

Please let me know. regards
cirollo
 

cirollo

Active Member
Licensed User
Longtime User
yes, Erel!
but I like the effect of a form opening over another form, leaving the underlaying window out of focus or less bright.

so, the question is:

can I put an image and horizontal scroll view on a dialog?

c
 
Upvote 0

cirollo

Active Member
Licensed User
Longtime User
Following your suggestion Erel, I made a custom dialog but I'm not able to show the listview added on it (LstDisegni)

this is the code

B4X:
Sub LstArticoli_ItemLongClick (Position As Int, Value As Object)
   Dim Codart As String = Value
   
   'apriamo il custom dialog
   Dim sf As Object = DetailsDialog.ShowAsync(Codart, "Ok", "Cancel", "", LoadBitmap(File.DirAssets, "warning_small.png"), True)
   DetailsDialog.SetSize(80%x, 90%y)
   Wait For (sf) Dialog_Ready(pnl As Panel)
   pnl.LoadLayout("DettaglioArticolo")
   'recuperiamo le altre info dell'articolo
   Dim Descrizione, UnitaMisura,NomeFoto As String
   stringa_SQL="SELECT Articoli.CodiceArticolo as CodiceArticolo, Articoli.Descrizione as Descrizione, Articoli.UnitaMisura as UnitaMisura, Articoli.NomeFoto as NomeFoto"
   stringa_SQL=stringa_SQL&" from Articoli where CodiceArticolo='"&Codart&"'"
   Dim cur As Cursor
   cur = SQL1.ExecQuery(stringa_SQL)
   For i = 0 To cur.RowCount-1
     cur.Position = i
     Descrizione=cur.GetString("CodiceArticolo")
     UnitaMisura=cur.GetString("UnitaMisura")
     NomeFoto=cur.GetString("NomeFoto")
   Next
   If File.Exists(Main.sdRoot&"emmeci/gemitex/img/",NomeFoto&".jpg") = True Then
     DialogImgArt.Bitmap = LoadBitmap(Main.sdRoot&"emmeci/gemitex/img/",NomeFoto&".jpg")
   Else
     DialogImgArt.Bitmap = LoadBitmap(File.DirAssets, "warning_small.png")
   End If
   
   'recuperiamo i vari disegni dell'articolo
   LstDisegni.Initialize("LstDisegni")
   LstDisegni.TwoLinesAndBitmap.ItemHeight = 70dip
   LstDisegni.TwoLinesAndBitmap.Label.TextSize = 20
   LstDisegni.TwoLinesAndBitmap.Label.TextColor = Colors.Black
   LstDisegni.FastScrollEnabled = True
   LstDisegni.Color = Colors.White
   LstDisegni.ScrollingBackgroundColor = Colors.White
   Activity.AddView(LstDisegni, 400, 10, 80, 500)
   
   stringa_SQL="SELECT CodiceDisegno,Descrizione,NomeFoto from DisegniArticoli where CodiceArticolo='"&Codart&"'"
   Log(stringa_SQL)
   Dim cur As Cursor
   cur = SQL1.ExecQuery(stringa_SQL)
   For i = 0 To cur.RowCount-1
     cur.Position = i
     NomeFoto=cur.GetString("NomeFoto")
     Msgbox(NomeFoto,"")
     If File.Exists(Main.sdRoot&"emmeci/gemitex/img/",NomeFoto&".jpg") = True Then
       Msgbox(NomeFoto,"")
       LstDisegni.AddTwoLinesAndBitmap(cur.GetString("CodiceDisegno").Trim,cur.GetString("Descrizione").Trim,LoadBitmap(Main.sdRoot&"emmeci/gemitex/img/",NomeFoto&".jpg"))
     End If
   Next

I think the problem is here: Activity.AddView(LstDisegni, 400, 10, 80, 500)
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
I think the problem is here: Activity.AddView(LstDisegni, 400, 10, 80, 500)

I think you might have your x & y positions backwards & you should also be using dip. So your statement should be:
B4X:
Activity.AddView(LstDisegni, 10dip, 400dip, 500dip, 80dip) 'x, y, width, height

But you should also look at your 500dip width, because unless your layout is in landscape mode I think it will run off the right hand edge of the screen.

- Colin.
 
Upvote 0

cirollo

Active Member
Licensed User
Longtime User
thx Erel, but you say

"Make sure that the CLV is anchored to all sides"

on my custom dialog are present also other objects (one imageview and some labels too), not only the listview, that cannot be anchored to all sides:
 
Upvote 0
Top