codeslubber
05/01/2020, 12:13 AMLeland Richardson [G]
05/01/2020, 12:35 AMif (tooSmall(currentConfiguration)) {
MySmallSliderAlternative(...)
} else {
Slider(...)
}
Leland Richardson [G]
05/01/2020, 12:35 AMcurrentConfiguration.screenWidth
for instanceLeland Richardson [G]
05/01/2020, 12:37 AMWithConstraints {
if (it.maxWidth < MIN_SLIDER_SIZE) {
MySmallSliderAlternative(...)
} else {
Slider(...)
}
}
codeslubber
05/01/2020, 1:21 AMcodeslubber
05/01/2020, 2:13 AMZach Klippenstein (he/him) [MOD]
05/01/2020, 5:06 AMdp
units it should be density-independent. Most composables also use Dp
for dimensions as well. If it's a screen size issue, you don't necessarily need to duplicate the whole layout, you can just redefine the dimension resource values.romainguy
05/01/2020, 6:36 AMromainguy
05/01/2020, 6:36 AMromainguy
05/01/2020, 6:37 AMromainguy
05/01/2020, 6:37 AMLeland Richardson [G]
05/01/2020, 4:06 PMcodeslubber
05/01/2020, 6:09 PMLeland Richardson [G]
05/01/2020, 6:12 PMcodeslubber
05/01/2020, 7:30 PMLeland Richardson [G]
05/01/2020, 7:48 PMromainguy
05/01/2020, 7:55 PMromainguy
05/01/2020, 7:56 PMcodeslubber
05/01/2020, 8:28 PMLinearLayout
code predates ConstraintLayout
and I did think about porting the view to CL, one of the documents seemed to imply that you would get a better result in adapting to a larger screen, but if itās just doing it based on pixel density not clear how that would be.
@Leland Richardson [G] will for sure do that when I try it in compose!codeslubber
05/01/2020, 8:29 PM