SearchStatusesFragment: fix reply to

main
Alibek Omarov 4 years ago
parent 4df757b4b3
commit f1397f3378
  1. 12
      app/src/main/java/com/keylesspalace/tusky/components/search/fragments/SearchStatusesFragment.kt

@ -195,6 +195,10 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
} }
} }
private fun onShowReplyTo(replyToId: String) {
bottomSheetActivity?.viewThread(replyToId, null)
}
companion object { companion object {
fun newInstance() = SearchStatusesFragment() fun newInstance() = SearchStatusesFragment()
} }
@ -268,6 +272,10 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
} }
openAsItem.title = openAsTitle openAsItem.title = openAsTitle
if(status.inReplyToId == null) {
popup.menu.findItem(R.id.status_reply_to)?.isVisible = false
}
popup.setOnMenuItemClickListener { item -> popup.setOnMenuItemClickListener { item ->
when (item.itemId) { when (item.itemId) {
R.id.status_share_content -> { R.id.status_share_content -> {
@ -301,6 +309,10 @@ class SearchStatusesFragment : SearchFragment<Pair<Status, StatusViewData.Concre
LinkHelper.openLinkInBrowser(Uri.parse(statusUrl), context); LinkHelper.openLinkInBrowser(Uri.parse(statusUrl), context);
return@setOnMenuItemClickListener true return@setOnMenuItemClickListener true
} }
R.id.status_reply_to -> {
onShowReplyTo(status.inReplyToId!!)
return@setOnMenuItemClickListener true
}
R.id.status_open_as -> { R.id.status_open_as -> {
showOpenAsDialog(statusUrl!!, item.title) showOpenAsDialog(statusUrl!!, item.title)
return@setOnMenuItemClickListener true return@setOnMenuItemClickListener true

Loading…
Cancel
Save