Android Question [Solved] Questions about SearchTemplate (XUI Views)

asales

Expert
Licensed User
Longtime User
Is possible made the changes below by code?
1 - change the theme: dark to light
2 - change the width of the positive button in dialog to avoid breakline in the word "Confirm" ("Confirmar" in my language)
3 - using the check button in the edit search to accept and use the text of the edit and not the item of list.
4 - click in item move the text to edit seach (and using confirm button to accept)

searchtemplate2.jpg
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Light theme:
B4X:
Dim TextColor As Int = 0xFF5B5B5B
search.SearchField.TextField.TextColor = TextColor
search.SearchField.NonFocusedHintColor = TextColor
search.CustomListView1.sv.ScrollViewInnerPanel.Color = 0xFFDFDFDF
search.CustomListView1.sv.Color = Dialog.BackgroundColor
search.CustomListView1.DefaultTextBackgroundColor = xui.Color_White
search.CustomListView1.DefaultTextColor = TextColor
If search.SearchField.lblV.IsInitialized Then search.SearchField.lblV.TextColor = TextColor
If search.SearchField.lblClear.IsInitialized Then search.SearchField.lblClear.TextColor = TextColor
Dialog.BackgroundColor = xui.Color_White
Dialog.ButtonsColor = xui.Color_White
Dialog.BorderColor = xui.Color_Gray
Dialog.ButtonsTextColor = 0xFF007DC3

Button width:
B4X:
Dim rs As ResumableSub = Dialog.ShowTemplate(search, "CONFIRMAR", "", "CANCELAR")
Dim okbtn As B4XView = Dialog.GetButton(xui.DialogResponse_Positive)
okbtn.Width = 120dip
okbtn.Left = okbtn.Left - 50dip
Wait For (rs) Complete (Result As Int)

3 / 4 - Not possible without modifying the code. This is different than the designed behavior.
 
Last edited:
Upvote 0

asales

Expert
Licensed User
Longtime User
Thanks.

- The buttons cancel and confirm in the SearchField are missing (I think is because the white color).
How to change the colors of this buttons?

- How to change the HintText of the SearchField by code?
I tried this, but don't work:
B4X:
SearchTemplate.SearchField.HintText = "Selected the item"
searchtemplate3.jpg
 
Upvote 0
Top