Releases: anggrayudi/SimpleStorage
Releases · anggrayudi/SimpleStorage
0.11.0
Features
- Added
DocumentFile.getFormattedSize()
andMediaFile.formattedSize
Breaking Changes
- Added
requiresWriteAccess
to:DocumentFileCompat.fromSimplePath()
DocumentFileCompat.fromFullPath()
DocumentFileCompat.fromFile()
Fixes
- Android 11 returns
RawDocumentFile
forDocumentFileCompat.from*()
. Fixed by addingrequiresWriteAccess
. DocumentFile.toTreeDocumentFile()
doesn't return null forSingleDocumentFile
0.10.0
Features
- Supported
ComponentActivity
(#28). - Supported
Intent.ACTION_CREATE_DOCUMENT
DocumentFile.child()
is 36% faster now. It affects the entire library performance, for examplemkdirs()
,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 ofandroid.app.Activity
, then you need to callonRequestPermissionsResult()
. I recommend usingComponentActivity
orAppCompatActivity
so you don't need to callonRequestPermissionsResult()
. - Removed extension function
DocumentFile.doesExist()
. UseDocumentFile.child() != null
instead.
Fixes
DocumentFileCompat.getRootDocumentFile()
doesn't returnnull
when the URI permission hasn't been granted yet.
0.9.0
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()
toinSameMountPointWith()
- Removed deprecated APIs usage
0.8.1
Features
- Added
DocumentFile.child()
extension function, sofolder.findFile("Music").findFile("Favorites").findFile("Song.mp3")
can be simplified tofolder.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
Features
- Added
List<DocumentFile>.moveTo()
andList<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
andFolderCallback
are now called on UI thread (previously were worker thread). You can check their annotation, whether@WorkerThread
or@UiThread
. FileCallback
andFolderCallback
are abstract classes now.moveFileTo()
andcopyFileTo()
withMediaFile
are now available for API 28 and lower.- Simplified the sample code.
0.7.0
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 inmakeFile()
andmakeFolder()
. - Added
SimpleStorageHelper.onStorageAccessGranted
callback, so you can listenSimpleStorageHelper.requestStorageAccess()
. - Added
isExternalStorageManager()
that supports older APIs. Returnstrue
if you have full disk access withjava.io.File
in this path. - More extension functions:
DocumentFile.inDataStorage()
, which returnstrue
if the path is under user's data directory.forceDelete()
, which returnstrue
when the files/folders are deleted or did not exist at all.File.child()
to simplifyFile(parent, filename)
toparent.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
toMimeType
. - Moved
PRIMARY
storage ID constant fromDocumentFileCompat
toStorageId
. - 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 returnstrue
for folders.
Fixes
0.6.0
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()
andDocumentFile.getBasePath()
now requireContext
(to fix issue #27)- Renamed "cancelled" to "canceled".
- Replaced
onConflict()
callback toonParentConflict()
andonContentConflict()
- Refactored
PermissionRequest
toActivityPermissionRequest
andFragmentPermissionRequest
Fixes
DocumentFile.getAbsolutePath()
andDocumentFile.getBasePath()
return emptyString
(issue #27)
0.5.3
Features
- More accurately in guessing file extensions.
- You can move & copy
DocumentFile
intoMediaFile
without storage permissions on Android 10+. - Added
SimpleStorage.hasStorageAccess()
- Added extension functions:
DocumentFile.isWritable
becausecanWrite()
is buggy.DocumentFile.mimeTypeByFileName
Breaking Changes
moveFileTo()
andcopyFileTo()
now acceptFileDescription
.
Fixes
0.5.2
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