From 57ffd32c834ff19073c30909e7e24a4d4aa90deb Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Fri, 9 Jul 2021 15:17:32 -0400 Subject: [PATCH] close #1605 --- .../awais/instagrabber/fragments/PostViewV2Fragment.java | 2 ++ .../awais/instagrabber/fragments/StoryViewerFragment.kt | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java index acb1a7e6..8e8f62e5 100644 --- a/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/PostViewV2Fragment.java @@ -755,6 +755,8 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme popupMenu.setOnMenuItemClickListener(item -> { final int itemId = item.getItemId(); if (itemId == R.id.share_dm) { + if (profileModel.isPrivate()) + Toast.makeText(context, R.string.share_private_post, Toast.LENGTH_SHORT).show(); final UserSearchNavGraphDirections.ActionGlobalUserSearch actionGlobalUserSearch = UserSearchFragmentDirections .actionGlobalUserSearch() .setTitle(getString(R.string.share)) diff --git a/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.kt b/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.kt index 897f4746..e255e4a2 100644 --- a/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.kt +++ b/app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.kt @@ -797,6 +797,13 @@ class StoryViewerFragment : Fragment() { } private fun shareStoryViaDm() { + val story = storiesViewModel.getCurrentStory().value ?: return + val context = context + if (story.user?.isPrivate == true && context != null) { + Toast.makeText(context, R.string.share_private_post, Toast.LENGTH_SHORT).show() + } + val actionBar = fragmentActivity.supportActionBar + if (actionBar != null) actionBar.subtitle = null val actionGlobalUserSearch = UserSearchFragmentDirections.actionGlobalUserSearch().apply { title = getString(R.string.share) setActionLabel(getString(R.string.send))