Android Question [Solved] How to remove the cross and check (Cancel and confirm) symbol in preference dialog ?

AnandGupta

Expert
Licensed User
Longtime User
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
Since the solution was prior to "BeforeDialogDisplayed" event, I made the code as below to get the same result,

B4X:
Private Sub PrefDialog_BeforeDialogDisplayed (Template As Object)
    For i = 0 To prefDialog.PrefItems.Size - 1
        Dim pi As B4XPrefItem = prefDialog.PrefItems.Get(i)
        prefDialog.CustomListView1.AnimationDuration = 0
        If pi.ItemType = prefDialog.TYPE_TEXT Then
            Dim pnl As B4XView = prefDialog.CustomListView1.GetPanel(i)
            Dim ft As B4XFloatTextField = pnl.GetView(0).Tag
            ft.lblClear.Left = -100dip
            ft.lblV.Left = -100dip
        else If pi.ItemType = prefDialog.TYPE_MULTILINETEXT Then
            Dim pnl As B4XView = prefDialog.CustomListView1.GetPanel(i)
            Dim ft As B4XFloatTextField = pnl.GetView(0).Tag
            ft.lblClear.Left = -100dip
            ft.lblV.Left = -100dip
        End If
    Next

End Sub
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I made the code as below to get the same result,
Why didn'y lump both text types in one inside the sub like this:
B4X:
If pi.ItemType = prefDialog.TYPE_TEXT or pi.ItemType = prefDialog.TYPE_MULTILINETEXT Then
           Dim pnl As B4XView = prefDialog.CustomListView1.GetPanel(i)
            Dim ft As B4XFloatTextField = pnl.GetView(0).Tag
            ft.lblClear.Left = -100dip
            ft.lblV.Left = -100dip
end if
 
Upvote 0

AnandGupta

Expert
Licensed User
Longtime User
Well I had doubt that -100dip may not be correct for B4J module where multiline text is a big one. So I left it as a separate case to be corrected if required, if someone uses the code.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…