1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01:00

refactor: rename ChannelInfo to ChannelAbout

fix: localize about tab name
This commit is contained in:
ThetaDev 2023-04-05 22:56:25 +02:00 committed by Stypox
parent 25e3031830
commit c03c344f49
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
6 changed files with 14 additions and 13 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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();
}

View File

@ -301,9 +301,10 @@ public class ChannelFragment extends BaseStateFragment<ChannelInfo>
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));
}
}
}

View File

@ -280,14 +280,14 @@
<string name="show_channel_tabs_shorts">show_channel_tabs_shorts</string>
<string name="show_channel_tabs_channels">show_channel_tabs_channels</string>
<string name="show_channel_tabs_albums">show_channel_tabs_albums</string>
<string name="show_channel_tabs_info">show_channel_tabs_info</string>
<string name="show_channel_tabs_about">show_channel_tabs_about</string>
<string-array name="show_channel_tabs_value_list">
<item>@string/show_channel_tabs_playlists</item>
<item>@string/show_channel_tabs_livestreams</item>
<item>@string/show_channel_tabs_shorts</item>
<item>@string/show_channel_tabs_channels</item>
<item>@string/show_channel_tabs_albums</item>
<item>@string/show_channel_tabs_info</item>
<item>@string/show_channel_tabs_about</item>
</string-array>
<string-array name="show_channel_tabs_description_list">
<item>@string/channel_tab_playlists</item>
@ -295,7 +295,7 @@
<item>@string/channel_tab_shorts</item>
<item>@string/channel_tab_channels</item>
<item>@string/channel_tab_albums</item>
<item>@string/channel_tab_info</item>
<item>@string/channel_tab_about</item>
</string-array>
<string name="show_search_suggestions_key">show_search_suggestions</string>
<string name="show_local_search_suggestions_key">show_local_search_suggestions</string>

View File

@ -803,7 +803,7 @@
<string name="channel_tab_playlists">Playlists</string>
<string name="channel_tab_channels">Channels</string>
<string name="channel_tab_albums">Albums</string>
<string name="channel_tab_info">Info</string>
<string name="channel_tab_about">About</string>
<string name="show_channel_tabs">Channel tabs</string>
<string name="show_channel_tabs_summary">What tabs are shown on the channel pages</string>
</resources>