Open JakeWharton opened 1 year ago
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.
MessageFormat
supports the skeleton text format of its newNumberFormatter
class for thenumber
type.MessageFormat
supports skeleton text format viaDateFormat.getInstanceForSkeleton
for thedate
type.If you use these types, we should emit
@RequiresApi(29/30)
on the resulting functions.