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 0a424601..100f6fbc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/SFragment.java @@ -88,7 +88,7 @@ public abstract class SFragment extends BaseFragment implements Injectable { protected abstract void removeItem(int position); protected abstract void onReblog(final boolean reblog, final int position); - + private BottomSheetActivity bottomSheetActivity; private static List filters; @@ -137,6 +137,10 @@ public abstract class SFragment extends BaseFragment implements Injectable { public void onViewUrl(String url) { bottomSheetActivity.viewUrl(url, PostLookupFallbackBehavior.OPEN_IN_BROWSER); } + + protected void onShowReplyTo(String replyToId) { + bottomSheetActivity.viewThread(replyToId, null); + } protected void reply(Status status) { String inReplyToId = status.getActionableId(); @@ -227,6 +231,12 @@ public abstract class SFragment extends BaseFragment implements Injectable { break; } openAsItem.setTitle(openAsTitle); + + if(status.getInReplyToId() == null) { + MenuItem replyToItem = menu.findItem(R.id.status_reply_to); + + replyToItem.setVisible(false); + } popup.setOnMenuItemClickListener(item -> { switch (item.getItemId()) { @@ -260,6 +270,10 @@ public abstract class SFragment extends BaseFragment implements Injectable { clipboard.setPrimaryClip(clip); return true; } + case R.id.status_reply_to: { + onShowReplyTo(status.getInReplyToId()); + return true; + } case R.id.status_open_as: { showOpenAsDialog(statusUrl, item.getTitle()); return true; diff --git a/app/src/main/res/menu/status_more.xml b/app/src/main/res/menu/status_more.xml index 525ce90a..9c4b0685 100644 --- a/app/src/main/res/menu/status_more.xml +++ b/app/src/main/res/menu/status_more.xml @@ -12,6 +12,9 @@ android:title="@string/status_share_content" /> + @@ -30,4 +33,4 @@ - \ No newline at end of file + 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 9b363e49..3fda3a9c 100644 --- a/app/src/main/res/menu/status_more_for_user.xml +++ b/app/src/main/res/menu/status_more_for_user.xml @@ -12,6 +12,9 @@ android:title="@string/status_share_content" /> + @@ -32,4 +35,4 @@ - \ No newline at end of file + diff --git a/app/src/main/res/values/husky.xml b/app/src/main/res/values/husky.xml index 2b19fed3..e6784b56 100644 --- a/app/src/main/res/values/husky.xml +++ b/app/src/main/res/values/husky.xml @@ -1,5 +1,6 @@ + Reply to Markdown Application name