-
Notifications
You must be signed in to change notification settings - Fork 0
✨ Add generic settings panel #17
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
Conversation
julianharty
left a comment
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.
Overall the code looks OK to merge. I've provided various comments mainly as I'm thinking ahead for how this app might be used by manufacturers and by end-users. Once you've read them you can action any that are worth addressing before merging; some of the others might be worth writing up as github issues.
|
|
||
| Box( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| ) { |
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.
These previous 3 lines look unnecessarily spread out; is there a reason why they're not on the same line?
| Text( | ||
| text = value, | ||
| color = Color.White, | ||
| color = if (isSelected) Color(0xFFFFCC00) else Color.White, |
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.
Presumably hard-coded colours are good enough for the moment? Would either of these colours ever change e.g. if the user has their device set to high-contrast mode?
| y = visibleRegion!!.top.dp | ||
| ) | ||
| .border(2.dp, Color.Yellow) | ||
| .border(2.dp, Color(0xAAFFCC00)) |
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.
Again I'm curious why this is a hard-coded colour...?
| value = null | ||
| clearValueRunnable = null | ||
| } | ||
| handler.postDelayed(clearValueRunnable!!, 5000) |
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.
As part of making the code customisable for various manufacturers to use, how useful would it be to make these sorts of values easy to specify/modify (rather than someone searching through all the code and then editing values as they find them)?
| render = { value, isSelected -> | ||
| Text( | ||
| text = value, | ||
| color = if (isSelected) Color(0xFFFFCC00) else Color.White, |
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.
As per my earlier comment on hard-coding colours.
| } | ||
| } | ||
| } | ||
| } |
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.
Somewhat tongue-in-cheek, 9 levels of nesting seems excessive. Of course, the code needs each of these closing braces, I'm more curious why we end up so deeply nested to provide the functionality.
| showSettingsTray = true | ||
| }, | ||
| modifier = Modifier | ||
| .size(34.dp) |
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.
This and similar values seem ripe for someone wanting to twiddle with them to make the UI work on various screen resolutions and devices, yet they're hard-coded.
80fb0da to
95acdc7
Compare
A first pass of general settings panel