mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-02-25 23:35:39 +00:00
Android: Fix possible crash in TouchscreenControllerView
This commit is contained in:
parent
7775774761
commit
2ce9baa8ad
|
@ -44,9 +44,6 @@ public class TouchscreenControllerView extends FrameLayout {
|
||||||
LayoutInflater inflater = LayoutInflater.from(getContext());
|
LayoutInflater inflater = LayoutInflater.from(getContext());
|
||||||
switch (viewType)
|
switch (viewType)
|
||||||
{
|
{
|
||||||
case "none":
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "digital":
|
case "digital":
|
||||||
mMainView = inflater.inflate(R.layout.layout_touchscreen_controller_digital, this, true);
|
mMainView = inflater.inflate(R.layout.layout_touchscreen_controller_digital, this, true);
|
||||||
break;
|
break;
|
||||||
|
@ -59,11 +56,15 @@ public class TouchscreenControllerView extends FrameLayout {
|
||||||
mMainView = inflater.inflate(R.layout.layout_touchscreen_controller_analog_sticks, this, true);
|
mMainView = inflater.inflate(R.layout.layout_touchscreen_controller_analog_sticks, this, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "none":
|
||||||
default:
|
default:
|
||||||
mMainView = null;
|
mMainView = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mMainView == null)
|
||||||
|
return;
|
||||||
|
|
||||||
mMainView.setOnTouchListener((view1, event) -> {
|
mMainView.setOnTouchListener((view1, event) -> {
|
||||||
return handleTouchEvent(event);
|
return handleTouchEvent(event);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue