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:
parent
ceae81f5d9
commit
93aa5ceeff
@ -16,25 +16,11 @@ import android.view.ViewGroup;
|
|||||||
|
|
||||||
class QtLayout extends 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)
|
public QtLayout(Context context)
|
||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public QtLayout(Context context, QtTouchListener listener)
|
|
||||||
{
|
|
||||||
super(context);
|
|
||||||
m_touchListener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public QtLayout(Context context, AttributeSet attrs)
|
public QtLayout(Context context, AttributeSet attrs)
|
||||||
{
|
{
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
@ -45,30 +31,6 @@ class QtLayout extends ViewGroup {
|
|||||||
super(context, attrs, defStyle);
|
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
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
|
||||||
{
|
{
|
||||||
|
@ -59,6 +59,7 @@ public class QtWindow extends QtLayout implements QtSurfaceInterface {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event)
|
public boolean onTouchEvent(MotionEvent event)
|
||||||
{
|
{
|
||||||
|
event.setLocation(event.getX() + getX(), event.getY() + getY());
|
||||||
QtInputDelegate.sendTouchEvent(event, getId());
|
QtInputDelegate.sendTouchEvent(event, getId());
|
||||||
m_gestureDetector.onTouchEvent(event);
|
m_gestureDetector.onTouchEvent(event);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user