Fix arrow direction of home more links on RTL languages (#7557)

Concatenation does not work with real translations because
Android reverses the arrow symbol automatically.
This commit is contained in:
ByteHamster 2024-12-15 13:11:33 +01:00 committed by GitHub
parent 24f09aa7ce
commit 283215b58f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 12 deletions

View File

@ -21,8 +21,6 @@ import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedItem;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import java.util.Locale;
/** /**
* Section on the HomeFragment * Section on the HomeFragment
*/ */
@ -36,11 +34,7 @@ public abstract class HomeSection extends Fragment implements View.OnCreateConte
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
viewBinding = HomeSectionBinding.inflate(inflater); viewBinding = HomeSectionBinding.inflate(inflater);
viewBinding.titleLabel.setText(getSectionTitle()); viewBinding.titleLabel.setText(getSectionTitle());
if (TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == View.LAYOUT_DIRECTION_LTR) { viewBinding.moreButton.setText(getMoreLinkTitle());
viewBinding.moreButton.setText(getMoreLinkTitle() + "\u00A0»");
} else {
viewBinding.moreButton.setText("«\u00A0" + getMoreLinkTitle());
}
viewBinding.moreButton.setOnClickListener((view) -> handleMoreClick()); viewBinding.moreButton.setOnClickListener((view) -> handleMoreClick());
if (TextUtils.isEmpty(getMoreLinkTitle())) { if (TextUtils.isEmpty(getMoreLinkTitle())) {
viewBinding.moreButton.setVisibility(View.INVISIBLE); viewBinding.moreButton.setVisibility(View.INVISIBLE);

View File

@ -125,7 +125,7 @@ public class DownloadsSection extends HomeSection {
@Override @Override
protected String getMoreLinkTitle() { protected String getMoreLinkTitle() {
return getString(R.string.downloads_label); return getString(R.string.downloads_label_more);
} }
private void loadItems() { private void loadItems() {

View File

@ -92,7 +92,7 @@ public class EpisodesSurpriseSection extends HomeSection {
@Override @Override
protected String getMoreLinkTitle() { protected String getMoreLinkTitle() {
return getString(R.string.episodes_label); return getString(R.string.episodes_label_more);
} }

View File

@ -116,7 +116,7 @@ public class InboxSection extends HomeSection {
@Override @Override
protected String getMoreLinkTitle() { protected String getMoreLinkTitle() {
return getString(R.string.inbox_label); return getString(R.string.inbox_label_more);
} }
private void loadItems() { private void loadItems() {

View File

@ -143,7 +143,7 @@ public class QueueSection extends HomeSection {
@Override @Override
protected String getMoreLinkTitle() { protected String getMoreLinkTitle() {
return getString(R.string.queue_label); return getString(R.string.queue_label_more);
} }
private void loadItems() { private void loadItems() {

View File

@ -84,7 +84,7 @@ public class SubscriptionsSection extends HomeSection {
@Override @Override
protected String getMoreLinkTitle() { protected String getMoreLinkTitle() {
return getString(R.string.subscriptions_label); return getString(R.string.subscriptions_label_more);
} }
private void loadItems() { private void loadItems() {

View File

@ -71,6 +71,11 @@
<string name="configure_home">Configure Home Screen</string> <string name="configure_home">Configure Home Screen</string>
<string name="section_hidden">Hidden</string> <string name="section_hidden">Hidden</string>
<string name="section_shown">Shown</string> <string name="section_shown">Shown</string>
<string name="episodes_label_more">Episodes »</string>
<string name="queue_label_more">Queue »</string>
<string name="inbox_label_more">Inbox »</string>
<string name="downloads_label_more">Downloads »</string>
<string name="subscriptions_label_more">Subscriptions »</string>
<!-- Download Statistics fragment --> <!-- Download Statistics fragment -->
<plurals name="total_size_downloaded_podcasts"> <plurals name="total_size_downloaded_podcasts">