Skip to content

Releases: anggrayudi/SimpleStorage

0.11.0

21 Jul 18:08
Compare
Choose a tag to compare

Features

  • Added DocumentFile.getFormattedSize() and MediaFile.formattedSize

Breaking Changes

  • Added requiresWriteAccess to:
    • DocumentFileCompat.fromSimplePath()
    • DocumentFileCompat.fromFullPath()
    • DocumentFileCompat.fromFile()

Fixes

  • Android 11 returns RawDocumentFile for DocumentFileCompat.from*(). Fixed by adding requiresWriteAccess.
  • DocumentFile.toTreeDocumentFile() doesn't return null for SingleDocumentFile

0.10.0

14 Jul 16:36
Compare
Choose a tag to compare

Features

  • Supported ComponentActivity (#28).
  • Supported Intent.ACTION_CREATE_DOCUMENT
  • DocumentFile.child() is 36% faster now. It affects the entire library performance, for example mkdirs(), makeFolder(), etc. See this benchmark.

Breaking Changes

  • Removed Dexter because it has been archived. If you're using SimpleStorageHelper and your activities are direct subclass of android.app.Activity, then you need to call onRequestPermissionsResult(). I recommend using ComponentActivity or AppCompatActivity so you don't need to call onRequestPermissionsResult().
  • Removed extension function DocumentFile.doesExist(). Use DocumentFile.child() != null instead.

Fixes

  • DocumentFileCompat.getRootDocumentFile() doesn't return null when the URI permission hasn't been granted yet.

0.9.0

01 Jul 05:28
Compare
Choose a tag to compare

Features

  • Faster in moving files. Thanks to File.moveTo()
  • Added extension functions:
    • File.moveTo()
    • File.inSameMountPointWith()
    • DocumentFile.copyFileToDownloadMedia()
    • DocumentFile.copyFileToPictureMedia()
    • DocumentFile.moveFileToDownloadMedia()
    • DocumentFile.moveFileToPictureMedia()

Breaking Changes

  • Renamed isInSameMountPointWith() to inSameMountPointWith()
  • Removed deprecated APIs usage

0.8.1

21 Jun 10:06
Compare
Choose a tag to compare

Features

  • Added DocumentFile.child() extension function, so folder.findFile("Music").findFile("Favorites").findFile("Song.mp3") can be simplified to folder.child("Music/Favorites/Song.mp3")
  • Ask the user to open system settings if the storage permission was disabled permanently.

Breaking Changes

  • DocumentFile.getProperties() accepts a callback parameter.

Fixes

  • DocumentFileCompat.fromPublicFolder(DOWNLOADS) causes infinity recursion when the storage access is not granted.

0.8.0

14 Jun 08:18
Compare
Choose a tag to compare

Features

  • Added List<DocumentFile>.moveTo() and List<DocumentFile>.copyTo(), so you can copy/move multiple files.
  • You can expect storage type of the returned root path via SimpleStorage.requestStorageAccess(requestCode, initialRootPath, expectedStorageType) (#40).
  • Added StorageAccessCallback.onActivityHandlerNotFound()
  • Added DocumentFile.getProperties() to get file/folder information.

Breaking Changes

  • Callback functions in StorageAccessCallback now have additional parameters.
  • Some callback functions in FileCallback and FolderCallback are now called on UI thread (previously were worker thread). You can check their annotation, whether @WorkerThread or @UiThread.
  • FileCallback and FolderCallback are abstract classes now.
  • moveFileTo() and copyFileTo() with MediaFile are now available for API 28 and lower.
  • Simplified the sample code.

0.7.0

05 Jun 14:16
Compare
Choose a tag to compare

Features

  • Support user's data directory (#35)
  • Filter multiple mime types (#29)
  • Replace material-dialogs with AppCompat AlertDialog (#32), so Simple Storage size will be smaller.
  • Added CreateMode, so you can replace, reuse or create new files whenever a conflict raises in makeFile() and makeFolder().
  • Added SimpleStorageHelper.onStorageAccessGranted callback, so you can listen SimpleStorageHelper.requestStorageAccess().
  • Added isExternalStorageManager() that supports older APIs. Returns true if you have full disk access with java.io.File in this path.
  • More extension functions:
    • DocumentFile.inDataStorage(), which returns true if the path is under user's data directory.
    • forceDelete(), which returns true when the files/folders are deleted or did not exist at all.
    • File.child() to simplify File(parent, filename) to parent.child(filename)
  • The following utility functions now work for API 28-:
    • MediaStoreCompat.createDownload()
    • MediaStoreCompat.fromRelativePath()
    • MediaStoreCompat.fromBasePath()

Breaking Changes

  • Some extension functions now require Context, e.g. makeFile(), getStorageId(), isWritable(), etc.
  • Removed media database support for API 28-, because the media database records are not bound strongly with the files.
  • Moved mime type constants & functions from DocumentFileCompat to MimeType.
  • Moved PRIMARY storage ID constant from DocumentFileCompat to StorageId.
  • Introduced a new storage ID, i.e. StorageId.DATA to support user's data directory (#35).
  • DocumentFile.search() accepts multiple mime type filters.
  • DocumentFile.deleteRecursively() only returns true for folders.

Fixes

  • MediaStoreCompat.create*() crashes on API 28- (#31).
  • Fix file picker flow (#37).
  • moveFolderTo() can't move files.

0.6.0

20 May 09:06
Compare
Choose a tag to compare

Features

  • Updated to AGP 4.2.1 and Kotlin 1.5
  • ActivityResultLauncher integration (issue #17)
  • Use classic file merging (issue #26)

Breaking Changes

  • DocumentFile.getAbsolutePath() and DocumentFile.getBasePath() now require Context (to fix issue #27)
  • Renamed "cancelled" to "canceled".
  • Replaced onConflict() callback to onParentConflict() and onContentConflict()
  • Refactored PermissionRequest to ActivityPermissionRequest and FragmentPermissionRequest

Fixes

  • DocumentFile.getAbsolutePath() and DocumentFile.getBasePath() return empty String (issue #27)

0.5.3

30 Apr 15:11
Compare
Choose a tag to compare

Features

  • More accurately in guessing file extensions.
  • You can move & copy DocumentFile into MediaFile without storage permissions on Android 10+.
  • Added SimpleStorage.hasStorageAccess()
  • Added extension functions:
    • DocumentFile.isWritable because canWrite() is buggy.
    • DocumentFile.mimeTypeByFileName

Breaking Changes

  • moveFileTo() and copyFileTo() now accept FileDescription.

Fixes

0.5.2

25 Mar 10:36
Compare
Choose a tag to compare

Features

  • Added extension functions to MediaFile:
    • owner --> Get media file owner.
    • isMine --> true if the media is owned by your app.
  • Update to Material Dialogs v3

0.5.1

13 Mar 09:46
Compare
Choose a tag to compare

Features

  • Added extension functions:
    • DocumentFile.fullName
    • DocumentFile.mimeType

Fixes

  • Resolved persistent issue #12.
  • onConflict() not triggered when copying/moving files.
  • onPermissionsChecked() not called after the permission has been granted.