From d025ef11f8e72f083fd91c8436a29c438f384bc0 Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 2 Jun 2021 16:15:53 +0200 Subject: [PATCH] Sort tags in metadata section --- .../newpipe/fragments/detail/DescriptionFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java index bbff26cc4..5f1cbc365 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java @@ -26,6 +26,10 @@ import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.ShareUtils; import org.schabi.newpipe.util.TextLinkifier; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import icepick.State; import io.reactivex.rxjava3.disposables.Disposable; @@ -208,7 +212,9 @@ public class DescriptionFragment extends BaseFragment { final ItemMetadataTagsBinding itemBinding = ItemMetadataTagsBinding.inflate(inflater, layout, false); - for (final String tag : streamInfo.getTags()) { + final List tags = new ArrayList<>(streamInfo.getTags()); + Collections.sort(tags); + for (final String tag : tags) { final Chip chip = (Chip) inflater.inflate(R.layout.chip, itemBinding.metadataTagsChips, false); chip.setText(tag);