mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-02-09 16:20:29 -06:00
browse: news section fix: upd
This commit is contained in:
@@ -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<BrowseView> 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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user