From e38cb7c1a6ced6b7933d14bc0803ee26ce0a3b77 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 9 Jul 2020 10:16:38 +0200 Subject: [PATCH] Unwanted logs --- .../AttachmentViewerActivity.kt | 19 +++++++++---------- .../attachmentviewer/AttachmentsAdapter.kt | 2 +- .../riotx/attachmentviewer/VideoViewHolder.kt | 3 +-- .../ZoomableImageViewHolder.kt | 3 +-- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentViewerActivity.kt b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentViewerActivity.kt index 029064e058..d6cf7c606a 100644 --- a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentViewerActivity.kt +++ b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentViewerActivity.kt @@ -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) { diff --git a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentsAdapter.kt b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentsAdapter.kt index 90020f2cb0..27bdfdc91d 100644 --- a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentsAdapter.kt +++ b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/AttachmentsAdapter.kt @@ -78,7 +78,7 @@ class AttachmentsAdapter : RecyclerView.Adapter() { attachmentSourceProvider?.loadVideo((holder as VideoViewHolder).target, it) } // else -> { -//// } +// // } } } } diff --git a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/VideoViewHolder.kt b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/VideoViewHolder.kt index 2b417baecc..e1a5a9864f 100644 --- a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/VideoViewHolder.kt +++ b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/VideoViewHolder.kt @@ -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)) } } diff --git a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/ZoomableImageViewHolder.kt b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/ZoomableImageViewHolder.kt index aeaf612bbc..3eb06e4c27 100644 --- a/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/ZoomableImageViewHolder.kt +++ b/attachment-viewer/src/main/java/im/vector/riotx/attachmentviewer/ZoomableImageViewHolder.kt @@ -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)