From b7892dc781d8ad32ba9851eb03e1703cdf72f6e1 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 25 Jun 2020 17:38:08 +0300 Subject: [PATCH] ViewThreadActivity: move Open in web menu option to status threedots menu --- .../java/com/keylesspalace/tusky/ViewThreadActivity.java | 4 ---- .../components/search/fragments/SearchStatusesFragment.kt | 5 +++++ .../java/com/keylesspalace/tusky/fragment/SFragment.java | 5 +++++ app/src/main/res/menu/status_more.xml | 3 +++ app/src/main/res/menu/status_more_for_user.xml | 3 +++ app/src/main/res/menu/view_thread_toolbar.xml | 4 ---- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java index e2ae63d1..2267dc5b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java @@ -114,10 +114,6 @@ public class ViewThreadActivity extends BottomSheetActivity implements HasAndroi onBackPressed(); return true; } - case R.id.action_open_in_web: { - LinkHelper.openLink(getIntent().getStringExtra(URL_EXTRA), this); - return true; - } case R.id.action_reveal: { fragment.onRevealPressed(); return true; diff --git a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt index 7d91c677..696c78a0 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt @@ -53,6 +53,7 @@ import com.keylesspalace.tusky.entity.Status.Mention import com.keylesspalace.tusky.interfaces.AccountSelectionListener import com.keylesspalace.tusky.interfaces.StatusActionListener import com.keylesspalace.tusky.util.CardViewMode +import com.keylesspalace.tusky.util.LinkHelper import com.keylesspalace.tusky.util.NetworkState import com.keylesspalace.tusky.util.StatusDisplayOptions import com.keylesspalace.tusky.viewdata.AttachmentViewData @@ -296,6 +297,10 @@ class SearchStatusesFragment : SearchFragment { + LinkHelper.openLinkInBrowser(Uri.parse(statusUrl), context); + return@setOnMenuItemClickListener true + } R.id.status_open_as -> { showOpenAsDialog(statusUrl!!, item.title) return@setOnMenuItemClickListener true diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java index a1746e21..7488f8c1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java @@ -62,6 +62,7 @@ import com.keylesspalace.tusky.entity.Status; import com.keylesspalace.tusky.entity.EmojiReaction; import com.keylesspalace.tusky.network.MastodonApi; import com.keylesspalace.tusky.network.TimelineCases; +import com.keylesspalace.tusky.util.LinkHelper; import com.keylesspalace.tusky.viewdata.AttachmentViewData; import com.keylesspalace.tusky.interfaces.StatusActionListener; @@ -320,6 +321,10 @@ public abstract class SFragment extends BaseFragment implements Injectable { clipboard.setPrimaryClip(clip); return true; } + case R.id.status_open_in_web: { + LinkHelper.openLinkInBrowser(Uri.parse(statusUrl), getContext()); + return true; + } case R.id.status_reply_to: { onShowReplyTo(status.getInReplyToId()); return true; diff --git a/app/src/main/res/menu/status_more.xml b/app/src/main/res/menu/status_more.xml index b68e61e4..e2419d23 100644 --- a/app/src/main/res/menu/status_more.xml +++ b/app/src/main/res/menu/status_more.xml @@ -18,6 +18,9 @@ + diff --git a/app/src/main/res/menu/status_more_for_user.xml b/app/src/main/res/menu/status_more_for_user.xml index 1e3d9454..5aa373cb 100644 --- a/app/src/main/res/menu/status_more_for_user.xml +++ b/app/src/main/res/menu/status_more_for_user.xml @@ -21,6 +21,9 @@ + - -