-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compat Locale.forLanguageTag() implementation. #910
Add compat Locale.forLanguageTag() implementation. #910
Conversation
Does the extractor also require API level 21 too? |
At the moment it requires API level 19 (due to using the |
Then this PR would raise that requirement to 21, right? Do we want that? |
I don't think so, as some apps use the extractor on lower APIs, such as SkyTube. The question is: does this method would be available with the desugar library based on Java 11? |
Oh, right. In that case, changes will need to be made as
Probably? I checked using the Android Studio preview and it didn't seem to be available. I created an issue for it a while ago: https://issuetracker.google.com/issues/171182330 |
4972fcd
to
375fd33
Compare
375fd33
to
b90a566
Compare
If I understand correctly, the purpose of this PR is actually to prevent raising the requirement to 21, while being able to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks almost good to me, thanks! @AudricV also merge if you want (feel free to ask me to stop pinging you on each extractor PR I approve ;-) )
extractor/src/main/java/org/schabi/newpipe/extractor/stream/SubtitlesStream.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/utils/LocaleCompat.java
Outdated
Show resolved
Hide resolved
extractor/src/main/java/org/schabi/newpipe/extractor/utils/LocaleCompat.java
Outdated
Show resolved
Hide resolved
The idea was to eventually switch to |
a59bfd3
to
9c2fc67
Compare
I think it's better if you avoid reflection. We can use our own implementation until the real one becomes available |
af07f68
to
9c2fc67
Compare
extractor/src/main/java/org/schabi/newpipe/extractor/utils/LocaleCompat.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, checkstyle is failing
9c2fc67
to
3b80547
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now!
Add a simple
Locale.forLanguageTag()
implementation, as the actual method is not available on API levels below 21.