1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00

adapt CommentsInfoItemExtractorRefactoring

This commit is contained in:
bopol 2020-04-21 20:08:47 +02:00
parent b630f269c4
commit d1c94f5120
3 changed files with 9 additions and 9 deletions

View File

@ -157,7 +157,7 @@ dependencies {
exclude module: 'support-annotations' exclude module: 'support-annotations'
}) })
implementation 'com.github.TeamNewPipe:NewPipeExtractor:fc3a69ed54b393e3e4e3a78ae6e89edc1d47c45a' implementation 'com.github.B0pol:NewPipeExtractor:bc13e0c616c7a01c5f2588ed08e4915ef2ea9106'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0' testImplementation 'org.mockito:mockito-core:2.23.0'

View File

@ -48,6 +48,6 @@ public class CommentsInfoItemHolder extends CommentsMiniInfoItemHolder {
} }
final CommentsInfoItem item = (CommentsInfoItem) infoItem; final CommentsInfoItem item = (CommentsInfoItem) infoItem;
itemTitleView.setText(item.getAuthorName()); itemTitleView.setText(item.getUploaderName());
} }
} }

View File

@ -89,7 +89,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
final CommentsInfoItem item = (CommentsInfoItem) infoItem; final CommentsInfoItem item = (CommentsInfoItem) infoItem;
itemBuilder.getImageLoader() itemBuilder.getImageLoader()
.displayImage(item.getAuthorThumbnail(), .displayImage(item.getUploaderAvatarUrl(),
itemThumbnailView, itemThumbnailView,
ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS); ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS);
@ -114,10 +114,10 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
itemLikesCountView.setText("-"); itemLikesCountView.setText("-");
} }
if (item.getPublishedTime() != null) { if (item.getUploadDate() != null) {
itemPublishedTime.setText(Localization.relativeTime(item.getPublishedTime().date())); itemPublishedTime.setText(Localization.relativeTime(item.getUploadDate().date()));
} else { } else {
itemPublishedTime.setText(item.getTextualPublishedTime()); itemPublishedTime.setText(item.getTextualUploadDate());
} }
itemView.setOnClickListener(view -> { itemView.setOnClickListener(view -> {
@ -143,7 +143,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
} }
private void openCommentAuthor(final CommentsInfoItem item) { private void openCommentAuthor(final CommentsInfoItem item) {
if (StringUtil.isBlank(item.getAuthorEndpoint())) { if (StringUtil.isBlank(item.getUploaderUrl())) {
return; return;
} }
try { try {
@ -151,8 +151,8 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
NavigationHelper.openChannelFragment( NavigationHelper.openChannelFragment(
activity.getSupportFragmentManager(), activity.getSupportFragmentManager(),
item.getServiceId(), item.getServiceId(),
item.getAuthorEndpoint(), item.getUploaderUrl(),
item.getAuthorName()); item.getUploaderName());
} catch (Exception e) { } catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) itemBuilder.getContext(), e); ErrorActivity.reportUiError((AppCompatActivity) itemBuilder.getContext(), e);
} }