merged origin/peertube-ui
This commit is contained in:
commit
3e2dba2fd5
2 changed files with 14 additions and 14 deletions
|
@ -99,7 +99,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
@Override
|
@Override
|
||||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||||
super.setUserVisibleHint(isVisibleToUser);
|
super.setUserVisibleHint(isVisibleToUser);
|
||||||
if(activity != null
|
if (activity != null
|
||||||
&& useAsFrontPage
|
&& useAsFrontPage
|
||||||
&& isVisibleToUser) {
|
&& isVisibleToUser) {
|
||||||
setTitle(currentInfo != null ? currentInfo.getName() : name);
|
setTitle(currentInfo != null ? currentInfo.getName() : name);
|
||||||
|
@ -153,7 +153,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||||
super.onCreateOptionsMenu(menu, inflater);
|
super.onCreateOptionsMenu(menu, inflater);
|
||||||
ActionBar supportActionBar = activity.getSupportActionBar();
|
ActionBar supportActionBar = activity.getSupportActionBar();
|
||||||
if(useAsFrontPage && supportActionBar != null) {
|
if (useAsFrontPage && supportActionBar != null) {
|
||||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
inflater.inflate(R.menu.menu_channel, menu);
|
inflater.inflate(R.menu.menu_channel, menu);
|
||||||
|
@ -166,7 +166,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
|
|
||||||
private void openRssFeed() {
|
private void openRssFeed() {
|
||||||
final ChannelInfo info = currentInfo;
|
final ChannelInfo info = currentInfo;
|
||||||
if(info != null) {
|
if (info != null) {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(info.getFeedUrl()));
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(info.getFeedUrl()));
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
.debounce(100, TimeUnit.MILLISECONDS)
|
.debounce(100, TimeUnit.MILLISECONDS)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe((List<SubscriptionEntity> subscriptionEntities) ->
|
.subscribe((List<SubscriptionEntity> subscriptionEntities) ->
|
||||||
updateSubscribeButton(!subscriptionEntities.isEmpty())
|
updateSubscribeButton(!subscriptionEntities.isEmpty())
|
||||||
, onError));
|
, onError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -360,9 +360,9 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
|
|
||||||
headerRootLayout.setVisibility(View.VISIBLE);
|
headerRootLayout.setVisibility(View.VISIBLE);
|
||||||
imageLoader.displayImage(result.getBannerUrl(), headerChannelBanner,
|
imageLoader.displayImage(result.getBannerUrl(), headerChannelBanner,
|
||||||
ImageDisplayConstants.DISPLAY_BANNER_OPTIONS);
|
ImageDisplayConstants.DISPLAY_BANNER_OPTIONS);
|
||||||
imageLoader.displayImage(result.getAvatarUrl(), headerAvatarView,
|
imageLoader.displayImage(result.getAvatarUrl(), headerAvatarView,
|
||||||
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
|
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
|
||||||
|
|
||||||
headerSubscribersTextView.setVisibility(View.VISIBLE);
|
headerSubscribersTextView.setVisibility(View.VISIBLE);
|
||||||
if (result.getSubscriberCount() >= 0) {
|
if (result.getSubscriberCount() >= 0) {
|
||||||
|
@ -398,8 +398,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
|
|
||||||
private PlayQueue getPlayQueue(final int index) {
|
private PlayQueue getPlayQueue(final int index) {
|
||||||
final List<StreamInfoItem> streamItems = new ArrayList<>();
|
final List<StreamInfoItem> streamItems = new ArrayList<>();
|
||||||
for(InfoItem i : infoListAdapter.getItemsList()) {
|
for (InfoItem i : infoListAdapter.getItemsList()) {
|
||||||
if(i instanceof StreamInfoItem) {
|
if (i instanceof StreamInfoItem) {
|
||||||
streamItems.add((StreamInfoItem) i);
|
streamItems.add((StreamInfoItem) i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -433,9 +433,9 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
protected boolean onError(Throwable exception) {
|
protected boolean onError(Throwable exception) {
|
||||||
if (super.onError(exception)) return true;
|
if (super.onError(exception)) return true;
|
||||||
|
|
||||||
if(exception instanceof ContentNotAvailableException){
|
if (exception instanceof ContentNotAvailableException) {
|
||||||
showError(getString(R.string.content_not_available), false);
|
showError(getString(R.string.content_not_available), false);
|
||||||
}else{
|
} else {
|
||||||
int errorId = exception instanceof ExtractionException ? R.string.parsing_error : R.string.general_error;
|
int errorId = exception instanceof ExtractionException ? R.string.parsing_error : R.string.general_error;
|
||||||
onUnrecoverableError(exception,
|
onUnrecoverableError(exception,
|
||||||
UserAction.REQUESTED_CHANNEL,
|
UserAction.REQUESTED_CHANNEL,
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ServiceHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTranslatedFilterString(String filter, Context c) {
|
public static String getTranslatedFilterString(String filter, Context c) {
|
||||||
switch(filter) {
|
switch (filter) {
|
||||||
case "all": return c.getString(R.string.all);
|
case "all": return c.getString(R.string.all);
|
||||||
case "videos": return c.getString(R.string.videos);
|
case "videos": return c.getString(R.string.videos);
|
||||||
case "channels": return c.getString(R.string.channels);
|
case "channels": return c.getString(R.string.channels);
|
||||||
|
@ -135,7 +135,7 @@ public class ServiceHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isBeta(final StreamingService s) {
|
public static boolean isBeta(final StreamingService s) {
|
||||||
switch(s.getServiceInfo().getName()) {
|
switch (s.getServiceInfo().getName()) {
|
||||||
case "YouTube": return false;
|
case "YouTube": return false;
|
||||||
default: return true;
|
default: return true;
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,8 @@ public class ServiceHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initServices(Context context){
|
public static void initServices(Context context) {
|
||||||
for(StreamingService s : ServiceList.all()){
|
for (StreamingService s : ServiceList.all()) {
|
||||||
initService(context, s.getServiceId());
|
initService(context, s.getServiceId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue