Android Question Uninvert Yes and No in the questioning

sight

Member
Licensed User
Longtime User
How do I uninvert the questioning in messages when asking yes or no in a message. In the low API it was ... Yes and No and now in the high API it was No and Yes. How to go back to the first model. Or is there really no way?

Thanks
 

emexes

Expert
Licensed User
How do I uninvert the questioning in messages when asking yes or no in a message
Not quite sure which API you're working with, but maybe this will do the job:
B4X:
Dim Answer As Boolean = True

If Answer Then
    Log(Answer & " is Yes")
Else
    Log(Answer & " is No")
End If

Answer = Not(Answer)    'or Answer = (Answer = False)

If Answer Then
    Log(Answer & " is now Yes")
Else
    Log(Answer & " is now No")
End If
 
Upvote 0

emexes

Expert
Licensed User
maybe this will do the job
or maybe it will just add to the confusion ?
in which case: post the code that needs to be inverted
and someone will happily show where the Not() should be added ?
(or perhaps some other way to invert the answer to match the question)

 
Last edited:
Upvote 0

asales

Expert
Licensed User
Longtime User
In the low API it was ... Yes and No and now in the high API it was No and Yes. How to go back to the first model. Or is there really no way?
This is the behavior when you use the native dialog.
The buttons change the position in different versions of the Android.

You can use this custom dialog:
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
 
Upvote 0

Lucas Siqueira

Active Member
Licensed User
Longtime User
How do I uninvert the questioning in messages when asking yes or no in a message. In the low API it was ... Yes and No and now in the high API it was No and Yes. How to go back to the first model. Or is there really no way?

Thanks

When using xui.Msgbox2Async you can pass the text of the positive, cancel and negative buttons, you can invert the texts and when the action comes, you treat it as negative.

B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private imgImagem As B4XImageView
    Private lblFrase As B4XView
    Private pnlFundo As B4XView
End Sub

Public Sub Initialize
End Sub

Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
End Sub

Private Sub Button1_Click
    Dim sf As Object = xui.Msgbox2Async("Test?", "Title", "Yes", "", "No", Null)
    Wait For (sf) Msgbox_Result (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Log("Deleted!!!")
    End If
End Sub

Private Sub Button2_Click
    Dim sf As Object = xui.Msgbox2Async("Test?", "Title", "No", "", "Yes", Null)
    Wait For (sf) Msgbox_Result (Result As Int)
    If Result = xui.DialogResponse_Negative Then
        Log("Deleted!!!")
    End If
End Sub

 

Attachments

  • Project.zip
    13.6 KB · Views: 90
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…