Fix code formatting

This commit is contained in:
TobiGr 2019-11-23 20:04:40 +01:00
parent afef8d8d0b
commit 0fb7eab2f9
3 changed files with 17 additions and 17 deletions

View File

@ -99,7 +99,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(activity != null
if (activity != null
&& useAsFrontPage
&& isVisibleToUser) {
setTitle(currentInfo != null ? currentInfo.getName() : name);
@ -153,7 +153,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
ActionBar supportActionBar = activity.getSupportActionBar();
if(useAsFrontPage && supportActionBar != null) {
if (useAsFrontPage && supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(false);
} else {
inflater.inflate(R.menu.menu_channel, menu);
@ -166,7 +166,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private void openRssFeed() {
final ChannelInfo info = currentInfo;
if(info != null) {
if (info != null) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(info.getFeedUrl()));
startActivity(intent);
}
@ -398,8 +398,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private PlayQueue getPlayQueue(final int index) {
final List<StreamInfoItem> streamItems = new ArrayList<>();
for(InfoItem i : infoListAdapter.getItemsList()) {
if(i instanceof StreamInfoItem) {
for (InfoItem i : infoListAdapter.getItemsList()) {
if (i instanceof StreamInfoItem) {
streamItems.add((StreamInfoItem) i);
}
}
@ -433,9 +433,9 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
protected boolean onError(Throwable exception) {
if (super.onError(exception)) return true;
if(exception instanceof ContentNotAvailableException){
if (exception instanceof ContentNotAvailableException) {
showError(getString(R.string.content_not_available), false);
}else{
} else {
int errorId = exception instanceof ExtractionException ? R.string.parsing_error : R.string.general_error;
onUnrecoverableError(exception,
UserAction.REQUESTED_CHANNEL,

View File

@ -37,7 +37,7 @@ public class ServiceHelper {
}
public static String getTranslatedFilterString(String filter, Context c) {
switch(filter) {
switch (filter) {
case "all": return c.getString(R.string.all);
case "videos": return c.getString(R.string.videos);
case "channels": return c.getString(R.string.channels);
@ -130,14 +130,14 @@ public class ServiceHelper {
}
public static boolean isBeta(final StreamingService s) {
switch(s.getServiceInfo().getName()) {
switch (s.getServiceInfo().getName()) {
case "YouTube": return false;
default: return true;
}
}
public static void initService(Context context, int serviceId) {
if(serviceId == ServiceList.PeerTube.getServiceId()){
if (serviceId == ServiceList.PeerTube.getServiceId()) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
String peerTubeInstanceUrl = sharedPreferences.getString(context.getString(R.string.peertube_instance_url_key), ServiceList.PeerTube.getBaseUrl());
String peerTubeInstanceName = sharedPreferences.getString(context.getString(R.string.peertube_instance_name_key), ServiceList.PeerTube.getServiceInfo().getName());
@ -146,8 +146,8 @@ public class ServiceHelper {
}
}
public static void initServices(Context context){
for(StreamingService s : ServiceList.all()){
public static void initServices(Context context) {
for (StreamingService s : ServiceList.all()) {
initService(context, s.getServiceId());
}
}

View File

@ -137,10 +137,10 @@ public class ThemeHelper {
else if (selectedTheme.equals(blackTheme)) themeName = "BlackTheme";
else if (selectedTheme.equals(darkTheme)) themeName = "DarkTheme";
if(serviceId == ServiceList.PeerTube.getServiceId()){
if (serviceId == ServiceList.PeerTube.getServiceId()) {
//service name for peertube depends on the instance
themeName += ".PeerTube";
}else{
} else {
themeName += "." + service.getServiceInfo().getName();
}