paraphrase icon indicating copy to clipboard operation
paraphrase copied to clipboard

Model token formats supported in newer Android API levels

Open JakeWharton opened this issue 2 years ago • 4 comments

If you use these types, we should emit @RequiresApi(29/30) on the resulting functions.

JakeWharton avatar Jan 17 '23 21:01 JakeWharton

DateFormat.getInstanceForSkeleton has been around since API 24. Does MessageFormat just not use it in APIs 24-29?

drewhamilton avatar Feb 17 '23 18:02 drewhamilton

Can confirm a literal :: is printed on APIs 24-29.

drewhamilton avatar Feb 18 '23 00:02 drewhamilton

Yeah I was just going on the docs. I did not test anything.

JakeWharton avatar Feb 18 '23 02:02 JakeWharton

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.

drewhamilton avatar Feb 28 '23 00:02 drewhamilton