avoid zooming right after scaling without lifting fingers

This commit is contained in:
tibbi 2020-03-24 15:01:43 +01:00
parent 68ae9ed517
commit e83777cbc3
1 changed files with 8 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.calendar.pro.fragments package com.simplemobiletools.calendar.pro.fragments
import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.content.res.Resources import android.content.res.Resources
import android.graphics.drawable.ColorDrawable import android.graphics.drawable.ColorDrawable
@ -72,6 +73,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
allDayRows.add(HashSet()) allDayRows.add(HashSet())
} }
@SuppressLint("ClickableViewAccessibility")
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
this.inflater = inflater this.inflater = inflater
@ -84,7 +86,12 @@ class WeekFragment : Fragment(), WeeklyCalendar {
val scaleDetector = getViewScaleDetector() val scaleDetector = getViewScaleDetector()
scrollView.setOnTouchListener { view, motionEvent -> scrollView.setOnTouchListener { view, motionEvent ->
scaleDetector.onTouchEvent(motionEvent) scaleDetector.onTouchEvent(motionEvent)
false if (motionEvent.action == MotionEvent.ACTION_UP) {
scrollView.isScrollable = true
true
} else {
false
}
} }
} }
@ -244,11 +251,6 @@ class WeekFragment : Fragment(), WeeklyCalendar {
scaleAtStart = detector.scaleFactor scaleAtStart = detector.scaleFactor
return super.onScaleBegin(detector) return super.onScaleBegin(detector)
} }
override fun onScaleEnd(detector: ScaleGestureDetector) {
scrollView.isScrollable = true
super.onScaleEnd(detector)
}
}) })
} }