From 388f9216b39ad50b31bc9e131bfba498e67c8379 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Tue, 12 Jan 2021 12:39:00 -0500 Subject: [PATCH] handling dm attachments --- .../fragments/PostViewV2Fragment.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index 9bf4c264..40f96c93 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -577,14 +577,12 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment im } private void setupLike() { - /* - final boolean likableMedia = viewModel.hasPk() && viewModel.getMedia().isCommentLikesEnabled(); + final boolean likableMedia = viewModel.hasPk() /*&& viewModel.getMedia().isCommentLikesEnabled()*/; if (!likableMedia) { binding.like.setVisibility(View.GONE); binding.likesCount.setVisibility(View.GONE); return; } - */ if (!viewModel.isLoggedIn()) { binding.like.setVisibility(View.GONE); return; @@ -1404,20 +1402,24 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment im if (media.getLocation() != null) { binding.location.setVisibility(View.VISIBLE); } - binding.captionParent.setVisibility(View.VISIBLE); binding.bottomBg.setVisibility(View.VISIBLE); - binding.likesCount.setVisibility(View.VISIBLE); - binding.commentsCount.setVisibility(View.VISIBLE); - binding.date.setVisibility(View.VISIBLE); - binding.captionToggle.setVisibility(View.VISIBLE); + if (viewModel.hasPk()) { + binding.likesCount.setVisibility(View.VISIBLE); + binding.date.setVisibility(View.VISIBLE); + binding.captionParent.setVisibility(View.VISIBLE); + binding.captionToggle.setVisibility(View.VISIBLE); + binding.share.setVisibility(View.VISIBLE); + } + if (viewModel.hasPk() && !viewModel.getMedia().isCommentsDisabled()) { + binding.comment.setVisibility(View.VISIBLE); + binding.commentsCount.setVisibility(View.VISIBLE); + } binding.download.setVisibility(View.VISIBLE); - binding.share.setVisibility(View.VISIBLE); - binding.comment.setVisibility(View.VISIBLE); final List options = viewModel.getOptions().getValue(); if (options != null && !options.isEmpty()) { binding.options.setVisibility(View.VISIBLE); } - if (viewModel.isLoggedIn()) { + if (viewModel.isLoggedIn() && viewModel.hasPk()) { binding.like.setVisibility(View.VISIBLE); binding.save.setVisibility(View.VISIBLE); }