Fix compile errors
This commit is contained in:
parent
bd19013771
commit
04e8e03d8f
9 changed files with 69 additions and 66 deletions
|
|
@ -1,5 +1,8 @@
|
|||
package org.schabi.newpipe.settings.tabs;
|
||||
|
||||
import static org.schabi.newpipe.settings.tabs.Tab.typeFrom;
|
||||
import static org.schabi.newpipe.util.ServiceHelper.getNameOfServiceById;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
|
@ -28,7 +31,6 @@ import org.schabi.newpipe.R;
|
|||
import org.schabi.newpipe.error.ErrorInfo;
|
||||
import org.schabi.newpipe.error.ErrorUtil;
|
||||
import org.schabi.newpipe.error.UserAction;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.settings.SelectChannelFragment;
|
||||
import org.schabi.newpipe.settings.SelectKioskFragment;
|
||||
import org.schabi.newpipe.settings.SelectPlaylistFragment;
|
||||
|
|
@ -39,8 +41,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.schabi.newpipe.settings.tabs.Tab.typeFrom;
|
||||
|
||||
public class ChooseTabsFragment extends Fragment {
|
||||
private TabsManager tabsManager;
|
||||
|
||||
|
|
@ -374,36 +374,31 @@ public class ChooseTabsFragment extends Fragment {
|
|||
return;
|
||||
}
|
||||
|
||||
final String tabName;
|
||||
tabNameView.setText(getTabName(type, tab));
|
||||
tabIconView.setImageResource(tab.getTabIconRes(requireContext()));
|
||||
}
|
||||
|
||||
private String getTabName(@NonNull final Tab.Type type, @NonNull final Tab tab) {
|
||||
switch (type) {
|
||||
case BLANK:
|
||||
tabName = getString(R.string.blank_page_summary);
|
||||
break;
|
||||
return getString(R.string.blank_page_summary);
|
||||
case DEFAULT_KIOSK:
|
||||
tabName = getString(R.string.default_kiosk_page_summary);
|
||||
break;
|
||||
return getString(R.string.default_kiosk_page_summary);
|
||||
case KIOSK:
|
||||
tabName = NewPipe.getNameOfService(((Tab.KioskTab) tab)
|
||||
.getKioskServiceId()) + "/" + tab.getTabName(requireContext());
|
||||
break;
|
||||
return getNameOfServiceById(((Tab.KioskTab) tab).getKioskServiceId())
|
||||
+ "/" + tab.getTabName(requireContext());
|
||||
case CHANNEL:
|
||||
tabName = NewPipe.getNameOfService(((Tab.ChannelTab) tab)
|
||||
.getChannelServiceId()) + "/" + tab.getTabName(requireContext());
|
||||
break;
|
||||
return getNameOfServiceById(((Tab.ChannelTab) tab).getChannelServiceId())
|
||||
+ "/" + tab.getTabName(requireContext());
|
||||
case PLAYLIST:
|
||||
final int serviceId = ((Tab.PlaylistTab) tab).getPlaylistServiceId();
|
||||
final String serviceName = serviceId == -1
|
||||
? getString(R.string.local)
|
||||
: NewPipe.getNameOfService(serviceId);
|
||||
tabName = serviceName + "/" + tab.getTabName(requireContext());
|
||||
break;
|
||||
: getNameOfServiceById(serviceId);
|
||||
return serviceName + "/" + tab.getTabName(requireContext());
|
||||
default:
|
||||
tabName = tab.getTabName(requireContext());
|
||||
break;
|
||||
return tab.getTabName(requireContext());
|
||||
}
|
||||
|
||||
tabNameView.setText(tabName);
|
||||
tabIconView.setImageResource(tab.getTabIconRes(requireContext()));
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue