Unwanted logs

This commit is contained in:
Valere 2020-07-09 10:16:38 +02:00
parent 868d9cf55c
commit e38cb7c1a6
4 changed files with 12 additions and 15 deletions

View File

@ -18,7 +18,6 @@ package im.vector.riotx.attachmentviewer
import android.graphics.Color
import android.os.Bundle
import android.util.Log
import android.view.GestureDetector
import android.view.MotionEvent
import android.view.ScaleGestureDetector
@ -161,26 +160,26 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi
return true
}
Log.v("ATTACHEMENTS", "================\ndispatchTouchEvent $ev")
// Log.v("ATTACHEMENTS", "================\ndispatchTouchEvent $ev")
handleUpDownEvent(ev)
Log.v("ATTACHEMENTS", "scaleDetector is in progress ${scaleDetector.isInProgress}")
Log.v("ATTACHEMENTS", "pointerCount ${ev.pointerCount}")
Log.v("ATTACHEMENTS", "wasScaled $wasScaled")
// Log.v("ATTACHEMENTS", "scaleDetector is in progress ${scaleDetector.isInProgress}")
// Log.v("ATTACHEMENTS", "pointerCount ${ev.pointerCount}")
// Log.v("ATTACHEMENTS", "wasScaled $wasScaled")
if (swipeDirection == null && (scaleDetector.isInProgress || ev.pointerCount > 1 || wasScaled)) {
wasScaled = true
Log.v("ATTACHEMENTS", "dispatch to pager")
// Log.v("ATTACHEMENTS", "dispatch to pager")
return attachmentPager.dispatchTouchEvent(ev)
}
Log.v("ATTACHEMENTS", "is current item scaled ${isScaled()}")
// Log.v("ATTACHEMENTS", "is current item scaled ${isScaled()}")
return (if (isScaled()) super.dispatchTouchEvent(ev) else handleTouchIfNotScaled(ev)).also {
Log.v("ATTACHEMENTS", "\n================")
// Log.v("ATTACHEMENTS", "\n================")
}
}
private fun handleUpDownEvent(event: MotionEvent) {
Log.v("ATTACHEMENTS", "handleUpDownEvent $event")
// Log.v("ATTACHEMENTS", "handleUpDownEvent $event")
if (event.action == MotionEvent.ACTION_UP) {
handleEventActionUp(event)
}
@ -232,7 +231,7 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi
}
private fun handleTouchIfNotScaled(event: MotionEvent): Boolean {
Log.v("ATTACHEMENTS", "handleTouchIfNotScaled $event")
// Log.v("ATTACHEMENTS", "handleTouchIfNotScaled $event")
directionDetector.handleTouchEvent(event)
return when (swipeDirection) {

View File

@ -78,7 +78,7 @@ class AttachmentsAdapter : RecyclerView.Adapter<BaseViewHolder>() {
attachmentSourceProvider?.loadVideo((holder as VideoViewHolder).target, it)
}
// else -> {
//// }
// // }
}
}
}

View File

@ -16,7 +16,6 @@
package im.vector.riotx.attachmentviewer
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.ProgressBar
@ -115,7 +114,7 @@ class VideoViewHolder constructor(itemView: View) :
val duration = videoView.duration
val progress = videoView.currentPosition
val isPlaying = videoView.isPlaying
Log.v("FOO", "isPlaying $isPlaying $progress/$duration")
// Log.v("FOO", "isPlaying $isPlaying $progress/$duration")
eventListener?.get()?.onEvent(AttachmentEvents.VideoEvent(isPlaying, progress, duration))
}
}

View File

@ -16,7 +16,6 @@
package im.vector.riotx.attachmentviewer
import android.util.Log
import android.view.View
import android.widget.ProgressBar
import com.github.chrisbanes.photoview.PhotoView
@ -30,7 +29,7 @@ class ZoomableImageViewHolder constructor(itemView: View) :
init {
touchImageView.setAllowParentInterceptOnEdge(false)
touchImageView.setOnScaleChangeListener { scaleFactor, _, _ ->
Log.v("ATTACHEMENTS", "scaleFactor $scaleFactor")
// Log.v("ATTACHEMENTS", "scaleFactor $scaleFactor")
// It's a bit annoying but when you pitch down the scaling
// is not exactly one :/
touchImageView.setAllowParentInterceptOnEdge(scaleFactor <= 1.0008f)