Merge "Fix multi-toggle flicker bug" into main
This commit is contained in:
@@ -58,6 +58,8 @@ class BluetoothDeviceDetailsViewModel(
|
|||||||
deviceSettingRepository.getDeviceSettingsConfig(cachedDevice)
|
deviceSettingRepository.getDeviceSettingsConfig(cachedDevice)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val spatialAudioModel by lazy { spatialAudioInteractor.getDeviceSetting(cachedDevice) }
|
||||||
|
|
||||||
suspend fun getItems(fragment: FragmentTypeModel): List<DeviceSettingConfigItemModel>? =
|
suspend fun getItems(fragment: FragmentTypeModel): List<DeviceSettingConfigItemModel>? =
|
||||||
when (fragment) {
|
when (fragment) {
|
||||||
is FragmentTypeModel.DeviceDetailsMainFragment -> items.await()?.mainItems
|
is FragmentTypeModel.DeviceDetailsMainFragment -> items.await()?.mainItems
|
||||||
@@ -81,7 +83,7 @@ class BluetoothDeviceDetailsViewModel(
|
|||||||
}
|
}
|
||||||
return when (settingId) {
|
return when (settingId) {
|
||||||
DeviceSettingId.DEVICE_SETTING_ID_SPATIAL_AUDIO_MULTI_TOGGLE ->
|
DeviceSettingId.DEVICE_SETTING_ID_SPATIAL_AUDIO_MULTI_TOGGLE ->
|
||||||
spatialAudioInteractor.getDeviceSetting(cachedDevice)
|
spatialAudioModel
|
||||||
else -> deviceSettingRepository.getDeviceSetting(cachedDevice, settingId)
|
else -> deviceSettingRepository.getDeviceSetting(cachedDevice, settingId)
|
||||||
}.map { it?.toPreferenceModel() }
|
}.map { it?.toPreferenceModel() }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user