mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-07-06 20:12:57 +00:00
hide tabs
hide other services like peertube fix home screen and drawer
This commit is contained in:
parent
8205c1fe67
commit
72e36c2bbb
@ -221,27 +221,27 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
int kioskMenuItemId = 0;
|
int kioskMenuItemId = 0;
|
||||||
|
|
||||||
for (final String ks : service.getKioskList().getAvailableKiosks()) {
|
// for (final String ks : service.getKioskList().getAvailableKiosks()) {
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
// drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_tabs_group, kioskMenuItemId, 0, KioskTranslator
|
// .add(R.id.menu_tabs_group, kioskMenuItemId, 0, KioskTranslator
|
||||||
.getTranslatedKioskName(ks, this))
|
// .getTranslatedKioskName(ks, this))
|
||||||
.setIcon(KioskTranslator.getKioskIcon(ks));
|
// .setIcon(KioskTranslator.getKioskIcon(ks));
|
||||||
kioskMenuItemId++;
|
// kioskMenuItemId++;
|
||||||
}
|
// }
|
||||||
|
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
// drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER,
|
// .add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER,
|
||||||
R.string.tab_subscriptions)
|
// R.string.tab_subscriptions)
|
||||||
.setIcon(R.drawable.ic_tv);
|
// .setIcon(R.drawable.ic_tv);
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
// drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title)
|
// .add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title)
|
||||||
.setIcon(R.drawable.ic_subscriptions);
|
// .setIcon(R.drawable.ic_subscriptions);
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
// drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks)
|
// .add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks)
|
||||||
.setIcon(R.drawable.ic_bookmark);
|
// .setIcon(R.drawable.ic_bookmark);
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
// drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads)
|
// .add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads)
|
||||||
.setIcon(R.drawable.ic_file_download);
|
// .setIcon(R.drawable.ic_file_download);
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
|
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
|
||||||
.setIcon(R.drawable.ic_history);
|
.setIcon(R.drawable.ic_history);
|
||||||
@ -332,7 +332,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupDrawerHeader() {
|
private void setupDrawerHeader() {
|
||||||
drawerHeaderBinding.drawerHeaderActionButton.setOnClickListener(view -> toggleServices());
|
// drawerHeaderBinding.drawerHeaderActionButton.setOnClickListener(view -> toggleServices());
|
||||||
|
|
||||||
// If the current app name is bigger than the default "NewPipe" (7 chars),
|
// If the current app name is bigger than the default "NewPipe" (7 chars),
|
||||||
// let the text view grow a little more as well.
|
// let the text view grow a little more as well.
|
||||||
|
@ -145,17 +145,12 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||||||
addMenuItemToSubmenu(importSubMenu, R.string.previous_export) { onImportPreviousSelected() }
|
addMenuItemToSubmenu(importSubMenu, R.string.previous_export) { onImportPreviousSelected() }
|
||||||
.setIcon(R.drawable.ic_backup)
|
.setIcon(R.drawable.ic_backup)
|
||||||
|
|
||||||
for (service in ServiceList.all()) {
|
val subscriptionExtractor = ServiceList.YouTube.subscriptionExtractor
|
||||||
val subscriptionExtractor = service.subscriptionExtractor ?: continue
|
|
||||||
|
|
||||||
val supportedSources = subscriptionExtractor.supportedSources
|
addMenuItemToSubmenu(importSubMenu, ServiceList.YouTube.serviceInfo.name) {
|
||||||
if (supportedSources.isEmpty()) continue
|
onImportFromServiceSelected(ServiceList.YouTube.serviceId)
|
||||||
|
|
||||||
addMenuItemToSubmenu(importSubMenu, service.serviceInfo.name) {
|
|
||||||
onImportFromServiceSelected(service.serviceId)
|
|
||||||
}
|
|
||||||
.setIcon(ServiceHelper.getIcon(service.serviceId))
|
|
||||||
}
|
}
|
||||||
|
.setIcon(ServiceHelper.getIcon(ServiceList.YouTube.serviceId))
|
||||||
|
|
||||||
// -- Export --
|
// -- Export --
|
||||||
val exportSubMenu = menu.addSubMenu(R.string.export_to)
|
val exportSubMenu = menu.addSubMenu(R.string.export_to)
|
||||||
|
@ -19,10 +19,8 @@ public final class TabsJsonHelper {
|
|||||||
private static final String JSON_TABS_ARRAY_KEY = "tabs";
|
private static final String JSON_TABS_ARRAY_KEY = "tabs";
|
||||||
|
|
||||||
private static final List<Tab> FALLBACK_INITIAL_TABS_LIST = List.of(
|
private static final List<Tab> FALLBACK_INITIAL_TABS_LIST = List.of(
|
||||||
Tab.Type.DEFAULT_KIOSK.getTab(),
|
Tab.Type.HISTORY.getTab());
|
||||||
Tab.Type.FEED.getTab(),
|
|
||||||
Tab.Type.SUBSCRIPTIONS.getTab(),
|
|
||||||
Tab.Type.BOOKMARKS.getTab());
|
|
||||||
|
|
||||||
private TabsJsonHelper() { }
|
private TabsJsonHelper() { }
|
||||||
|
|
||||||
|
@ -28,13 +28,14 @@ public final class TabsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Tab> getTabs() {
|
public List<Tab> getTabs() {
|
||||||
final String savedJson = sharedPreferences.getString(savedTabsKey, null);
|
|
||||||
try {
|
|
||||||
return TabsJsonHelper.getTabsFromJson(savedJson);
|
|
||||||
} catch (final TabsJsonHelper.InvalidJsonException e) {
|
|
||||||
Toast.makeText(context, R.string.saved_tabs_invalid_json, Toast.LENGTH_SHORT).show();
|
|
||||||
return getDefaultTabs();
|
return getDefaultTabs();
|
||||||
}
|
// final String savedJson = sharedPreferences.getString(savedTabsKey, null);
|
||||||
|
// try {
|
||||||
|
// return TabsJsonHelper.getTabsFromJson(savedJson);
|
||||||
|
// } catch (final TabsJsonHelper.InvalidJsonException e) {
|
||||||
|
// Toast.makeText(context, R.string.saved_tabs_invalid_json, Toast.LENGTH_SHORT).show();
|
||||||
|
// return getDefaultTabs();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveTabs(final List<Tab> tabList) {
|
public void saveTabs(final List<Tab> tabList) {
|
||||||
|
@ -193,8 +193,9 @@ public final class ServiceHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void initServices(final Context context) {
|
public static void initServices(final Context context) {
|
||||||
for (final StreamingService s : ServiceList.all()) {
|
initService(context, ServiceList.YouTube.getServiceId());
|
||||||
initService(context, s.getServiceId());
|
// for (final StreamingService s : ServiceList.all()) {
|
||||||
}
|
// initService(context, ServiceList.YouTube.getServiceId());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user