From d1c94f5120ceeaf84590a5b1aca7465932e23639 Mon Sep 17 00:00:00 2001 From: bopol Date: Tue, 21 Apr 2020 20:08:47 +0200 Subject: [PATCH] adapt CommentsInfoItemExtractorRefactoring --- app/build.gradle | 2 +- .../info_list/holder/CommentsInfoItemHolder.java | 2 +- .../holder/CommentsMiniInfoItemHolder.java | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index db1264c57..3e04c331c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -157,7 +157,7 @@ dependencies { exclude module: 'support-annotations' }) - implementation 'com.github.TeamNewPipe:NewPipeExtractor:fc3a69ed54b393e3e4e3a78ae6e89edc1d47c45a' + implementation 'com.github.B0pol:NewPipeExtractor:bc13e0c616c7a01c5f2588ed08e4915ef2ea9106' testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.23.0' diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java index 4e74bad79..842d9c455 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsInfoItemHolder.java @@ -48,6 +48,6 @@ public class CommentsInfoItemHolder extends CommentsMiniInfoItemHolder { } final CommentsInfoItem item = (CommentsInfoItem) infoItem; - itemTitleView.setText(item.getAuthorName()); + itemTitleView.setText(item.getUploaderName()); } } diff --git a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java index 7214a05d6..68be557ca 100644 --- a/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/info_list/holder/CommentsMiniInfoItemHolder.java @@ -89,7 +89,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder { final CommentsInfoItem item = (CommentsInfoItem) infoItem; itemBuilder.getImageLoader() - .displayImage(item.getAuthorThumbnail(), + .displayImage(item.getUploaderAvatarUrl(), itemThumbnailView, ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS); @@ -114,10 +114,10 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder { itemLikesCountView.setText("-"); } - if (item.getPublishedTime() != null) { - itemPublishedTime.setText(Localization.relativeTime(item.getPublishedTime().date())); + if (item.getUploadDate() != null) { + itemPublishedTime.setText(Localization.relativeTime(item.getUploadDate().date())); } else { - itemPublishedTime.setText(item.getTextualPublishedTime()); + itemPublishedTime.setText(item.getTextualUploadDate()); } itemView.setOnClickListener(view -> { @@ -143,7 +143,7 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder { } private void openCommentAuthor(final CommentsInfoItem item) { - if (StringUtil.isBlank(item.getAuthorEndpoint())) { + if (StringUtil.isBlank(item.getUploaderUrl())) { return; } try { @@ -151,8 +151,8 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder { NavigationHelper.openChannelFragment( activity.getSupportFragmentManager(), item.getServiceId(), - item.getAuthorEndpoint(), - item.getAuthorName()); + item.getUploaderUrl(), + item.getUploaderName()); } catch (Exception e) { ErrorActivity.reportUiError((AppCompatActivity) itemBuilder.getContext(), e); }