fix controller hint

only pops up if controller is connected.

now scrollable

bumped version number
This commit is contained in:
izzy2lost
2025-10-07 03:36:39 -04:00
parent ea581f90bd
commit 0cea21770e
3 changed files with 89 additions and 78 deletions
+3 -2
View File
@@ -11,8 +11,8 @@ android {
applicationId "com.izzy2lost.psx2"
minSdk 26
targetSdk 36
versionCode 3
versionName "1.0.1"
versionCode 4
versionName "1.0.2"
// APK
setProperty("archivesBaseName","PSX2_${versionCode}_${new Date().format('yyyyMMddHHmm')}")
@@ -66,6 +66,7 @@ android {
}
exclude 'META-INF/DEPENDENCIES'
}
buildToolsVersion '36.0.0'
}
tasks.register('bumpVersion') {
@@ -87,6 +87,7 @@ public class MainActivity extends AppCompatActivity implements GamesCoverDialogF
private boolean controllerUiApplied = false;
private AlertDialog mBiosPromptDialog = null;
private boolean mControllerHintShowing = false;
private boolean mPreviousControllerState = false;
private boolean isThread() {
if (mEmulationThread != null) {
@@ -906,10 +907,12 @@ public class MainActivity extends AppCompatActivity implements GamesCoverDialogF
// Hide on-screen touch controls when a physical controller is connected
setControlsVisible(!hasController);
// Show controller hint when no controller is connected (only once)
if (!hasController) {
// Show controller hint when a controller is newly connected
if (hasController && !mPreviousControllerState) {
showControllerHintIfNeeded();
}
mPreviousControllerState = hasController;
}
private int getCurrentRendererPref() {
@@ -1,93 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginBottom="16dp"
android:src="@drawable/stadia_controller_24px"
android:tint="?attr/colorPrimary" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Controller Quick Actions"
android:textSize="18sp"
android:textStyle="bold"
android:gravity="center"
android:layout_marginBottom="12dp"
android:textColor="?android:attr/textColorPrimary" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="When using a controller, press Select + Start together to open the Quick Actions menu for easy access to settings and features."
android:textSize="14sp"
android:gravity="center"
android:layout_marginBottom="16dp"
android:lineSpacingExtra="2dp"
android:textColor="?android:attr/textColorSecondary" />
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="16dp"
android:background="?attr/colorSurfaceVariant"
android:padding="12dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp">
android:orientation="vertical"
android:padding="24dp">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginBottom="16dp"
android:src="@drawable/stadia_controller_24px"
android:tint="?attr/colorPrimary" />
<TextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SELECT"
android:textSize="12sp"
android:text="Controller Quick Actions"
android:textSize="18sp"
android:textStyle="bold"
android:background="?attr/colorPrimary"
android:textColor="?attr/colorOnPrimary"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_marginEnd="8dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginEnd="8dp"
android:gravity="center"
android:layout_marginBottom="12dp"
android:textColor="?android:attr/textColorPrimary" />
<TextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="START"
android:textSize="12sp"
android:textStyle="bold"
android:background="?attr/colorPrimary"
android:textColor="?attr/colorOnPrimary"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp" />
android:text="When using a controller, press Select + Start together to open the Quick Actions menu for easy access to settings and features."
android:textSize="14sp"
android:gravity="center"
android:layout_marginBottom="16dp"
android:lineSpacingExtra="2dp"
android:textColor="?android:attr/textColorSecondary" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="16dp"
android:background="?attr/colorSurfaceVariant"
android:padding="12dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SELECT"
android:textSize="12sp"
android:textStyle="bold"
android:background="?attr/colorPrimary"
android:textColor="?attr/colorOnPrimary"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_marginEnd="8dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginEnd="8dp"
android:textColor="?android:attr/textColorPrimary" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="START"
android:textSize="12sp"
android:textStyle="bold"
android:background="?attr/colorPrimary"
android:textColor="?attr/colorOnPrimary"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/sw_dont_show_again"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Don't show this tip again"
android:textSize="14sp" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/sw_dont_show_again"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Don't show this tip again"
android:textSize="14sp" />
</LinearLayout>
</ScrollView>