Closed knipec closed 2 months ago
Would adjustsFontSizeToFit
work here?
Would
adjustsFontSizeToFit
work here?
It is another option, but I think it looks weird because it could make things that are a higher percent match be a smaller size:
(for reference this is adding adjustsFontSizeToFit numberOfLines={1}
to the Text props)
I think that is a good solution! @CourtneyLee333 what do you say?
Can I see what a single digit percent looks like?
Also, it seems that we could just decrease the font size. We still have the issue of what happens on a small screen with the font size turned up. I'd rather address this particular instance in the context of larger responsive design strategy throughout the app. It's very unlikely, and maybe impossible, for a 100% match to be returned.
Here is an example
Noting that, though we had been told a 100% match would be impossible, it is actually quite common from what we've seen in the app so far.
Perhaps something to think through - do we need to show percentage numbers? Do they help or just make things confusing. We could use a number ranking system instead.
Also seeing "100" with the "%" sign missing (on many lat/longs, including 37.4303, -122.12658) on Android emulator.
I'm don't entirely understand why, but it seems to only happen when the fontSize is 30px.
If I use adjustsFontSizeToFit numberOfLines={1}
, it seems to only happen when the fontSize is 30px or 32px??
-->
FYI I'm reconsidering whether we even want to reveal the percentage numbers, or go back to just showing the rank from 1 - 12. Stay tuned...
We can revisit after Capri. Let's fix the text wrapping for now.
Ok, ended up decreasing font size and using adjustsFontSizeToFit. Closing, as Courtney took a look and approved it on https://github.com/techmatters/terraso-mobile-client/pull/1696
Repro
On certain devices, on the "Soil ID" page, the match percentage on the
SoilMatchTile
will wrap instead of staying on one line, even if there is a reasonable amount of space to accommodate it. It will more likely happen with "100%", but depending on the phone's size settings it may happen with 2-digit numbers as well Decide what layout logic to use to satisfy:Context
Discussion in https://github.com/techmatters/terraso-mobile-client/issues/1197 Potential solution: Instead of a fixed pixel width, use a percent width, or perhaps dp?