From 72580dadd0e9c8b44b774b13b542ed9804a69f90 Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:24:24 +0200 Subject: [PATCH 1/6] feat: display blocks and mutes list (#821) * feat: add mutes fragment * feat: add blocks fragment * refactor: add query params * rename "mutes" and "blocks" --------- Co-authored-by: sk --- .../requests/accounts/GetAccountBlocks.java | 16 +++++++++ .../requests/accounts/GetAccountMutes.java | 16 +++++++++ .../android/fragments/ProfileFragment.java | 13 ++++++- .../BlockedAccountsListFragment.java | 36 +++++++++++++++++++ .../MutedAccountsListFragment.java | 36 +++++++++++++++++++ mastodon/src/main/res/menu/profile_own.xml | 2 ++ mastodon/src/main/res/values/strings_sk.xml | 2 ++ 7 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountBlocks.java create mode 100644 mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountMutes.java create mode 100644 mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BlockedAccountsListFragment.java create mode 100644 mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/MutedAccountsListFragment.java diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountBlocks.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountBlocks.java new file mode 100644 index 0000000000..16d0403a4b --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountBlocks.java @@ -0,0 +1,16 @@ +package org.joinmastodon.android.api.requests.accounts; + +import com.google.gson.reflect.TypeToken; + +import org.joinmastodon.android.api.requests.HeaderPaginationRequest; +import org.joinmastodon.android.model.Account; + +public class GetAccountBlocks extends HeaderPaginationRequest{ + public GetAccountBlocks(String maxID, int limit){ + super(HttpMethod.GET, "/blocks", new TypeToken<>(){}); + if(maxID!=null) + addQueryParameter("max_id", maxID); + if(limit>0) + addQueryParameter("limit", limit+""); + } +} diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountMutes.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountMutes.java new file mode 100644 index 0000000000..966b36c51d --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/accounts/GetAccountMutes.java @@ -0,0 +1,16 @@ +package org.joinmastodon.android.api.requests.accounts; + +import com.google.gson.reflect.TypeToken; + +import org.joinmastodon.android.api.requests.HeaderPaginationRequest; +import org.joinmastodon.android.model.Account; + +public class GetAccountMutes extends HeaderPaginationRequest{ + public GetAccountMutes(String maxID, int limit){ + super(HttpMethod.GET, "/mutes/", new TypeToken<>(){}); + if(maxID!=null) + addQueryParameter("max_id", maxID); + if(limit>0) + addQueryParameter("limit", limit+""); + } +} diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index c726f408f2..cf26e29716 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -23,7 +23,6 @@ import android.os.Bundle; import android.text.SpannableStringBuilder; import android.text.TextUtils; -import android.text.style.ImageSpan; import android.transition.ChangeBounds; import android.transition.Fade; import android.transition.TransitionManager; @@ -60,8 +59,10 @@ import org.joinmastodon.android.api.requests.accounts.UpdateAccountCredentials; import org.joinmastodon.android.api.requests.instance.GetInstance; import org.joinmastodon.android.api.session.AccountSessionManager; +import org.joinmastodon.android.fragments.account_list.BlockedAccountsListFragment; import org.joinmastodon.android.fragments.account_list.FollowerListFragment; import org.joinmastodon.android.fragments.account_list.FollowingListFragment; +import org.joinmastodon.android.fragments.account_list.MutedAccountsListFragment; import org.joinmastodon.android.fragments.report.ReportReasonChoiceFragment; import org.joinmastodon.android.fragments.settings.SettingsServerFragment; import org.joinmastodon.android.model.Account; @@ -846,6 +847,16 @@ public void onError(ErrorResponse error){ args.putString("profileDisplayUsername", account.getDisplayUsername()); } Nav.go(getActivity(), ListsFragment.class, args); + }else if(id==R.id.muted_accounts){ + final Bundle args=new Bundle(); + args.putString("account", accountID); + args.putParcelable("targetAccount", Parcels.wrap(account)); + Nav.go(getActivity(), MutedAccountsListFragment.class, args); + }else if(id==R.id.blocked_accounts){ + final Bundle args=new Bundle(); + args.putString("account", accountID); + args.putParcelable("targetAccount", Parcels.wrap(account)); + Nav.go(getActivity(), BlockedAccountsListFragment.class, args); }else if(id==R.id.followed_hashtags){ Bundle args=new Bundle(); args.putString("account", accountID); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BlockedAccountsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BlockedAccountsListFragment.java new file mode 100644 index 0000000000..facb4c1d67 --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/BlockedAccountsListFragment.java @@ -0,0 +1,36 @@ +package org.joinmastodon.android.fragments.account_list; + +import android.net.Uri; +import android.os.Bundle; + +import org.joinmastodon.android.R; +import org.joinmastodon.android.api.requests.HeaderPaginationRequest; +import org.joinmastodon.android.api.requests.accounts.GetAccountBlocks; +import org.joinmastodon.android.model.Account; +import org.joinmastodon.android.ui.viewholders.AccountViewHolder; + +public class BlockedAccountsListFragment extends AccountRelatedAccountListFragment{ + + @Override + public void onCreate(Bundle savedInstanceState){ + super.onCreate(savedInstanceState); + setTitle(R.string.sk_blocked_accounts); + } + + @Override + public HeaderPaginationRequest onCreateRequest(String maxID, int count){ + return new GetAccountBlocks(maxID, count); + } + + @Override + protected void onConfigureViewHolder(AccountViewHolder holder){ + super.onConfigureViewHolder(holder); + holder.setStyle(AccountViewHolder.AccessoryType.NONE, false); + } + + @Override + public Uri getWebUri(Uri.Builder base) { + return super.getWebUri(base).buildUpon() + .appendPath("/blocks").build(); + } +} diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/MutedAccountsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/MutedAccountsListFragment.java new file mode 100644 index 0000000000..22dff9921c --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/account_list/MutedAccountsListFragment.java @@ -0,0 +1,36 @@ +package org.joinmastodon.android.fragments.account_list; + +import android.net.Uri; +import android.os.Bundle; + +import org.joinmastodon.android.R; +import org.joinmastodon.android.api.requests.HeaderPaginationRequest; +import org.joinmastodon.android.api.requests.accounts.GetAccountMutes; +import org.joinmastodon.android.model.Account; +import org.joinmastodon.android.ui.viewholders.AccountViewHolder; + +public class MutedAccountsListFragment extends AccountRelatedAccountListFragment{ + + @Override + public void onCreate(Bundle savedInstanceState){ + super.onCreate(savedInstanceState); + setTitle(R.string.sk_muted_accounts); + } + + @Override + public HeaderPaginationRequest onCreateRequest(String maxID, int count){ + return new GetAccountMutes(maxID, count); + } + + @Override + protected void onConfigureViewHolder(AccountViewHolder holder){ + super.onConfigureViewHolder(holder); + holder.setStyle(AccountViewHolder.AccessoryType.NONE, false); + } + + @Override + public Uri getWebUri(Uri.Builder base) { + return super.getWebUri(base).buildUpon() + .appendPath("/mutes").build(); + } +} diff --git a/mastodon/src/main/res/menu/profile_own.xml b/mastodon/src/main/res/menu/profile_own.xml index 61543c3e59..fbc4db924b 100644 --- a/mastodon/src/main/res/menu/profile_own.xml +++ b/mastodon/src/main/res/menu/profile_own.xml @@ -7,6 +7,8 @@ + + \ No newline at end of file diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index 17f7c76c89..911e9e0a07 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -392,4 +392,6 @@ %d minutes %d hours %d days + Muted accounts + Blocked accounts \ No newline at end of file From 1079f600bc513c950e94545a8f2e4ceedba89f81 Mon Sep 17 00:00:00 2001 From: Jacoco <63549689+Jacocococo@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:25:52 +0200 Subject: [PATCH 2/6] Revert "Fix media layout with unknown sizes" (#827) This reverts commit a014fe944397a3271852fe09af9a01858d43498e. --- .../java/org/joinmastodon/android/model/Attachment.java | 8 ++++---- .../android/ui/drawables/BlurhashCrossfadeDrawable.java | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java b/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java index b198eb446e..2e45cd1a12 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Attachment.java @@ -46,26 +46,26 @@ public Attachment(@ParcelProperty("blurhash") String blurhash){ public int getWidth(){ if(meta==null) - return 0; + return 1920; if(meta.width>0) return meta.width; if(meta.original!=null && meta.original.width>0) return meta.original.width; if(meta.small!=null && meta.small.width>0) return meta.small.width; - return 0; + return 1920; } public int getHeight(){ if(meta==null) - return 0; + return 1080; if(meta.height>0) return meta.height; if(meta.original!=null && meta.original.height>0) return meta.original.height; if(meta.small!=null && meta.small.height>0) return meta.small.height; - return 0; + return 1080; } public double getDuration(){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java b/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java index e0236a7a1e..c909fcb8d1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/drawables/BlurhashCrossfadeDrawable.java @@ -99,15 +99,11 @@ public int getOpacity(){ @Override public int getIntrinsicWidth(){ - if(width==0) - return imageDrawable==null ? 1920 : imageDrawable.getIntrinsicWidth(); return width; } @Override public int getIntrinsicHeight(){ - if(height==0) - return imageDrawable==null ? 1080 : imageDrawable.getIntrinsicHeight(); return height; } From 05f7a44bd539264f2bb8b2373a0366bf1f4ac099 Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:30:18 +0200 Subject: [PATCH 3/6] fix(timeline/gap): use plurals for time (#829) Co-authored-by: sk --- .../android/ui/utils/UiUtils.java | 17 ++++++++++++---- .../src/main/res/values-de-rDE/strings_sk.xml | 4 ---- .../src/main/res/values-pt-rBR/strings_sk.xml | 4 ---- mastodon/src/main/res/values/strings_sk.xml | 20 +++++++++++++++---- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index a5aeb881dc..eda1462205 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -218,11 +218,20 @@ public static String formatPeriodBetween(Context context, Instant since, Instant if(diff<1000L){ return context.getString(R.string.time_now); }else if(diff<60_000L){ - return context.getString(ago ? R.string.time_seconds_ago_short : R.string.sk_time_seconds, diff/1000L); + long time = diff/1000L; + return ago ? + context.getString(R.string.time_seconds_ago_short, time) : + context.getResources().getQuantityString(R.plurals.sk_time_seconds, (int) time, time); }else if(diff<3600_000L){ - return context.getString(ago ? R.string.time_minutes_ago_short : R.string.sk_time_minutes, diff/60_000L); + long time = diff/60_000L; + return ago ? + context.getString(R.string.time_minutes_ago_short, time) : + context.getResources().getQuantityString(R.plurals.sk_time_minutes, (int) time, time); }else if(diff<3600_000L*24L){ - return context.getString(ago ? R.string.time_hours_ago_short : R.string.sk_time_hours, diff/3600_000L); + long time = diff/3600_000L; + return ago ? + context.getString(R.string.time_hours_ago_short, time) : + context.getResources().getQuantityString(R.plurals.sk_time_hours, (int) time, time); } else { int days = (int) (diff / (3600_000L * 24L)); if (ago && days > 30) { @@ -233,7 +242,7 @@ public static String formatPeriodBetween(Context context, Instant since, Instant return DATE_FORMATTER_SHORT_WITH_YEAR.format(dt); } } - return context.getString(ago ? R.string.time_days_ago_short : R.string.sk_time_days, days); + return ago ? context.getString(R.string.time_days_ago_short, days) : context.getResources().getQuantityString(R.plurals.sk_time_days, days, days); } } diff --git a/mastodon/src/main/res/values-de-rDE/strings_sk.xml b/mastodon/src/main/res/values-de-rDE/strings_sk.xml index 8c7cb5da9e..ab1de29782 100644 --- a/mastodon/src/main/res/values-de-rDE/strings_sk.xml +++ b/mastodon/src/main/res/values-de-rDE/strings_sk.xml @@ -382,10 +382,6 @@ Beiträge Tab-Bezeichnungen in der Navigationsleiste anzeigen - %d Sekunden - %d Minuten - %d Stunden - %d Tage https://findahelpline.com Ältere Beiträge laden Neuere Beiträge laden diff --git a/mastodon/src/main/res/values-pt-rBR/strings_sk.xml b/mastodon/src/main/res/values-pt-rBR/strings_sk.xml index fc2cbaf1fd..244f05b823 100644 --- a/mastodon/src/main/res/values-pt-rBR/strings_sk.xml +++ b/mastodon/src/main/res/values-pt-rBR/strings_sk.xml @@ -370,9 +370,5 @@ Revelar automaticamente Avisos de Conteúdo nas respostas Lixeira de reciclagem Pesquisar - %d minutos - %d horas Suicídio - %d segundos - %d dias \ No newline at end of file diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index 911e9e0a07..01d926db1d 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -388,10 +388,22 @@ Post contains media Load newer posts Load older posts - %d seconds - %d minutes - %d hours - %d days + + %d second + %d seconds + + + %d minute + %d minutes + + + %d hour + %d hours + + + %d day + %d days + Muted accounts Blocked accounts \ No newline at end of file From 4de7211523259aa261051f4459c6bd314c8e2d87 Mon Sep 17 00:00:00 2001 From: LucasGGamerM <71328265+LucasGGamerM@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:30:53 -0300 Subject: [PATCH 4/6] Fix notifications replies visibility/language not being consistent with replied status (#831) * fix(notifications): make reply visibility consistent with status being replied to * fix(notifications): make reply language consistent with status being replied to --- .../org/joinmastodon/android/PushNotificationReceiver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index b76dbe9deb..2d988fe4a2 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -324,8 +324,8 @@ private void handleReplyAction(Context context, String accountID, Intent intent, CreateStatus.Request req=new CreateStatus.Request(); req.status = initialText + input.toString(); - req.language = preferences.postingDefaultLanguage; - req.visibility = preferences.postingDefaultVisibility; + req.language = notification.status.language; + req.visibility = notification.status.visibility; req.inReplyToId = notification.status.id; if (notification.status.hasSpoiler() && From 6d085ae6f04effbc931a296c1223a804c152f37c Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:03:17 +0200 Subject: [PATCH 5/6] fix: show multiline poll options (#837) * fix: show multiline poll options * fix resources not found exception * don't force height on poll options --------- Co-authored-by: sk --- .../android/PushNotificationReceiver.java | 2 +- .../ui/displayitems/PollOptionStatusDisplayItem.java | 2 +- .../main/res/drawable/bg_poll_option_clickable.xml | 4 ++-- .../res/drawable/bg_poll_option_clickable_inset.xml | 4 ++-- .../src/main/res/drawable/bg_poll_option_voted.xml | 4 ++-- .../main/res/drawable/bg_poll_option_voted_inset.xml | 6 +++--- .../src/main/res/layout/display_item_poll_option.xml | 11 ++++++----- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index 2d988fe4a2..86135f975e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -207,7 +207,7 @@ private void notify(Context context, PushNotification pn, String accountID, org. .setShowWhen(true) .setCategory(Notification.CATEGORY_SOCIAL) .setAutoCancel(true) - .setLights(context.getColor(android.R.attr.colorAccent), 500, 1000) + .setLights(UiUtils.getThemeColor(context, android.R.attr.colorAccent), 500, 1000) .setColor(UiUtils.getThemeColor(context, android.R.attr.colorAccent)); if (!GlobalUserPreferences.uniformNotificationIcon) { diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java index 330af7921c..ee3357e666 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java @@ -79,7 +79,7 @@ public Holder(Activity activity, ViewGroup parent){ progressBg=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted, activity.getTheme()).mutate(); progressBgInset=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted_inset, activity.getTheme()).mutate(); itemView.setOnClickListener(this::onButtonClick); - button.setOutlineProvider(OutlineProviders.M3_BUTTON); + button.setOutlineProvider(OutlineProviders.roundedRect(20)); button.setClipToOutline(true); } diff --git a/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml b/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml index bff5fa24e8..cc3187a957 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml @@ -1,12 +1,12 @@ - + - + diff --git a/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml b/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml index b175706097..29dd2b1fc1 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml @@ -1,13 +1,13 @@ - + - + diff --git a/mastodon/src/main/res/drawable/bg_poll_option_voted.xml b/mastodon/src/main/res/drawable/bg_poll_option_voted.xml index 63979af913..ba14e45d2b 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_voted.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_voted.xml @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + diff --git a/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml b/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml index f149fbdfbb..1bc8c099bb 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml @@ -1,12 +1,12 @@ - + - + @@ -14,7 +14,7 @@ - + diff --git a/mastodon/src/main/res/layout/display_item_poll_option.xml b/mastodon/src/main/res/layout/display_item_poll_option.xml index 298dea04cb..1c9289c60f 100644 --- a/mastodon/src/main/res/layout/display_item_poll_option.xml +++ b/mastodon/src/main/res/layout/display_item_poll_option.xml @@ -5,28 +5,30 @@ android:layout_height="wrap_content" android:paddingLeft="16dp" android:paddingRight="16dp" - android:paddingBottom="4dp" + android:paddingVertical="4dp" android:clipToPadding="false"> From cbee0fe72e15ee1dffd86b1dead8045a0a0f5695 Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:04:04 +0200 Subject: [PATCH 6/6] fix: show individual chips (#838) --- .../fragments/EditTimelinesFragment.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java index 662ddc492d..3debf9536c 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java @@ -239,16 +239,21 @@ public void onDestroy() { private boolean setTagListContent(NachoTextView editText, @Nullable List tags) { if (tags == null || tags.isEmpty()) return false; - editText.setText(String.join(",", tags)); - editText.chipifyAllUnterminatedTokens(); + editText.setText(tags); + editText.chipifyAllUnterminatedTokens(); return true; } private NachoTextView prepareChipTextView(NachoTextView nacho) { - nacho.addChipTerminator(',', BEHAVIOR_CHIPIFY_ALL); - nacho.addChipTerminator('\n', BEHAVIOR_CHIPIFY_ALL); - nacho.addChipTerminator(' ', BEHAVIOR_CHIPIFY_ALL); - nacho.addChipTerminator(';', BEHAVIOR_CHIPIFY_ALL); + //I’ll Be Back + nacho.setChipTerminators( + Map.of( + ',', BEHAVIOR_CHIPIFY_ALL, + '\n', BEHAVIOR_CHIPIFY_ALL, + ' ', BEHAVIOR_CHIPIFY_ALL, + ';', BEHAVIOR_CHIPIFY_ALL + ) + ); nacho.enableEditChipOnTouch(true, true); nacho.setOnFocusChangeListener((v, hasFocus) -> nacho.chipifyAllUnterminatedTokens()); return nacho;