From a26764355ec7701d192a3e56ef722a470098cfc7 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 10 Oct 2024 17:30:06 +0200 Subject: [PATCH] move 'add profile' to end of list having 'add profile' at the end of the list is more natural, and more consisten with desktop/iOS - as well as internally, eg. proxy also has 'add' at its end. also, this paves the way to have a consistent layout when it comes to profile-switching from forward/share dialogs, where one probably does not want to have a 'add' button (so, the first lines are not different :) the profile list is usually not super-large, and even if - when ppl have managed to add 10+ profiles, they'll know how to do this, even with scrolling :) also, adding is a rare function, in contrast to switching, so even then it makes sense as there is room for one more item without scrolling. in contrast, for 'create chat' we show 'add' at the beginning, as these lists can contain several hundrets of entries _and_ add is often used. --- .../securesms/accounts/AccountSelectionListFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/thoughtcrime/securesms/accounts/AccountSelectionListFragment.java b/src/main/java/org/thoughtcrime/securesms/accounts/AccountSelectionListFragment.java index 8232bc9e5..ce003fbe9 100644 --- a/src/main/java/org/thoughtcrime/securesms/accounts/AccountSelectionListFragment.java +++ b/src/main/java/org/thoughtcrime/securesms/accounts/AccountSelectionListFragment.java @@ -52,11 +52,11 @@ public class AccountSelectionListFragment extends DialogFragment int[] accountIds = accounts.getAll(); int[] ids = new int[accountIds.length + 1]; - ids[0] = DC_CONTACT_ID_ADD_ACCOUNT; int j = 0; for (int accountId : accountIds) { - ids[++j] = accountId; + ids[j++] = accountId; } + ids[j] = DC_CONTACT_ID_ADD_ACCOUNT; adapter.changeData(ids, accounts.getSelectedAccount().getAccountId()); }