Skip to content

Conversation

@mardous
Copy link
Owner

@mardous mardous commented Nov 11, 2025

No description provided.

mardous added 13 commits May 8, 2025 16:08
# Conflicts:
#	app/src/main/java/com/simplified/wsstatussaver/model/WaDirectory.kt
#	app/src/main/java/com/simplified/wsstatussaver/repository/StatusesRepository.kt
The previous implementation used `uri?.let { ... }` which is not necessary. This change removes the unnecessary let and directly handles the null check for the `uri`.
This change modifies the `setCustomDirectory` function to accept a nullable Uri. Passing `null` to this function will remove the stored custom directory preference for the specified status type.
The change refactors the `getCustomDirectory` function to check if the application has full access (read and write permissions) for the persisted URI when retrieving a custom directory. This ensures that the application can both read from and write to the specified custom directory. A helper extension function `hasFullAccess` is introduced for this check.
This change refactors the `toUriLocation` function in `WaSavedContentStorage` to accept a `WaDirectoryUri` object instead of just a `Uri`. This change provides more context about the directory when creating a new document using `createDocument`, making the file saving logic more robust.
The `toMediaStore`, `toFileLocation`, and `toCustomDirectory` methods in `WaSavedContentStorage` have been made private as they are only intended for internal use within the class.
This change refactors the content saving logic in `WaSavedContentStorage` to use `DocumentFile` and `FileOutputStream` for better handling within scoped storage. This replaces the previous approach using `DocumentsContract.createDocument` and `openOutputStream`, which was less robust for writing content. Additionally, the method for getting the custom directory name now also utilizes `DocumentFile`.
# Conflicts:
#	app/src/main/java/com/simplified/wsstatussaver/extensions/PermissionExt.kt
@mardous mardous linked an issue Nov 13, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Could you make a tool into

2 participants