removing some more scaling related redundant code

This commit is contained in:
tibbi 2019-01-15 16:21:45 +01:00
parent 7e7ef2063e
commit e9cbf444e1
3 changed files with 12 additions and 42 deletions

View File

@ -761,9 +761,6 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
}
}
MotionEvent.ACTION_UP -> {
val diffX = mTouchDownX - event.x
val diffY = mTouchDownY - event.y
mIgnoreCloseDown = false
if (mIsDragged) {
if (mIsFullscreen) {
@ -816,22 +813,13 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
mMatrix.postScale(scaleFactor, scaleFactor, detector.focusX, detector.focusY)
if (scaleFactor < 1) {
mMatrix.getValues(mMatrices)
val x = mMatrices[Matrix.MTRANS_X]
val y = mMatrices[Matrix.MTRANS_Y]
if (scaleFactor < 1) {
if (width > 0) {
if (y < -mBottom) {
mMatrix.postTranslate(0f, -(y + mBottom))
} else if (y > 0) {
mMatrix.postTranslate(0f, -y)
}
} else {
if (x < -mRight) {
mMatrix.postTranslate(-(x + mRight), 0f)
} else if (x > 0) {
mMatrix.postTranslate(-x, 0f)
}
}
}
}
return true

View File

@ -800,22 +800,13 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
mMatrix.postScale(scaleFactor, scaleFactor, detector.focusX, detector.focusY)
if (scaleFactor < 1) {
mMatrix.getValues(mMatrices)
val x = mMatrices[Matrix.MTRANS_X]
val y = mMatrices[Matrix.MTRANS_Y]
if (scaleFactor < 1) {
if (width > 0) {
if (y < -mBottom) {
mMatrix.postTranslate(0f, -(y + mBottom))
} else if (y > 0) {
mMatrix.postTranslate(0f, -y)
}
} else {
if (x < -mRight) {
mMatrix.postTranslate(-(x + mRight), 0f)
} else if (x > 0) {
mMatrix.postTranslate(-x, 0f)
}
}
}
}
return true

View File

@ -155,22 +155,13 @@ class MyZoomableGifTextureView(context: Context, attrs: AttributeSet) : GifTextu
mMatrix.postScale(scaleFactor, scaleFactor, detector.focusX, detector.focusY)
if (scaleFactor < 1) {
mMatrix.getValues(mMatrices)
val x = mMatrices[Matrix.MTRANS_X]
val y = mMatrices[Matrix.MTRANS_Y]
if (scaleFactor < 1) {
if (width > 0) {
if (y < -mBottom) {
mMatrix.postTranslate(0f, -(y + mBottom))
} else if (y > 0) {
mMatrix.postTranslate(0f, -y)
}
} else {
if (x < -mRight) {
mMatrix.postTranslate(-(x + mRight), 0f)
} else if (x > 0) {
mMatrix.postTranslate(-x, 0f)
}
}
}
}
return true