mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #9217 from JosJuice/android-touch-checks
Android: Remove some touchscreen checks from EmulationActivity
This commit is contained in:
@ -73,7 +73,6 @@ public final class EmulationActivity extends AppCompatActivity
|
|||||||
|
|
||||||
private Settings mSettings;
|
private Settings mSettings;
|
||||||
|
|
||||||
private boolean mDeviceHasTouchScreen;
|
|
||||||
private boolean mMenuVisible;
|
private boolean mMenuVisible;
|
||||||
|
|
||||||
private static boolean sIgnoreLaunchRequests = false;
|
private static boolean sIgnoreLaunchRequests = false;
|
||||||
@ -229,7 +228,6 @@ public final class EmulationActivity extends AppCompatActivity
|
|||||||
|
|
||||||
updateOrientation();
|
updateOrientation();
|
||||||
|
|
||||||
mDeviceHasTouchScreen = getPackageManager().hasSystemFeature("android.hardware.touchscreen");
|
|
||||||
mMotionListener = new MotionListener(this);
|
mMotionListener = new MotionListener(this);
|
||||||
|
|
||||||
// Set these options now so that the SurfaceView the game renders into is the right size.
|
// Set these options now so that the SurfaceView the game renders into is the right size.
|
||||||
@ -311,8 +309,7 @@ public final class EmulationActivity extends AppCompatActivity
|
|||||||
setTitle(NativeLibrary.GetCurrentTitleDescription());
|
setTitle(NativeLibrary.GetCurrentTitleDescription());
|
||||||
updateMotionListener();
|
updateMotionListener();
|
||||||
|
|
||||||
if (mDeviceHasTouchScreen)
|
mEmulationFragment.refreshInputOverlay();
|
||||||
mEmulationFragment.refreshInputOverlay();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMotionListener()
|
private void updateMotionListener()
|
||||||
@ -1169,7 +1166,6 @@ public final class EmulationActivity extends AppCompatActivity
|
|||||||
|
|
||||||
public void initInputPointer()
|
public void initInputPointer()
|
||||||
{
|
{
|
||||||
if (mDeviceHasTouchScreen)
|
mEmulationFragment.initInputPointer();
|
||||||
mEmulationFragment.initInputPointer();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,22 +124,27 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
|||||||
{
|
{
|
||||||
BooleanSetting.MAIN_SHOW_INPUT_OVERLAY
|
BooleanSetting.MAIN_SHOW_INPUT_OVERLAY
|
||||||
.setBoolean(settings, !BooleanSetting.MAIN_SHOW_INPUT_OVERLAY.getBoolean(settings));
|
.setBoolean(settings, !BooleanSetting.MAIN_SHOW_INPUT_OVERLAY.getBoolean(settings));
|
||||||
mInputOverlay.refreshControls();
|
|
||||||
|
if (mInputOverlay != null)
|
||||||
|
mInputOverlay.refreshControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initInputPointer()
|
public void initInputPointer()
|
||||||
{
|
{
|
||||||
mInputOverlay.initTouchPointer();
|
if (mInputOverlay != null)
|
||||||
|
mInputOverlay.initTouchPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshInputOverlay()
|
public void refreshInputOverlay()
|
||||||
{
|
{
|
||||||
mInputOverlay.refreshControls();
|
if (mInputOverlay != null)
|
||||||
|
mInputOverlay.refreshControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetInputOverlay()
|
public void resetInputOverlay()
|
||||||
{
|
{
|
||||||
mInputOverlay.resetButtonPlacement();
|
if (mInputOverlay != null)
|
||||||
|
mInputOverlay.resetButtonPlacement();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -169,19 +174,25 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
|||||||
|
|
||||||
public void startConfiguringControls()
|
public void startConfiguringControls()
|
||||||
{
|
{
|
||||||
getView().findViewById(R.id.done_control_config).setVisibility(View.VISIBLE);
|
if (mInputOverlay != null)
|
||||||
mInputOverlay.setIsInEditMode(true);
|
{
|
||||||
|
requireView().findViewById(R.id.done_control_config).setVisibility(View.VISIBLE);
|
||||||
|
mInputOverlay.setIsInEditMode(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopConfiguringControls()
|
public void stopConfiguringControls()
|
||||||
{
|
{
|
||||||
getView().findViewById(R.id.done_control_config).setVisibility(View.GONE);
|
if (mInputOverlay != null)
|
||||||
mInputOverlay.setIsInEditMode(false);
|
{
|
||||||
|
requireView().findViewById(R.id.done_control_config).setVisibility(View.GONE);
|
||||||
|
mInputOverlay.setIsInEditMode(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isConfiguringControls()
|
public boolean isConfiguringControls()
|
||||||
{
|
{
|
||||||
return mInputOverlay.isInEditMode();
|
return mInputOverlay != null && mInputOverlay.isInEditMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class EmulationState
|
private static class EmulationState
|
||||||
|
Reference in New Issue
Block a user