Renaming some methods to be more concise

This commit is contained in:
Maxime Naturel 2022-02-23 11:34:32 +01:00
parent 6899b5b637
commit 042c57f9b8
3 changed files with 6 additions and 6 deletions

View File

@ -17,8 +17,8 @@
package im.vector.app.features.media package im.vector.app.features.media
interface AttachmentInteractionListener { interface AttachmentInteractionListener {
fun onDismissTapped() fun onDismiss()
fun onShareTapped() fun onShare()
fun onPlayPause(play: Boolean) fun onPlayPause(play: Boolean)
fun videoSeekTo(percent: Int) fun videoSeekTo(percent: Int)
} }

View File

@ -49,10 +49,10 @@ class AttachmentOverlayView @JvmOverloads constructor(
views = MergeImageAttachmentOverlayBinding.bind(this) views = MergeImageAttachmentOverlayBinding.bind(this)
setBackgroundColor(Color.TRANSPARENT) setBackgroundColor(Color.TRANSPARENT)
views.overlayBackButton.setOnClickListener { views.overlayBackButton.setOnClickListener {
interactionListener?.onDismissTapped() interactionListener?.onDismiss()
} }
views.overlayShareButton.setOnClickListener { views.overlayShareButton.setOnClickListener {
interactionListener?.onShareTapped() interactionListener?.onShare()
} }
views.overlayPlayPauseButton.setOnClickListener { views.overlayPlayPauseButton.setOnClickListener {
interactionListener?.onPlayPause(!isPlaying) interactionListener?.onPlayPause(!isPlaying)

View File

@ -241,7 +241,7 @@ class VectorAttachmentViewerActivity : AttachmentViewerActivity(), AttachmentInt
* Specialization AttachmentInteractionListener * Specialization AttachmentInteractionListener
* ========================================================================================== */ * ========================================================================================== */
override fun onDismissTapped() { override fun onDismiss() {
animateClose() animateClose()
} }
@ -255,7 +255,7 @@ class VectorAttachmentViewerActivity : AttachmentViewerActivity(), AttachmentInt
// TODO add save feature for image => check it works for video as well, // TODO add save feature for image => check it works for video as well,
// check if it is already possible to save from menu with long press on video // check if it is already possible to save from menu with long press on video
override fun onShareTapped() { override fun onShare() {
// TODO the opening of share bottom sheet is extremely slow // TODO the opening of share bottom sheet is extremely slow
// move the retrieve of the file into ViewModel and use a ViewEvent to call shareMedia // move the retrieve of the file into ViewModel and use a ViewEvent to call shareMedia
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {