reset some values at touch events
This commit is contained in:
parent
d39d81b025
commit
2508e59a27
|
@ -201,6 +201,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startHandlingTouches(touchDownY: Int) {
|
fun startHandlingTouches(touchDownY: Int) {
|
||||||
|
mLongPressedIcon = null
|
||||||
mTouchDownY = touchDownY
|
mTouchDownY = touchDownY
|
||||||
mCurrentFragmentY = all_apps_fragment.y.toInt()
|
mCurrentFragmentY = all_apps_fragment.y.toInt()
|
||||||
mIgnoreUpEvent = false
|
mIgnoreUpEvent = false
|
||||||
|
@ -294,6 +295,7 @@ class MainActivity : SimpleActivity(), FlingListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
setOnDismissListener {
|
setOnDismissListener {
|
||||||
|
mOpenPopupMenu = null
|
||||||
(all_apps_fragment as AllAppsFragment).ignoreTouches = false
|
(all_apps_fragment as AllAppsFragment).ignoreTouches = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ class AllAppsFragment(context: Context, attributeSet: AttributeSet) : MyFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
var shouldIntercept = false
|
var shouldIntercept = false
|
||||||
|
|
||||||
|
// pull the whole fragment down if it is scrolled way to the top and the users pulls it even further
|
||||||
if (touchDownY != -1) {
|
if (touchDownY != -1) {
|
||||||
shouldIntercept = touchDownY - event.y < 0 && all_apps_grid.computeVerticalScrollOffset() == 0
|
shouldIntercept = touchDownY - event.y < 0 && all_apps_grid.computeVerticalScrollOffset() == 0
|
||||||
if (shouldIntercept) {
|
if (shouldIntercept) {
|
||||||
|
|
Loading…
Reference in New Issue