merged origin/peertube-ui

This commit is contained in:
yausername 2019-11-24 21:18:35 +05:30
commit 3e2dba2fd5
2 changed files with 14 additions and 14 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);
}
@ -219,7 +219,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
.debounce(100, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe((List<SubscriptionEntity> subscriptionEntities) ->
updateSubscribeButton(!subscriptionEntities.isEmpty())
updateSubscribeButton(!subscriptionEntities.isEmpty())
, onError));
}
@ -360,9 +360,9 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
headerRootLayout.setVisibility(View.VISIBLE);
imageLoader.displayImage(result.getBannerUrl(), headerChannelBanner,
ImageDisplayConstants.DISPLAY_BANNER_OPTIONS);
ImageDisplayConstants.DISPLAY_BANNER_OPTIONS);
imageLoader.displayImage(result.getAvatarUrl(), headerAvatarView,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
headerSubscribersTextView.setVisibility(View.VISIBLE);
if (result.getSubscriberCount() >= 0) {
@ -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

@ -42,7 +42,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);
@ -135,7 +135,7 @@ 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;
}
@ -162,8 +162,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());
}
}