From c03c344f4998ca76ffef1260bbaa8c4c8cf6afc5 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Wed, 5 Apr 2023 22:56:25 +0200 Subject: [PATCH] refactor: rename ChannelInfo to ChannelAbout fix: localize about tab name --- ...eInfoFragment.java => BaseDescriptionFragment.java} | 2 +- .../newpipe/fragments/detail/DescriptionFragment.java | 2 +- ...nnelInfoFragment.java => ChannelAboutFragment.java} | 10 +++++----- .../fragments/list/channel/ChannelFragment.java | 5 +++-- app/src/main/res/values/settings_keys.xml | 6 +++--- app/src/main/res/values/strings.xml | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) rename app/src/main/java/org/schabi/newpipe/fragments/detail/{BaseInfoFragment.java => BaseDescriptionFragment.java} (99%) rename app/src/main/java/org/schabi/newpipe/fragments/list/channel/{ChannelInfoFragment.java => ChannelAboutFragment.java} (85%) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseInfoFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java similarity index 99% rename from app/src/main/java/org/schabi/newpipe/fragments/detail/BaseInfoFragment.java rename to app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java index d8aea1a03..fbbfdf23f 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseInfoFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/BaseDescriptionFragment.java @@ -33,7 +33,7 @@ import java.util.List; import io.reactivex.rxjava3.disposables.CompositeDisposable; -public abstract class BaseInfoFragment extends BaseFragment { +public abstract class BaseDescriptionFragment extends BaseFragment { final CompositeDisposable descriptionDisposables = new CompositeDisposable(); FragmentDescriptionBinding binding; 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 cf99365dc..ded4e907a 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 @@ -20,7 +20,7 @@ import java.util.List; import icepick.State; -public class DescriptionFragment extends BaseInfoFragment { +public class DescriptionFragment extends BaseDescriptionFragment { @State StreamInfo streamInfo = null; diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelInfoFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java similarity index 85% rename from app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelInfoFragment.java rename to app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java index 70b182a75..ae04e8b00 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelInfoFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java @@ -12,24 +12,24 @@ import org.schabi.newpipe.R; import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.channel.ChannelInfo; import org.schabi.newpipe.extractor.stream.Description; -import org.schabi.newpipe.fragments.detail.BaseInfoFragment; +import org.schabi.newpipe.fragments.detail.BaseDescriptionFragment; import org.schabi.newpipe.util.Localization; import java.util.List; import icepick.State; -public class ChannelInfoFragment extends BaseInfoFragment { +public class ChannelAboutFragment extends BaseDescriptionFragment { @State protected ChannelInfo channelInfo; - public static ChannelInfoFragment getInstance(final ChannelInfo channelInfo) { - final ChannelInfoFragment fragment = new ChannelInfoFragment(); + public static ChannelAboutFragment getInstance(final ChannelInfo channelInfo) { + final ChannelAboutFragment fragment = new ChannelAboutFragment(); fragment.channelInfo = channelInfo; return fragment; } - public ChannelInfoFragment() { + public ChannelAboutFragment() { super(); } diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index 96f2522eb..95aa2c45a 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -301,9 +301,10 @@ public class ChannelFragment extends BaseStateFragment final String description = currentInfo.getDescription(); if (description != null && !description.isEmpty() && ChannelTabHelper.showChannelTab( - context, preferences, R.string.show_channel_tabs_info)) { + context, preferences, R.string.show_channel_tabs_about)) { tabAdapter.addFragment( - ChannelInfoFragment.getInstance(currentInfo), "Info"); + ChannelAboutFragment.getInstance(currentInfo), + context.getString(R.string.channel_tab_about)); } } } diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml index 9746d7889..d32fbce0c 100644 --- a/app/src/main/res/values/settings_keys.xml +++ b/app/src/main/res/values/settings_keys.xml @@ -280,14 +280,14 @@ show_channel_tabs_shorts show_channel_tabs_channels show_channel_tabs_albums - show_channel_tabs_info + show_channel_tabs_about @string/show_channel_tabs_playlists @string/show_channel_tabs_livestreams @string/show_channel_tabs_shorts @string/show_channel_tabs_channels @string/show_channel_tabs_albums - @string/show_channel_tabs_info + @string/show_channel_tabs_about @string/channel_tab_playlists @@ -295,7 +295,7 @@ @string/channel_tab_shorts @string/channel_tab_channels @string/channel_tab_albums - @string/channel_tab_info + @string/channel_tab_about show_search_suggestions show_local_search_suggestions diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 87577a81a..259689231 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -803,7 +803,7 @@ Playlists Channels Albums - Info + About Channel tabs What tabs are shown on the channel pages \ No newline at end of file