Removed the "(beta)"-tag from services (#8637)
This commit is contained in:
parent
8f37015dbb
commit
51e72d1a05
|
@ -374,8 +374,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private void showServices() {
|
private void showServices() {
|
||||||
for (final StreamingService s : NewPipe.getServices()) {
|
for (final StreamingService s : NewPipe.getServices()) {
|
||||||
final String title = s.getServiceInfo().getName()
|
final String title = s.getServiceInfo().getName();
|
||||||
+ (ServiceHelper.isBeta(s) ? " (beta)" : "");
|
|
||||||
|
|
||||||
final MenuItem menuItem = drawerLayoutBinding.navigation.getMenu()
|
final MenuItem menuItem = drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_services_group, s.getServiceId(), ORDER, title)
|
.add(R.id.menu_services_group, s.getServiceId(), ORDER, title)
|
||||||
|
@ -383,7 +382,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
// peertube specifics
|
// peertube specifics
|
||||||
if (s.getServiceId() == 3) {
|
if (s.getServiceId() == 3) {
|
||||||
enhancePeertubeMenu(s, menuItem);
|
enhancePeertubeMenu(menuItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
drawerLayoutBinding.navigation.getMenu()
|
||||||
|
@ -391,9 +390,9 @@ public class MainActivity extends AppCompatActivity {
|
||||||
.setChecked(true);
|
.setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enhancePeertubeMenu(final StreamingService s, final MenuItem menuItem) {
|
private void enhancePeertubeMenu(final MenuItem menuItem) {
|
||||||
final PeertubeInstance currentInstance = PeertubeHelper.getCurrentInstance();
|
final PeertubeInstance currentInstance = PeertubeHelper.getCurrentInstance();
|
||||||
menuItem.setTitle(currentInstance.getName() + (ServiceHelper.isBeta(s) ? " (beta)" : ""));
|
menuItem.setTitle(currentInstance.getName());
|
||||||
final Spinner spinner = InstanceSpinnerLayoutBinding.inflate(LayoutInflater.from(this))
|
final Spinner spinner = InstanceSpinnerLayoutBinding.inflate(LayoutInflater.from(this))
|
||||||
.getRoot();
|
.getRoot();
|
||||||
final List<PeertubeInstance> instances = PeertubeHelper.getInstanceList(this);
|
final List<PeertubeInstance> instances = PeertubeHelper.getInstanceList(this);
|
||||||
|
|
|
@ -169,15 +169,6 @@ public final class ServiceHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isBeta(final StreamingService s) {
|
|
||||||
switch (s.getServiceInfo().getName()) {
|
|
||||||
case "YouTube":
|
|
||||||
return false;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void initService(final Context context, final int serviceId) {
|
public static void initService(final Context context, final int serviceId) {
|
||||||
if (serviceId == ServiceList.PeerTube.getServiceId()) {
|
if (serviceId == ServiceList.PeerTube.getServiceId()) {
|
||||||
final SharedPreferences sharedPreferences = PreferenceManager
|
final SharedPreferences sharedPreferences = PreferenceManager
|
||||||
|
|
Loading…
Reference in New Issue