Use onTouchListener to listen for long press on maximize window button
Currently, an onLongPressListener is being used in order to check if a
user long presses the maximize menu button. The issue with this approach
is that we cannot drag the window from the maximize button. So, if a
window is small or is positioned so that only the right edge of the
caption is visible, it would be very hard for the user to drag the task
without accidentally maximizing or opening the maximize window.
In this approach, we use the onTouchListener instead to check if there
is a long press. This way, we can allow the user to drag the task around
if they begin a drag from the maximize menu button and redirect the
touch to the onClickListener or onTouchListener depending on how long
they are holding the button if the task is not dragged.
Bug: 298267890
Test: Drag a task using maximize menu button
Change-Id: I96eaba90b137f65cf201654433a0d12ed6fe69bb
4 files changed