-
Notifications
You must be signed in to change notification settings - Fork 29
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
[IMPROVEMENT] Introduce Storage Access Framework #172
Comments
You may want to look at this stale branch from Clover by the way, Floens was trying to do this a while ago. https://github.com/Floens/Clover/tree/external-storage-support |
Thanks. I see there is a lot of code to handle SAF on both pre and post lollipop devices. Since we don't support pre lollipop devices we don't need that and it makes things a little bit easier. Btw, I already have SAF support for importing/exporting settings and file cache. What is left is thread saving, but it is not merged yet, and I guess that's it (Maybe I forgot something). |
Now ExternalFiles uses DocumentFile().listFiles() to find a file inside a directory. It's implemented this way because, apparently, it's the only way to get a fully working DocumentFile that supports such operations as exists(), getName(), canRead()/canWrite(), delete() etc and which getParent() returns an actual file and not the null. This slow, but I don't know another way to do this so that everything works as expected.
…a SAF) Bring back SaveLocationController so that people can choose whether they want to use SAF or not (or in case of a bug)
… sub directories (site name/board code/boar AbstractFile.findFile() now returns a new AbstractFile instead of DocumentFile Fix RawFile.createNew() which would create a file when it should create directory Implement RawFile.findFile()
Fix file/directory choosers would not remove the callback from the callback map when we have no activity to handle our intent. Also no message would have been shown in such case. Give the use a choice when exporting settings whether he wants to open an existing settings file to overwrite it or create a new separate file.
Separate local threads download directory from the save location (app base dir) directory. Basically user can now choose separate directories where images or local threads will be stored (both work with SAF and the old API). Make ThreadSaveManager work with AbstractFile instead of ExternalFile so that the user can decide for themselves whether to use SAF or the old API. Local threads now work with AbstractFiles. Some classes had to be changed to use RawFile instead of simple File. Convert couple of classes to Kotlin. More tests for the testMethod.
…created because it has no extension
Fix Uri segments not being encoded when appended
…it breaks the app and don't test anything useful)
…-framework # Conflicts: # Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/repository/ImportExportRepository.java # Kuroba/app/src/main/res/values/strings.xml # Kuroba/build.gradle
…ectory to another Basically, when a user want to change a local threads directory to another one (let's say they had it on sd-card and then bought another one and want to use it from now on). This is kinda working but it's fucking hacky and some parts of it are really slow. Fixed a bug with save thread icon being set to the default state when it should be set to stopped state
…lshit a little bit more gracefully, called Fuck Storage Access Framework Fuck Storage Access Framework
…ped in the database when stopping it by clicking the "save thread" button
Add ability to delete old base directory after moving files into the new one Small fixes for thread album downloading where folder and file names would not be sanitized
…to (#172)-storage-access-framework # Conflicts: # Kuroba/app/build.gradle # README.md
…n the paths thus resulting in losing the sub directories Fix shared_prefs importing/exporting for dev builds (wrong appId was used) Extract MediaSettingsControllerCallbacks into it's own class to avoid compilation errors
Additional active local threads checks before allowing the user to change base dir for local threads Some strings that were forgotten about were moved to resources
…tempts to export a directory path that is located in a directory using SAF
So we can have the SD Card support and to prepare for the future Android R release where they introduce the Scoped Storage which will break everything for us. Also to refactor the file manipulation to use SAF. At least for saving threads/images/other files that take space.
Gonna implement it myself.
The text was updated successfully, but these errors were encountered: