paraphrase
paraphrase copied to clipboard
Model token formats supported in newer Android API levels
- In API 29, Android uses ICU version 63.2 whose
MessageFormatsupports the skeleton text format of its newNumberFormatterclass for thenumbertype. - In API 30, Android uses ICU version 66.1 whose
MessageFormatsupports skeleton text format viaDateFormat.getInstanceForSkeletonfor thedatetype.
If you use these types, we should emit @RequiresApi(29/30) on the resulting functions.
DateFormat.getInstanceForSkeleton has been around since API 24. Does MessageFormat just not use it in APIs 24-29?
Can confirm a literal :: is printed on APIs 24-29.
Yeah I was just going on the docs. I did not test anything.
We'll need to check whether the resource containing :: has OS level variants. E.g. if somebody has:
values/strings.xml:
<string name="foo">{date, date, yyyy-MM-dd}</string>
values-v30/strings.xml:
<string name="foo">{date, date, ::yyyy-MM-dd}</string>
then they shouldn't get a @RequiresApi annotation.