Android Question Prefdialog MultiOptions item Height

mike1967

Active Member
Licensed User
Longtime User
Hello, i have this forms as in attachments. How i Can increase item height in order to show correctly all the text on a options value ? Thnks in advance
 

Attachments

  • 1.png
    1.png
    63.9 KB · Views: 180
  • 2.png
    2.png
    63.2 KB · Views: 183
  • 3.png
    3.png
    67.6 KB · Views: 179

Mahares

Expert
Licensed User
Longtime User
How i Can increase item height in order to show correctly all the text on a options value
Use this to expand it. You can also use the full root or activity width and height:
B4X:
prefdialog.SearchTemplate.Resize(500dip,600dip)
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Private Sub ChangeValueWidth (Key As String)
    Dim i As Int = p.PrefItems.IndexOf(p.GetPrefItem(Key))
    Dim pnl As B4XView = p.CustomListView1.GetPanel(i)
    Dim lbl As B4XView = pnl.GetView(1)
    lbl.SetLayoutAnimated(0, 40dip, lbl.Top, pnl.Width - 40dip, lbl.Height)
End Sub

Usage:
B4X:
Dim sf As Object = p.ShowDialog(d, "OK", "CANCEL")
ChangeValueWidth("opt5") 'change to your key
Wait For (sf) Complete (Result As Int)

Note that it will not work with all types of items, only those made of two labels.
 
Upvote 0

mike1967

Active Member
Licensed User
Longtime User
B4X:
Private Sub ChangeValueWidth (Key As String)
    Dim i As Int = p.PrefItems.IndexOf(p.GetPrefItem(Key))
    Dim pnl As B4XView = p.CustomListView1.GetPanel(i)
    Dim lbl As B4XView = pnl.GetView(1)
    lbl.SetLayoutAnimated(0, 40dip, lbl.Top, pnl.Width - 40dip, lbl.Height)
End Sub

Usage:
B4X:
Dim sf As Object = p.ShowDialog(d, "OK", "CANCEL")
ChangeValueWidth("opt5") 'change to your key
Wait For (sf) Complete (Result As Int)

Note that it will not work with all types of items, only those made of two labels.
Thanks I use your code and the results is like figure attached. How i can format the text in order to render visible ? Thanks in advances
 

Attachments

  • screenshot-2021-04-20_09.07.54.087.png
    screenshot-2021-04-20_09.07.54.087.png
    68.7 KB · Views: 141
Upvote 0
Top