-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: SettingsFragment to compose #1516
base: master
Are you sure you want to change the base?
Conversation
…stic-Android into settings_refactor
Thanks for your contribution! As a general guideline, we want to follow the design of a traditional Settings/Preference screen, making use of our existing "Preference" components (like SwitchPreference and DropdownPreference). The BLE/TCP/Serial device scan/selection could probably move to an item in the Settings screen to maintain a cleaner layout, but open to ideas and suggestions on how best to organize this. Items currently in the overflow menu, like Theme and Language, will also be moved into this screen in the future. |
devices.value = mutableMapOf<String, DeviceListEntry>().apply { | ||
fun addDevice(entry: DeviceListEntry) { this[entry.fullAddress] = entry } | ||
suspend fun addDevice(entry: DeviceListEntry) { | ||
_uiState.emit(uiState.value.copy(devices = uiState.value.devices + (entry.fullAddress to entry))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use MutableStateFlow .update {}
instead of .emit
SettingsFragment
to Compose #1432This pr is a refactor of
SettingsFragment
toSettingsScreen
in composeStill in draft phase, almost complete, feel free to review, suggest edits and bug fixes