Android: Remove unused QtLayout.TouchListener

Now that QtWindow extends QtLayout again, the touch listener interface
is unused as QtWindow can directly handle the touch events.

Change-Id: Ic58b5ab7644ffb3a60833b6507115b20db3f29de
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0ae95cb1f72782d5890f34c00b91eed15936ad29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tinja Paavoseppä 2024-02-07 11:17:22 +02:00 committed by Qt Cherry-pick Bot
parent ceae81f5d9
commit 93aa5ceeff
2 changed files with 1 additions and 38 deletions

View File

@ -16,25 +16,11 @@ import android.view.ViewGroup;
class QtLayout extends ViewGroup {
interface QtTouchListener {
public boolean onTouchEvent(MotionEvent event);
public boolean onTrackballEvent(MotionEvent event);
public boolean onGenericMotionEvent(MotionEvent event);
}
private QtTouchListener m_touchListener;
public QtLayout(Context context)
{
super(context);
}
public QtLayout(Context context, QtTouchListener listener)
{
super(context);
m_touchListener = listener;
}
public QtLayout(Context context, AttributeSet attrs)
{
super(context, attrs);
@ -45,30 +31,6 @@ class QtLayout extends ViewGroup {
super(context, attrs, defStyle);
}
@Override
public boolean onTouchEvent(MotionEvent event)
{
if (m_touchListener != null) {
event.setLocation(event.getX() + getX(), event.getY() + getY());
return m_touchListener.onTouchEvent(event);
}
return false;
}
@Override
public boolean onTrackballEvent(MotionEvent event)
{;
if (m_touchListener != null)
return m_touchListener.onTrackballEvent(event);
return false;
}
@Override
public boolean onGenericMotionEvent(MotionEvent event)
{
if (m_touchListener != null)
return m_touchListener.onGenericMotionEvent(event);
return false;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{

View File

@ -59,6 +59,7 @@ public class QtWindow extends QtLayout implements QtSurfaceInterface {
@Override
public boolean onTouchEvent(MotionEvent event)
{
event.setLocation(event.getX() + getX(), event.getY() + getY());
QtInputDelegate.sendTouchEvent(event, getId());
m_gestureDetector.onTouchEvent(event);
return true;