diff options
Diffstat (limited to 'src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt')
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt index a1fee48cc..15ae3a42b 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/DriverViewModel.kt @@ -9,6 +9,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch @@ -46,6 +47,9 @@ class DriverViewModel : ViewModel() { private val _selectedDriverTitle = MutableStateFlow("") val selectedDriverTitle: StateFlow<String> get() = _selectedDriverTitle + private val _showClearButton = MutableStateFlow(false) + val showClearButton = _showClearButton.asStateFlow() + private val driversToDelete = mutableListOf<String>() init { @@ -60,7 +64,7 @@ class DriverViewModel : ViewModel() { _areDriversLoading.value = false } - private fun updateDriverList() { + fun updateDriverList() { val selectedDriver = GpuDriverHelper.customDriverSettingData val newDriverList = mutableListOf( Driver( @@ -81,6 +85,10 @@ class DriverViewModel : ViewModel() { updateDriverList() } + fun showClearButton(value: Boolean) { + _showClearButton.value = value + } + fun onDriverSelected(position: Int) { if (position == 0) { StringSetting.DRIVER_PATH.setString("") |