Skip to content

Commit

Permalink
[新增]标题及副标题长按复制。
Browse files Browse the repository at this point in the history
  • Loading branch information
YenalyLiew committed Mar 19, 2024
1 parent edc04a8 commit 8ea5a9c
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ class VideoIntroductionFragment :
binding.relatedHanime.title.setText(R.string.related_video)
binding.tags.lifecycle = viewLifecycleOwner.lifecycle

// #issue-80: 长按复制功能请求
binding.title.setOnLongClickListener {
binding.title.text.copyToClipboard()
showShortToast(R.string.copy_to_clipboard)
return@setOnLongClickListener true
}
binding.chineseTitle.setOnLongClickListener {
binding.chineseTitle.text.copyToClipboard()
showShortToast(R.string.copy_to_clipboard)
return@setOnLongClickListener true
}

binding.relatedHanime.rv.layoutManager =
FixedGridLayoutManager(context, VIDEO_IN_ONE_LINE)
binding.playlist.rv.layoutManager =
Expand Down Expand Up @@ -258,7 +270,7 @@ class VideoIntroductionFragment :
shareText(shareText, "長按分享可以複製到剪貼簿中")
}
binding.btnShare.setOnLongClickListener {
copyTextToClipboard(shareText)
shareText.copyToClipboard()
showShortToast(R.string.copy_to_clipboard)
return@setOnLongClickListener true
}
Expand Down

0 comments on commit 8ea5a9c

Please sign in to comment.