Skip to content

Conversation

@ISNIT0
Copy link
Member

@ISNIT0 ISNIT0 commented Jan 11, 2025

A first pass of general settings panel

Copy link
Collaborator

@julianharty julianharty left a 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(),
) {
Copy link
Collaborator

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,
Copy link
Collaborator

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))
Copy link
Collaborator

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)
Copy link
Collaborator

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,
Copy link
Collaborator

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.

}
}
}
}
Copy link
Collaborator

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)
Copy link
Collaborator

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.

@ISNIT0 ISNIT0 force-pushed the ISNIT0/settings-panel branch from 80fb0da to 95acdc7 Compare January 13, 2025 19:46
@ISNIT0 ISNIT0 merged commit 25b490b into main Jan 13, 2025
2 checks passed
@julianharty julianharty deleted the ISNIT0/settings-panel branch February 24, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants