Merge pull request #12720 from t895/return-to-global

android: Change "Clear" to "Use global setting" for per-game settings
This commit is contained in:
liamwhite 2024-01-20 13:56:31 -05:00 committed by GitHub
commit 93a3342841
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 10 deletions

View file

@ -75,7 +75,7 @@ class DriverManagerFragment : Fragment() {
driverViewModel.showClearButton(!StringSetting.DRIVER_PATH.global) driverViewModel.showClearButton(!StringSetting.DRIVER_PATH.global)
binding.toolbarDrivers.setOnMenuItemClickListener { binding.toolbarDrivers.setOnMenuItemClickListener {
when (it.itemId) { when (it.itemId) {
R.id.menu_driver_clear -> { R.id.menu_driver_use_global -> {
StringSetting.DRIVER_PATH.global = true StringSetting.DRIVER_PATH.global = true
driverViewModel.updateDriverList() driverViewModel.updateDriverList()
(binding.listDrivers.adapter as DriverAdapter) (binding.listDrivers.adapter as DriverAdapter)
@ -93,7 +93,7 @@ class DriverManagerFragment : Fragment() {
repeatOnLifecycle(Lifecycle.State.STARTED) { repeatOnLifecycle(Lifecycle.State.STARTED) {
driverViewModel.showClearButton.collect { driverViewModel.showClearButton.collect {
binding.toolbarDrivers.menu binding.toolbarDrivers.menu
.findItem(R.id.menu_driver_clear).isVisible = it .findItem(R.id.menu_driver_use_global).isVisible = it
} }
} }
} }

View file

@ -69,7 +69,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:visibility="gone" android:visibility="gone"
android:text="@string/clear" android:text="@string/use_global_setting"
tools:visibility="visible" /> tools:visibility="visible" />
</LinearLayout> </LinearLayout>

View file

@ -63,7 +63,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/clear" android:text="@string/use_global_setting"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible" /> tools:visibility="visible" />

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:app="http://schemas.android.com/apk/res-auto">
<item <item
android:id="@+id/menu_driver_clear" android:id="@+id/menu_driver_use_global"
android:icon="@drawable/ic_clear" android:title="@string/use_global_setting" />
android:title="@string/clear"
app:showAsAction="always" />
</menu> </menu>

View file

@ -287,6 +287,7 @@
<string name="notice">Notice</string> <string name="notice">Notice</string>
<string name="import_complete">Import complete</string> <string name="import_complete">Import complete</string>
<string name="more_options">More options</string> <string name="more_options">More options</string>
<string name="use_global_setting">Use global setting</string>
<!-- GPU driver installation --> <!-- GPU driver installation -->
<string name="select_gpu_driver">Select GPU driver</string> <string name="select_gpu_driver">Select GPU driver</string>