diff --git a/app/src/main/java/de/danoeh/antennapod/ui/home/HomeSection.java b/app/src/main/java/de/danoeh/antennapod/ui/home/HomeSection.java index dd48f0ada..30513c198 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/home/HomeSection.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/home/HomeSection.java @@ -9,8 +9,9 @@ import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.text.TextUtilsCompat; +import androidx.core.view.ViewCompat; import androidx.fragment.app.Fragment; -import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.EpisodeItemListAdapter; import de.danoeh.antennapod.adapter.HorizontalItemListAdapter; import de.danoeh.antennapod.databinding.HomeSectionBinding; @@ -18,6 +19,8 @@ import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler; import de.danoeh.antennapod.model.feed.FeedItem; import org.greenrobot.eventbus.EventBus; +import java.util.Locale; + /** * Section on the HomeFragment */ @@ -31,7 +34,11 @@ public abstract class HomeSection extends Fragment implements View.OnCreateConte @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { viewBinding = HomeSectionBinding.inflate(inflater); viewBinding.titleLabel.setText(getSectionTitle()); - viewBinding.moreButton.setText(getString(R.string.navigate_arrows, getMoreLinkTitle())); + if (TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_LTR) { + viewBinding.moreButton.setText(getMoreLinkTitle() + "\u00A0»"); + } else { + viewBinding.moreButton.setText("«\u00A0" + getMoreLinkTitle()); + } viewBinding.moreButton.setOnClickListener((view) -> handleMoreClick()); if (TextUtils.isEmpty(getMoreLinkTitle())) { viewBinding.moreButton.setVisibility(View.INVISIBLE); diff --git a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/InboxSection.java b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/InboxSection.java index 3e7b02fd3..e635e9538 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/home/sections/InboxSection.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/home/sections/InboxSection.java @@ -36,6 +36,7 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.List; +import java.util.Locale; public class InboxSection extends HomeSection { public static final String TAG = "InboxSection"; @@ -133,7 +134,11 @@ public class InboxSection extends HomeSection { adapter.setDummyViews(0); adapter.updateItems(items); viewBinding.numNewItemsLabel.setVisibility(View.VISIBLE); - viewBinding.numNewItemsLabel.setText(String.valueOf(data.second)); + if (data.second >= 100) { + viewBinding.numNewItemsLabel.setText(String.format(Locale.getDefault(), "%d+", 99)); + } else { + viewBinding.numNewItemsLabel.setText(String.format(Locale.getDefault(), "%d", data.second)); + } }, error -> Log.e(TAG, Log.getStackTraceString(error))); } } diff --git a/app/src/main/res/layout/home_section.xml b/app/src/main/res/layout/home_section.xml index ea9c2ff3e..a8885b514 100644 --- a/app/src/main/res/layout/home_section.xml +++ b/app/src/main/res/layout/home_section.xml @@ -49,7 +49,7 @@ Get surprised Check your classics Continue listening - Review the new + See what\'s new Manage downloads Welcome to AntennaPod! You are not subscribed to any podcasts yet. Open the side menu to add a podcast. - %s » Configure Home Screen