From 9c274a7c390aff339d8a6f13a64ed4a064ca2eac Mon Sep 17 00:00:00 2001 From: Yuriy Liskov Date: Sat, 6 Aug 2022 01:08:57 +0300 Subject: [PATCH] browse: news section fix: upd --- .../common/app/presenters/BrowsePresenter.java | 11 ++++++----- .../smartyoutubetv2/common/prefs/GeneralData.java | 7 +------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java index 96006fb4e..79622467c 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java @@ -8,6 +8,7 @@ import com.liskovsoft.mediaserviceinterfaces.MediaService; import com.liskovsoft.mediaserviceinterfaces.SignInService; import com.liskovsoft.mediaserviceinterfaces.data.MediaGroup; import com.liskovsoft.sharedutils.helpers.Helpers; +import com.liskovsoft.sharedutils.locale.LocaleUtility; import com.liskovsoft.sharedutils.mylogger.Log; import com.liskovsoft.sharedutils.rx.RxUtils; import com.liskovsoft.smartyoutubetv2.common.R; @@ -134,16 +135,16 @@ public class BrowsePresenter extends BasePresenter implements Sectio initSettingsSubCategories(); } - - /** - * NOTE: This only mapping. Enabled section list is here: GeneralData#initSections() - */ + private void initSectionMapping() { + String country = LocaleUtility.getCurrentLocale(getContext()).getCountry(); int uploadsType = mMainUIData.isUploadsOldLookEnabled() ? BrowseSection.TYPE_GRID : BrowseSection.TYPE_MULTI_GRID; mSectionsMapping.put(MediaGroup.TYPE_HOME, new BrowseSection(MediaGroup.TYPE_HOME, getContext().getString(R.string.header_home), BrowseSection.TYPE_ROW, R.drawable.icon_home)); mSectionsMapping.put(MediaGroup.TYPE_GAMING, new BrowseSection(MediaGroup.TYPE_GAMING, getContext().getString(R.string.header_gaming), BrowseSection.TYPE_ROW, R.drawable.icon_gaming)); - mSectionsMapping.put(MediaGroup.TYPE_NEWS, new BrowseSection(MediaGroup.TYPE_NEWS, getContext().getString(R.string.header_news), BrowseSection.TYPE_ROW, R.drawable.icon_news)); + if (!Helpers.equalsAny(country, "RU")) { + mSectionsMapping.put(MediaGroup.TYPE_NEWS, new BrowseSection(MediaGroup.TYPE_NEWS, getContext().getString(R.string.header_news), BrowseSection.TYPE_ROW, R.drawable.icon_news)); + } mSectionsMapping.put(MediaGroup.TYPE_MUSIC, new BrowseSection(MediaGroup.TYPE_MUSIC, getContext().getString(R.string.header_music), BrowseSection.TYPE_ROW, R.drawable.icon_music)); mSectionsMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, new BrowseSection(MediaGroup.TYPE_CHANNEL_UPLOADS, getContext().getString(R.string.header_channels), uploadsType, R.drawable.icon_channels, true)); mSectionsMapping.put(MediaGroup.TYPE_SUBSCRIPTIONS, new BrowseSection(MediaGroup.TYPE_SUBSCRIPTIONS, getContext().getString(R.string.header_subscriptions), BrowseSection.TYPE_GRID, R.drawable.icon_subscriptions, true)); diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/GeneralData.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/GeneralData.java index 45f43f8cb..02594f539 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/GeneralData.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/GeneralData.java @@ -4,7 +4,6 @@ import android.annotation.SuppressLint; import android.content.Context; import com.liskovsoft.mediaserviceinterfaces.data.MediaGroup; import com.liskovsoft.sharedutils.helpers.Helpers; -import com.liskovsoft.sharedutils.locale.LocaleUtility; import com.liskovsoft.sharedutils.prefs.GlobalPreferences; import com.liskovsoft.smartyoutubetv2.common.R; import com.liskovsoft.smartyoutubetv2.common.app.models.data.Video; @@ -597,13 +596,9 @@ public class GeneralData { } private void initSections() { - String country = LocaleUtility.getCurrentLocale(mContext).getCountry(); - mDefaultSections.put(R.string.header_home, MediaGroup.TYPE_HOME); mDefaultSections.put(R.string.header_gaming, MediaGroup.TYPE_GAMING); - if (!Helpers.equalsAny(country, "RU")) { - mDefaultSections.put(R.string.header_news, MediaGroup.TYPE_NEWS); - } + mDefaultSections.put(R.string.header_news, MediaGroup.TYPE_NEWS); mDefaultSections.put(R.string.header_music, MediaGroup.TYPE_MUSIC); mDefaultSections.put(R.string.header_channels, MediaGroup.TYPE_CHANNEL_UPLOADS); mDefaultSections.put(R.string.header_subscriptions, MediaGroup.TYPE_SUBSCRIPTIONS);