diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java index 1a9a85f8c..3d11e90c0 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.java @@ -25,7 +25,7 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable; public class CommentsFragment extends BaseListInfoFragment { private final CompositeDisposable disposables = new CompositeDisposable(); - private TextView commentsDisabledView; + private TextView emptyStateDesc; public static CommentsFragment getInstance(final int serviceId, final String url, final String name) { @@ -42,7 +42,7 @@ public class CommentsFragment extends BaseListInfoFragment { protected void initViews(final View rootView, final Bundle savedInstanceState) { super.initViews(rootView, savedInstanceState); - commentsDisabledView = rootView.findViewById(R.id.comments_disabled); + emptyStateDesc = rootView.findViewById(R.id.empty_state_desc); } /*////////////////////////////////////////////////////////////////////////// @@ -84,8 +84,10 @@ public class CommentsFragment extends BaseListInfoFragment { public void handleResult(@NonNull final CommentsInfo result) { super.handleResult(result); - commentsDisabledView.setVisibility( - result.isCommentsDisabled() ? View.VISIBLE : View.GONE); + emptyStateDesc.setText( + result.isCommentsDisabled() + ? R.string.comments_are_disabled + : R.string.no_comments); ViewUtils.slideUp(requireView(), 120, 150, 0.06f); disposables.clear(); diff --git a/app/src/main/res/layout/fragment_comments.xml b/app/src/main/res/layout/fragment_comments.xml index 9de932b20..b8e536c73 100644 --- a/app/src/main/res/layout/fragment_comments.xml +++ b/app/src/main/res/layout/fragment_comments.xml @@ -41,6 +41,7 @@ tools:ignore="HardcodedText,UnusedAttribute" /> - -