Provide mime type to file picker to gray out unselectable files#6820
Provide mime type to file picker to gray out unselectable files#6820TobiGr merged 1 commit intoTeamNewPipe:devfrom
Conversation
app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionsImportFragment.java
Show resolved
Hide resolved
|
Werks. 🎉 Damn that is so much more convenient. |
|
@TobiGr this should also be safe to merge :-) |
TobiGr
left a comment
There was a problem hiding this comment.
Oh yes, I reviewed this but forgot to approve it...
|
For some reason this doesn't work for me, I'm on 0.21.13 and all the files are greyed out including the json file containing an export of my subscriptions. |
|
For some reason, by converting the file to |
|
Importing one's settings from a zip file works though. |
|
According to this: the problem is that android doesn't support the json mime type: https://stackoverflow.com/a/58104204/11748992 And looking at the latest android source code it seems it still doesn't support it now. |
I think that's expected? |
|
? To be clear
The file is just not selectable, the fact there's this workaround, is irrelevant. I only mentioned it as I was trying to understand what was going on. Now we know the reason it doesn't work: Android doesn't support the JSON MIME type. |
|
Ah, yeah, I misread your comment. |
|
Created a separate issue for it: #7326 |
What is it?
Description of the changes in your PR
This PR just adds a mime type to all
getPickercalls. When using SAF now, each time the app will want to open a file (to import the database or subscriptions), all files with the incorrect file format will be grayed out. So the database import picker will only let.zipbe selected and the subscription import picker will only let.jsonbe selected. The service-specific subscription imports, though, still have*/*as mime type as the extension of those files could be subject to change and is different between services.Before/After Screenshots/Screen Record
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. @opusforlife2
Due diligence