From d800d2b10c2a64b23610a8c51153d569142a545a Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 15 Oct 2020 19:07:58 +0200 Subject: [PATCH] Fix comment layout --- .../app/fedilab/fedilabtube/PeertubeActivity.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index 680aa06..cba1b3a 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -209,6 +209,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd } + if( !Helper.isLoggedIn(PeertubeActivity.this) || sepiaSearch) { + binding.writeCommentContainerReply.setVisibility(View.GONE); + binding.writeCommentContainer.setVisibility(View.GONE); + } playInMinimized = sharedpreferences.getBoolean(getString(R.string.set_video_minimize_choice), true); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N && !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) { @@ -504,7 +508,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd PlaylistsVM viewModel = new ViewModelProvider(this).get(PlaylistsVM.class); viewModel.videoExists(videoIds).observe(this, this::manageVIewPlaylist); - if( !Helper.isLoggedIn(PeertubeActivity.this)) { + if( !Helper.isLoggedIn(PeertubeActivity.this) || sepiaSearch) { binding.writeCommentContainer.setVisibility(View.GONE); binding.writeCommentContainerReply.setVisibility(View.GONE); } @@ -533,11 +537,12 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd if (peertube.isCommentsEnabled()) { CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class); commentViewModel.getThread(sepiaSearch?peertubeInstance:null, videoUuid, max_id).observe(PeertubeActivity.this, this::manageVIewComment); - binding.writeCommentContainer.setVisibility(View.VISIBLE); + binding.writeCommentContainerReply.setVisibility(View.GONE); + binding.writeCommentContainer.setVisibility(View.GONE); } else { - - + binding.writeCommentContainerReply.setVisibility(View.GONE); + binding.writeCommentContainer.setVisibility(View.GONE); binding.noActionText.setText(getString(R.string.comment_no_allowed_peertube)); binding.noAction.setVisibility(View.VISIBLE); binding.writeCommentContainer.setVisibility(View.GONE);