~singpolyma/cheogram-android

dff082ce3e2bbcd52838bf7656d3591fb4cd4f79 — Stephen Paul Weber 10 months ago bf77cc5
Hide cancel button when onboarding

Sort so that cancel comes before prev comes before everything else
1 files changed, 9 insertions(+), 1 deletions(-)

M src/main/java/eu/siacs/conversations/entities/Conversation.java
M src/main/java/eu/siacs/conversations/entities/Conversation.java => src/main/java/eu/siacs/conversations/entities/Conversation.java +9 -1
@@ 2552,7 2552,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
                    if (!actionsAdapter.isEmpty() || fillableFieldCount > 0) {
                        if (command.getAttribute("status").equals("completed") || command.getAttribute("status").equals("canceled")) {
                            actionsAdapter.add(Pair.create("close", "close"));
                        } else if (actionsAdapter.getPosition("cancel") < 0) {
                        } else if (actionsAdapter.getPosition("cancel") < 0 && !xmppConnectionService.isOnboarding()) {
                            actionsAdapter.insert(Pair.create("cancel", "cancel"), 0);
                        }
                    }


@@ 2562,6 2562,14 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
                    actionsAdapter.add(Pair.create("close", "close"));
                }

                actionsAdapter.sort((x, y) -> {
                    if (x.first.equals("cancel")) return -1;
                    if (y.first.equals("cancel")) return 1;
                    if (x.first.equals("prev") && xmppConnectionService.isOnboarding()) return -1;
                    if (y.first.equals("prev") && xmppConnectionService.isOnboarding()) return 1;
                    return 0;
                });

                Data dataForm = null;
                if (responseElement != null && responseElement.getName().equals("x") && responseElement.getNamespace().equals("jabber:x:data")) dataForm = Data.parse(responseElement);
                if (mNode.equals("jabber:iq:register") &&