|
@ -465,16 +465,16 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment im |
|
|
binding.date.setVisibility(View.VISIBLE); |
|
|
binding.date.setVisibility(View.VISIBLE); |
|
|
binding.date.setText(date); |
|
|
binding.date.setText(date); |
|
|
})); |
|
|
})); |
|
|
if (viewModel.getMedia().isCommentLikesEnabled()) { |
|
|
|
|
|
viewModel.getLikeCount().observe(getViewLifecycleOwner(), count -> { |
|
|
|
|
|
final long safeCount = getSafeCount(count); |
|
|
|
|
|
final String likesString = getResources().getQuantityString(R.plurals.likes_count, (int) safeCount, safeCount); |
|
|
|
|
|
binding.likesCount.setText(likesString); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
viewModel.getLikeCount().observe(getViewLifecycleOwner(), count -> { |
|
|
|
|
|
final long safeCount = getSafeCount(count); |
|
|
|
|
|
final String likesString = getResources().getQuantityString(R.plurals.likes_count, (int) safeCount, safeCount); |
|
|
|
|
|
binding.likesCount.setText(likesString); |
|
|
|
|
|
}); |
|
|
|
|
|
if (!viewModel.getMedia().isCommentsDisabled()) { |
|
|
viewModel.getCommentCount().observe(getViewLifecycleOwner(), count -> { |
|
|
viewModel.getCommentCount().observe(getViewLifecycleOwner(), count -> { |
|
|
final long safeCount = getSafeCount(count); |
|
|
final long safeCount = getSafeCount(count); |
|
|
final String likesString = getResources().getQuantityString(R.plurals.comments_count, (int) safeCount, safeCount); |
|
|
final String likesString = getResources().getQuantityString(R.plurals.comments_count, (int) safeCount, safeCount); |
|
|
binding.likesCount.setText(likesString); |
|
|
|
|
|
|
|
|
binding.commentsCount.setText(likesString); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
viewModel.getViewCount().observe(getViewLifecycleOwner(), count -> { |
|
|
viewModel.getViewCount().observe(getViewLifecycleOwner(), count -> { |
|
@ -538,7 +538,7 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment im |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void setupComment() { |
|
|
private void setupComment() { |
|
|
if (!viewModel.hasPk() || !viewModel.getMedia().isCommentLikesEnabled()) { |
|
|
|
|
|
|
|
|
if (!viewModel.hasPk() || viewModel.getMedia().isCommentsDisabled()) { |
|
|
binding.comment.setVisibility(View.GONE); |
|
|
binding.comment.setVisibility(View.GONE); |
|
|
binding.commentsCount.setVisibility(View.GONE); |
|
|
binding.commentsCount.setVisibility(View.GONE); |
|
|
return; |
|
|
return; |
|
@ -577,12 +577,14 @@ public class PostViewV2Fragment extends SharedElementTransitionDialogFragment im |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void setupLike() { |
|
|
private void setupLike() { |
|
|
|
|
|
/* |
|
|
final boolean likableMedia = viewModel.hasPk() && viewModel.getMedia().isCommentLikesEnabled(); |
|
|
final boolean likableMedia = viewModel.hasPk() && viewModel.getMedia().isCommentLikesEnabled(); |
|
|
if (!likableMedia) { |
|
|
if (!likableMedia) { |
|
|
binding.like.setVisibility(View.GONE); |
|
|
binding.like.setVisibility(View.GONE); |
|
|
binding.likesCount.setVisibility(View.GONE); |
|
|
binding.likesCount.setVisibility(View.GONE); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
*/ |
|
|
if (!viewModel.isLoggedIn()) { |
|
|
if (!viewModel.isLoggedIn()) { |
|
|
binding.like.setVisibility(View.GONE); |
|
|
binding.like.setVisibility(View.GONE); |
|
|
return; |
|
|
return; |
|
|