Compare commits

...
232 Commits
Author SHA1 Message Date
alperozturk96 d99e601a09 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-05-06 09:02:15 +02:00
alperozturk96 85c047ee85 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-05-06 08:20:30 +02:00
Alper Öztürk 650d5dd182 Merge pull request #16992 from nextcloud/e2eV1
Fix e2e v1 folder creation
2026-05-05 10:51:35 +02:00
tobiasKaminsky 452955422a Fix e2e v1 folder creation
Signed-off-by: tobiasKaminsky <[email protected]>
2026-05-05 10:23:52 +02:00
Andy Scherzinger 0d577ec6b7 Merge pull request #16918 from nextcloud/renovate/composebom
Update dependency androidx.compose:compose-bom to v2026.04.01
2026-05-02 15:05:49 +02:00
Andy Scherzinger 5fc0d91297 Merge pull request #16948 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-05-02 14:50:33 +02:00
nextcloud-android-bot 4a1e7a8223 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-05-02 03:06:49 +00:00
Nextcloud bot e0e6fdcbcc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-02 03:05:43 +00:00
Alper Öztürk 1fed1f5f2f Merge pull request #16946 from nextcloud/fix/codacy
fix codacy
2026-04-30 15:25:32 +02:00
alperozturk96 3d516d0eab fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-04-30 15:24:10 +02:00
Alper Öztürk b4050dd064 Merge pull request #16941 from nextcloud/fix/delete-all
fix(delete-files): delete all
2026-04-30 15:04:30 +02:00
Tobias Kaminsky af0ddce6dc Merge pull request #16943 from nextcloud/oldTargetApi
lint: do not warn on old target, we check this on our own
2026-04-30 08:55:35 +02:00
tobiasKaminsky 19989c09ee lint: do not warn on old target, we check this on our own
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-30 08:22:27 +02:00
Alper Öztürk 28d1186cdc Merge pull request #16911 from nextcloud/update-library-2026-04-26
Update library to 2026-04-26
2026-04-29 14:28:24 +02:00
alperozturk96 ba538498b3 fix(delete-files): delete all
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 14:03:31 +02:00
Alper Öztürk 0f04e2fec1 Merge pull request #16910 from nextcloud/file-list-layout-manager
file list layout manager
2026-04-29 11:45:48 +02:00
alperozturk96 2b28c35522 fix spotbugs
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 11:45:23 +02:00
alperozturk96 9d2e4a4777 file list layout manager
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 11:42:19 +02:00
Alper Öztürk 5835e58471 Merge pull request #16928 from nextcloud/fix/filename-text-watcher-existing-file-names-provider-npe
fix(filename text watcher): existing file names provider npe
2026-04-29 11:29:19 +02:00
Alper Öztürk 6ec3e0b6ad Merge pull request #16903 from nextcloud/feat/create-sub-encrypted-folder
feat(encryption): create sub encryption folder
2026-04-29 11:26:56 +02:00
alperozturk96 98e6d4a660 check e2ee capabilities
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 11:25:40 +02:00
alperozturk96 2ab8907369 feat(encryption): create sub encryption folder
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 11:20:53 +02:00
Alper Öztürk b5f872c3e3 Merge pull request #16908 from nextcloud/improve-gallery-search-task
Improve GallerySearchTask
2026-04-29 11:17:23 +02:00
Tobias Kaminsky febeae7674 Merge pull request #16929 from nextcloud/fix/file-detail-sharing-fragment-lifecycle
fix(file-detail-sharing-fragment): lifecycle
2026-04-29 10:58:34 +02:00
Tobias Kaminsky 44737c27eb Merge pull request #16909 from nextcloud/fix/gallery-stay-where-it-is-after-picking-image
fix(gallery): scroll to position
2026-04-29 10:39:45 +02:00
Tobias Kaminsky f4a0ae095e Apply suggestion from @tobiasKaminsky
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-04-29 10:35:38 +02:00
Tobias Kaminsky 6e6713367d Merge pull request #16879 from nextcloud/feat/navigator-trashbin
feat(navigator): trashbin fragment
2026-04-29 10:22:13 +02:00
Tobias Kaminsky 08b8441c6e Merge branch 'master' into update-library-2026-04-26
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-04-29 10:21:01 +02:00
Alper Öztürk aa8ee87e34 Merge pull request #16935 from nextcloud/fix/gh-actions
fix gh actions
2026-04-29 09:54:26 +02:00
alperozturk96 af91398346 fix gh actions
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 09:12:51 +02:00
Alper Öztürk 03f654e5eb Merge pull request #16937 from nextcloud/use-latest-cmake-available-for-android-studio
use latest cmake available for android studio
2026-04-29 09:08:38 +02:00
alperozturk96 cc5313648c use-latest-cmake-available-for-android-studio
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 09:07:38 +02:00
Alper Öztürk 81132d47be Merge pull request #16936 from nextcloud/update/git-ignore
update gitignore cxx
2026-04-29 08:58:51 +02:00
alperozturk96 7fa65aed9d ignore cpp
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:58:09 +02:00
Alper Öztürk a23d55c926 Merge pull request #16914 from nextcloud/renovate/androidpluginversion
chore(deps): update androidpluginversion to v9.2.0
2026-04-29 08:45:55 +02:00
Alper Öztürk 776aa3b664 Merge pull request #16927 from nextcloud/chore/update-ndk
chore(version-bump): ndk
2026-04-29 08:44:24 +02:00
alperozturk96 65b495c4fb fix ss names
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:43:18 +02:00
alperozturk96 42e262101f fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:39:05 +02:00
alperozturk96 5c655f9b9c fix back button press
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:39:05 +02:00
alperozturk96 9ddf9a9604 fix tests
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:39:05 +02:00
alperozturk96 31ce3c656c wip
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:39:05 +02:00
alperozturk96 65711ffdfe wip
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:39:05 +02:00
alperozturk96 aee38c95f2 feat(navigator): trashin bin fragment
Signed-off-by: alperozturk96 <[email protected]>
2026-04-29 08:39:05 +02:00
Nextcloud bot 7da42ea18b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-29 03:10:24 +00:00
Alper Öztürk f079809fcc Merge pull request #16931 from nextcloud/fix/uri-utils-caller
fix(uri-util): illegal argument
2026-04-28 15:01:06 +02:00
Alper Öztürk bd2681193c Merge pull request #16930 from nextcloud/fix/merge-oc-files-for-live-photo
fix(live-photo): oome
2026-04-28 15:01:04 +02:00
alperozturk96 5055086f16 fix(uri-util): illegal argument
Signed-off-by: alperozturk96 <[email protected]>
2026-04-28 14:14:48 +02:00
alperozturk96 78bd8ba61a fix(live-photo): oome
Signed-off-by: alperozturk96 <[email protected]>
2026-04-28 13:57:02 +02:00
alperozturk96 01344144e7 fix(file-detail-sharing-fragment): lifecycle
Signed-off-by: alperozturk96 <[email protected]>
2026-04-28 12:38:53 +02:00
alperozturk96 51a52f051c fix(filename text watcher): existing file names provider npe
Signed-off-by: alperozturk96 <[email protected]>
2026-04-28 12:21:15 +02:00
alperozturk96 f32a12f26a chore(version-bump): ndk
Signed-off-by: alperozturk96 <[email protected]>
2026-04-28 11:35:57 +02:00
alperozturk96 3d7474b2e6 chore(version-bump): ndk
Signed-off-by: alperozturk96 <[email protected]>
2026-04-28 11:35:29 +02:00
Nextcloud bot 54549a00be fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-28 03:04:55 +00:00
Andy Scherzinger 3b4ede2d81 Merge pull request #16922 from nextcloud/renovate/fastlane-2.x-lockfile
Update dependency fastlane to v2.233.0
2026-04-27 19:59:58 +02:00
Andy Scherzinger 3a5bb79386 Merge pull request #16924 from nextcloud/renovate/ubuntu-26.x
Update ubuntu Docker tag to v26
2026-04-27 19:59:24 +02:00
renovate[bot] e82b817cb7 Update ubuntu Docker tag to v26
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 17:45:03 +00:00
renovate[bot] 1ceb30e621 Update dependency fastlane to v2.233.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 17:43:46 +00:00
renovate[bot] c80f1f389b Update dependency androidx.compose:compose-bom to v2026.04.01
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 17:39:33 +00:00
Nextcloud bot b716c74d97 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-27 03:02:31 +00:00
renovate[bot] 671412cc47 Update androidPluginVersion to v9.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 00:35:40 +00:00
Nextcloud bot 908a0dda0e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-26 03:02:45 +00:00
Tobias Kaminsky cef0c69d29 Update library to 2026-04-26
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-04-26 00:01:15 +02:00
Nextcloud bot 1048746b95 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-25 03:03:46 +00:00
alperozturk96 1d76e45a13 fix(gallery): scroll to position
Signed-off-by: alperozturk96 <[email protected]>
2026-04-24 15:53:29 +02:00
alperozturk96 f81404b43d fix scrolling search
Signed-off-by: alperozturk96 <[email protected]>
2026-04-24 15:25:02 +02:00
alperozturk96 f536eee932 convert gallery search task to kotlin and use coroutines
Signed-off-by: alperozturk96 <[email protected]>
2026-04-24 15:01:24 +02:00
alperozturk96 13d40d696a convert gallery search task to kotlin and use coroutines
Signed-off-by: alperozturk96 <[email protected]>
2026-04-24 14:52:13 +02:00
alperozturk96 6a4885a334 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-04-24 14:52:13 +02:00
Nextcloud bot 39abf4855f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-24 03:30:31 +00:00
Alper Öztürk f7c9d882a7 Merge pull request #16906 from nextcloud/fixci
fix ci
2026-04-23 08:51:53 +02:00
alperozturk96 b434283998 fix ci
Signed-off-by: alperozturk96 <[email protected]>
2026-04-23 08:51:34 +02:00
Nextcloud bot 1b328b50a2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-23 03:15:35 +00:00
Alper Öztürk f4775b7e2c Merge pull request #16878 from nextcloud/gallery-fragment-kt
Gallery Fragment Kotlin
2026-04-22 15:34:14 +02:00
Alper Öztürk ba388474fd Merge pull request #16901 from nextcloud/fix/storage-manager-ufo
fix(upload-file-operation): wrong storage manager injection
2026-04-22 15:04:46 +02:00
alperozturk96 b62f0154dd fix(upload-file-operation): wrong storage manager injection
Signed-off-by: alperozturk96 <[email protected]>
2026-04-22 14:07:32 +02:00
Alper Öztürk f925ba469b Merge pull request #16898 from nextcloud/refactor-3
refactor
2026-04-22 11:51:40 +02:00
alperozturk96 5b65d106c8 refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-04-22 11:50:48 +02:00
Alper Öztürk 0a06757693 Merge pull request #16896 from nextcloud/refactor-2
refactor
2026-04-22 11:46:03 +02:00
alperozturk96 8d416a6205 refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-04-22 11:45:25 +02:00
Alper Öztürk ac26ffdc45 Merge pull request #16893 from nextcloud/improve-text-string-fragment
fix(preview-text-string-fragment): edit
2026-04-22 08:08:46 +02:00
alperozturk96 2f700545a8 fix(preview-text-string-fragment): edit
Signed-off-by: alperozturk96 <[email protected]>
2026-04-22 07:00:44 +02:00
alperozturk96 58299f630d Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-04-22 07:00:44 +02:00
Andy Scherzinger f85607c355 Merge pull request #16892 from nextcloud/renovate/fastlane-2.x-lockfile
Update dependency fastlane to v2.233.0
2026-04-21 19:47:31 +02:00
Andy Scherzinger f6ce330d03 Merge pull request #16885 from nextcloud/renovate/spotbugsgradleplugin
Update dependency com.github.spotbugs to v6.5.1
2026-04-21 18:53:21 +02:00
renovate[bot] 710ad4b3d2 Update dependency fastlane to v2.233.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-21 07:39:43 +00:00
Nextcloud bot f094cd8bc9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-21 02:58:05 +00:00
Alper Öztürk bf7bb83a56 Merge pull request #16887 from nextcloud/fix/sharedWithMe
Shared with me: transfer owner info from partial file
2026-04-20 08:46:05 +02:00
Andy Scherzinger fe2618adb3 Merge pull request #16884 from nextcloud/renovate/actions-cache-5.x
chore(deps): update actions/cache action to v5.0.5
2026-04-20 08:30:45 +02:00
Andy Scherzinger 25e0726cd3 Merge pull request #16883 from nextcloud/renovate/ubuntu-noble
chore(deps): update ubuntu:noble docker digest to c4a8d55
2026-04-20 08:30:13 +02:00
Andy Scherzinger 2807326f6c Merge pull request #16886 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.35.2
2026-04-20 08:28:55 +02:00
Tobias Kaminsky 41fcf0c648 Merge pull request #16888 from nextcloud/devBuild
fix dev build process for daily
2026-04-20 08:20:41 +02:00
tobiasKaminsky 26449e24c7 fix dev build process for daily
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-20 08:20:15 +02:00
Tobias Kaminsky 201e6b3d37 Merge pull request #16881 from nextcloud/update-library-2026-04-19
Update library to 2026-04-19
2026-04-20 07:56:38 +02:00
Nextcloud bot 3ba783e099 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-20 02:58:12 +00:00
renovate[bot] 2eca9791f7 Update github/codeql-action action to v4.35.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 01:53:34 +00:00
renovate[bot] cb17d792d0 Update dependency com.github.spotbugs to v6.5.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 01:51:59 +00:00
renovate[bot] f57d9fcd1f Update actions/cache action to v5.0.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 00:27:30 +00:00
renovate[bot] 239c4e02ae Update ubuntu:noble Docker digest to c4a8d55
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-20 00:27:24 +00:00
Nextcloud bot 2dba050852 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-19 02:58:15 +00:00
Tobias Kaminsky 27424fa517 Update library to 2026-04-19
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-04-19 00:01:31 +02:00
Nextcloud bot abe4481956 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-18 02:58:43 +00:00
alperozturk96 2d2377e5ba gallery fragment kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 15:28:39 +02:00
alperozturk96 ebeb5f0705 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 15:28:38 +02:00
Alper Öztürk 4bccad2714 Merge pull request #16872 from nextcloud/fix/npe-offline-sync
fix(offline-sync): remote path npe
2026-04-17 11:26:06 +02:00
Alper Öztürk 36c63b8a0c Merge pull request #16868 from nextcloud/fix/upload-list-adapter-npe
fix(upload-list): conflict check npe
2026-04-17 11:25:51 +02:00
Tobias Kaminsky 5c6f59c7cf Merge pull request #16831 from nextcloud/renovate/kotlinxserializationjson
Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.11.0
2026-04-17 09:53:02 +02:00
Tobias Kaminsky f779a6c2d9 Merge pull request #16871 from nextcloud/update-agents-md
update agents md
2026-04-17 09:52:34 +02:00
alperozturk96 c33328e6ef fix(offline-sync): remote path npe
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 09:37:10 +02:00
alperozturk96 f142e66e7d fix(offline-sync): remote path npe
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 09:31:14 +02:00
alperozturk96 6089dd0946 update agents md
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 09:10:29 +02:00
Alper Öztürk e3c8b64e9c Merge pull request #16863 from nextcloud/fix/file-extension-to-file
fix(file-extension): to file, npe
2026-04-17 08:54:32 +02:00
alperozturk96 2c237ea3b0 fix(upload-list): dismiss conflict resolve notification after resolving
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 08:42:03 +02:00
alperozturk96 504fb1863b fix(upload-list): npe conflict check
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 08:42:03 +02:00
alperozturk96 f6616ecb38 fix(file-extension): to file, npe
Signed-off-by: alperozturk96 <[email protected]>
2026-04-17 08:41:58 +02:00
tobiasKaminsky a6a541ff5e Shared with me: transfer owner info from partial file
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-17 08:39:46 +02:00
Alper Öztürk 0a91cb51b7 Merge pull request #16855 from nextcloud/builtInKotlin
Use built-in Kotlin
2026-04-17 08:36:26 +02:00
Alper Öztürk 9121a07a10 Merge pull request #16864 from nextcloud/fix/file-actions-bottom-sheet-argument-parsing
fix(file-actions-bottom-sheet): bundle
2026-04-17 08:35:03 +02:00
tobiasKaminsky d8c62d4ff9 fix test
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-17 07:37:18 +02:00
tobiasKaminsky 84ed04ad96 suppress false-positive spotbugs for Dagger
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-17 07:24:08 +02:00
tobiasKaminsky 530f2e607e Use built-in Kotlin
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-17 07:24:08 +02:00
Nextcloud bot 8c278c1171 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-17 03:03:30 +00:00
alperozturk96 dfcd7f4311 fix(file-actions-bottom-sheet): bundle
Signed-off-by: alperozturk96 <[email protected]>
2026-04-16 12:17:23 +02:00
Nextcloud bot d8d06f2546 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-16 02:59:16 +00:00
Alper Öztürk 09f41024a8 Merge pull request #16819 from nextcloud/fix/upload-list-conflict-handling
fix(upload-list): handle conflict actions
2026-04-15 15:00:12 +02:00
alperozturk96 1c88f94dbc fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:59:47 +02:00
alperozturk96 177d4c06d8 webDavParentPath
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 1899ca7ed1 webDavParentPath
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 ee02b00710 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
Alper ÖztürkandLaura Kramolis 04dea791bb Update app/src/main/res/values/strings.xml
Co-authored-by: Laura Kramolis <[email protected]>
Signed-off-by: Alper Öztürk <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 650144fdcc wip
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 4f130835a8 fix(upload-list): handle conflict actions
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 2d9aa7fa96 fix(upload-list): handle conflict actions
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 f856950058 fix(upload-list): handle conflict actions
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
alperozturk96 616c1c84e7 fix(upload-list): handle conflict actions
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:54:50 +02:00
Alper Öztürk 4e035ceed4 Merge pull request #16848 from nextcloud/fix/file-list-on-browse-up
fix(file-list): browse up
2026-04-15 14:54:19 +02:00
alperozturk96 17271d8ad2 browse up if parent deleted instead all the time root
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:37:04 +02:00
alperozturk96 ba809dc646 browse up if parent deleted instead all the time root
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:32:20 +02:00
alperozturk96 7ab30f08d5 add tests
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:11:16 +02:00
alperozturk96 2b2d4c18d9 fix(file-list): browse up
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:01:09 +02:00
alperozturk96 f92f514046 fix(file-list): browse up
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:01:09 +02:00
alperozturk96 fc145e1e22 fix(file-list): browse up
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 14:01:09 +02:00
Tobias Kaminsky 329e4ff23f Merge pull request #16018 from nextcloud/removeKAPT
Remove KAPT
2026-04-15 13:43:57 +02:00
tobiasKaminsky f3e90cf07c Remove KAPT
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-15 11:54:04 +02:00
tobiasKaminsky bf9ada5efe Remove KAPT
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-15 11:54:02 +02:00
Tobias Kaminsky fa10867938 Merge pull request #16260 from nextcloud/depocc/DownloadFile
DownloadFileOperation uses now NextcloudClient
2026-04-15 11:50:03 +02:00
tobiasKaminsky 8c86b6a92b DownloadFileOperation uses now NextcloudClient
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-15 11:24:00 +02:00
Tobias Kaminsky 6e7d615a71 Merge pull request #16842 from nextcloud/gradle911
Update to gradle plugin 9.1.1
2026-04-15 11:23:04 +02:00
Alper Öztürk 8595e4cf8d Merge pull request #16854 from nextcloud/fixcodacy
fix(build): codacy
2026-04-15 11:10:06 +02:00
alperozturk96 37eca1a5d5 fix(build): codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 11:08:30 +02:00
Alper Öztürk 562e799d94 Merge pull request #16582 from nextcloud/fix/client-integration-icon-crash
fix(client-integration): icon crash
2026-04-15 11:06:20 +02:00
Alper Öztürk ae89d1616d Merge pull request #16820 from nextcloud/hide-rc-section-for-huawei-build-variant
style(community): hide rc section for huawei build variant
2026-04-15 11:05:44 +02:00
Alper Öztürk cea31587ba Merge pull request #16781 from nextcloud/fix/oc-capability-entry-type
fix(oc-capability): uses correct room field types
2026-04-15 11:05:13 +02:00
Tobias Kaminsky 3b90fb18d2 Merge pull request #16844 from nextcloud/fix/file-indicator-npe
fix(file-list): file indicator folder downloaded check
2026-04-15 10:10:15 +02:00
alperozturk96 a66f4d640e style(community): hide rc section for huawei build variant
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 09:42:56 +02:00
Tobias Kaminsky 3c52e2cef1 Merge pull request #16261 from nextcloud/favoritesInMenu
FileDetails: set/unset favorite also via bottom menu
2026-04-15 09:40:12 +02:00
alperozturk96 d818169785 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 09:23:11 +02:00
alperozturk96 3dfb266d73 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-04-15 09:02:40 +02:00
alperozturk96 6667a9987e fix(client-integration): icon crash
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/utils/GlideHelper.kt
2026-04-15 08:55:56 +02:00
Nextcloud bot faec92aff6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-15 03:17:57 +00:00
tobiasKaminsky 945bf3b098 Update to gradle plugin 9.1.1
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-14 10:52:01 +02:00
alperozturk96 73cf745aa3 fix(file-list): file indicator folder downloaded check
Signed-off-by: alperozturk96 <[email protected]>
2026-04-14 10:43:20 +02:00
alperozturk96 bb4c135bc3 add migration
Signed-off-by: alperozturk96 <[email protected]>
2026-04-14 10:22:08 +02:00
renovate[bot] a7cd586a0f fix(deps): update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.11.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-14 10:21:57 +02:00
alperozturk96 328102d660 fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-04-14 10:17:32 +02:00
alperozturk96 4d94b8164a fix(oc-capability): uses correct room field types
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/99.json
#	app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt
2026-04-14 10:17:30 +02:00
Alper Öztürk 8a1fc07362 Merge pull request #16815 from nextcloud/chore/next-minor-version-33.2.0
chore(version-bump): next minor version 33.2.0
2026-04-14 10:10:53 +02:00
Tobias Kaminsky 6d193c3fb0 Merge pull request #16834 from nextcloud/update-library-2026-04-12
Update library to 2026-04-12
2026-04-14 08:32:38 +02:00
Nextcloud bot 2928d18aa6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-14 03:18:40 +00:00
Alper Öztürk 10079e53e4 Merge pull request #16838 from nextcloud/fix/code-detect
fix(ci): code-detekt
2026-04-13 10:18:07 +02:00
alperozturk96 057a8938b3 fix(ci): code-detekt
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 10:05:06 +02:00
Alper Öztürk f49ebb29e1 Merge pull request #16800 from nextcloud/feat/navigator-notifications
feat(navigator): notifications
2026-04-13 10:02:21 +02:00
Andy Scherzinger fa67776a18 Merge pull request #16708 from nextcloud/fix/video-icon-thumbnail
fix(gallery): video thumbnail and overlay
2026-04-13 09:58:17 +02:00
alperozturk96 f9c69cc96e simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:56:50 +02:00
alperozturk96 624b0ab7a0 simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:54:44 +02:00
alperozturk96 b6e98972a7 fix ss tests
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:47 +02:00
alperozturk96 7109bf2016 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:47 +02:00
alperozturk96 1e5ad690d2 de-couple nextcloud client from adapter
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:47 +02:00
alperozturk96 4e58422797 fix adapter initialization
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:46 +02:00
alperozturk96 d2037fa81a fix codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:46 +02:00
alperozturk96 7f4a56c8e2 remove inner action bar since activity providing it
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:46 +02:00
alperozturk96 ae88b69489 fix action bar padding
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:46 +02:00
alperozturk96 6491900c1e fix(navigator): remove unnecessary calls
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:46 +02:00
alperozturk96 e9744a88c5 fix(navigator): remove unnecessary ui run block
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:46 +02:00
alperozturk96 191f1fb9cc fix(navigator): fix getting account name from worker
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:45 +02:00
alperozturk96 e0fe3d0eca fix(navigator): fix notifications tests
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:45 +02:00
alperozturk96 ab724ab84d fix(navigator): simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:45 +02:00
alperozturk96 a1d185040b Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:45 +02:00
alperozturk96 3152e355d4 fix(navigator): simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:45 +02:00
alperozturk96 b56e48525a fix(navigator): notifications
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:45 +02:00
alperozturk96 c85964ae79 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-04-13 09:25:44 +02:00
Andy Scherzinger ca0edea70c Merge pull request #16836 from nextcloud/renovate/spotbugsgradleplugin
chore(deps): update dependency com.github.spotbugs to v6.5.0
2026-04-13 08:42:47 +02:00
Alper Öztürk 61e3f48875 Merge pull request #16769 from penguin86/feature/591-groups-in-user-info-rv
591: Add groups to user info, with sections and using RecyclerView for future expandability
2026-04-13 08:12:43 +02:00
Andy Scherzinger d62f966042 Merge pull request #16837 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.232.2
2026-04-13 07:43:44 +02:00
tobiasKaminsky 6707e04d5c Merge remote-tracking branch 'origin/update-library-2026-04-12' into update-library-2026-04-12
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-13 07:26:21 +02:00
Tobias Kaminsky bf9d6cf9c0 Update library to 2026-04-12
Signed-off-by: Tobias Kaminsky <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-13 07:26:08 +02:00
renovate[bot] 699380e546 chore(deps): update dependency com.github.spotbugs to v6.5.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-13 04:29:48 +00:00
Nextcloud bot e37b4e98e9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-13 02:58:42 +00:00
renovate[bot] 75820ac66f chore(deps): update dependency fastlane to v2.232.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-13 00:32:03 +00:00
Nextcloud bot 8b7dc1c512 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-12 03:02:30 +00:00
Tobias Kaminsky cbbb4ebeff Update library to 2026-04-12
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-04-12 00:02:59 +02:00
Andy Scherzinger 5149c5ee99 Merge pull request #16829 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.232.2
2026-04-11 17:19:31 +02:00
Andy Scherzinger f521a020c0 Merge pull request #16827 from nextcloud/renovate/ubuntu-noble
chore(deps): update ubuntu:noble docker digest to 84e77de
2026-04-11 17:09:09 +02:00
Andy Scherzinger 99bd48144b Merge pull request #16828 from nextcloud/renovate/actions-upload-artifact-7.x
chore(deps): update actions/upload-artifact action to v7.0.1
2026-04-11 17:08:43 +02:00
renovate[bot] e46acb004a chore(deps): update dependency fastlane to v2.232.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-11 11:57:54 +00:00
renovate[bot] 5f9756987d chore(deps): update actions/upload-artifact action to v7.0.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-11 11:54:26 +00:00
renovate[bot] ac7d90ae61 chore(deps): update ubuntu:noble docker digest to 84e77de
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-11 11:54:21 +00:00
Nextcloud bot f210498da7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-11 02:57:24 +00:00
Nextcloud bot df58beff81 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-10 06:49:40 +00:00
Tobias Kaminsky 867f54d6df Merge pull request #16821 from nextcloud/fixTransifexNewLines
Transifex: no new lines are allowed
2026-04-10 08:39:51 +02:00
tobiasKaminsky 2f1ea4998a Transifex: no new lines are allowed
Signed-off-by: tobiasKaminsky <[email protected]>
2026-04-10 08:39:25 +02:00
alperozturk96 721ce87815 chore(version-bump): next minor version 33.2.0
Signed-off-by: alperozturk96 <[email protected]>
2026-04-08 14:04:59 +02:00
alperozturk96 e89f3a102f use PREFIX_RESIZED_IMAGE
Signed-off-by: alperozturk96 <[email protected]>
2026-04-02 10:18:18 +02:00
alperozturk96 937317eac7 use PREFIX_RESIZED_IMAGE
Signed-off-by: alperozturk96 <[email protected]>
2026-04-02 10:18:18 +02:00
alperozturk96 d9d81f9876 use PREFIX_RESIZED_IMAGE
Signed-off-by: alperozturk96 <[email protected]>
2026-04-02 10:18:18 +02:00
alperozturk96 2cbf1ea3e4 fix(gallery): video thumbnail and overlay
Signed-off-by: alperozturk96 <[email protected]>
2026-04-02 10:18:18 +02:00
alperozturk96 d085e852c9 fix(gallery): video thumbnail and overlay
Signed-off-by: alperozturk96 <[email protected]>
2026-04-02 10:18:18 +02:00
alperozturk96 dc9727a4d0 fix(gallery): video thumbnail and overlay
Signed-off-by: alperozturk96 <[email protected]>
2026-04-02 10:18:18 +02:00
Alper Öztürk f62c7e459d Merge branch 'master' into feature/591-groups-in-user-info-rv 2026-04-01 13:11:32 +02:00
Alper Öztürk fa0ebc2223 Merge branch 'master' into feature/591-groups-in-user-info-rv 2026-04-01 08:33:20 +02:00
Daniele Verducci 4301bf78e7 591: Added copyright line 2026-03-31 21:42:52 +02:00
Daniele Verducci 25911dcdab Merge branch 'master' into feature/591-groups-in-user-info-rv
Signed-off-by: Daniele Verducci <[email protected]>
2026-03-30 19:35:54 +02:00
Daniele Verducci 1de358fd63 591: Refactored item type logic, inc. background, into its own enum class 2026-03-30 19:23:23 +02:00
Daniele Verducci 7f44e91d97 591: Changed adapter item to data class 2026-03-30 19:01:36 +02:00
Daniele Verducci 8a5ded985e 591: SectionedViewHolder doesn't need to be nullable 2026-03-30 19:01:08 +02:00
Daniele Verducci b808845bfd 591: Adapter list doesn't need to be mutable, also renamed 2026-03-30 19:00:48 +02:00
Daniele Verducci 16486bf7b3 591: Rounded edges on single element 2026-03-29 15:03:39 +02:00
Daniele Verducci 66ce69e2ac 591: Themed section title 2026-03-29 14:50:49 +02:00
Daniele Verducci 4917913178 591: Added groups 2026-03-29 14:33:08 +02:00
Daniele Verducci 6d88aa1b1f 591: Migrated from RecyclerView.Adapter to SectionedRecyclerViewAdapter 2026-03-29 14:33:08 +02:00
Daniele Verducci da3f26206b 591: Created cell styles and layouts for sectioned user info list
Signed-off-by: Daniele Verducci <[email protected]>
2026-03-29 14:32:47 +02:00
Daniele Verducci 98ab726e48 591: Refactored user info adapter int its own class 2026-03-29 11:39:09 +02:00
tobiasKaminsky bea0aa2b0c FileDetails: set/unset favorite also via bottom menu
Signed-off-by: tobiasKaminsky <[email protected]>
2026-01-09 08:35:22 +01:00
275 changed files with 8259 additions and 3523 deletions

No files matched your search

+2 -3
View File
@@ -1,4 +1,4 @@
FROM ubuntu:noble@sha256:186072bba1b2f436cbb91ef2567abca677337cfc786c86e107d25b7072feef0c
FROM ubuntu:resolute@sha256:5e275723f82c67e387ba9e3c24baa0abdcb268917f276a0561c97bef9450d0b4
ARG DEBIAN_FRONTEND=noninteractive
ENV ANDROID_HOME=/usr/lib/android-sdk
@@ -16,5 +16,4 @@ RUN mkdir -p "$HOME/.gradle" && \
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" > "$HOME/.gradle/gradle.properties" && \
echo "org.gradle.caching=true" >> "$HOME/.gradle/gradle.properties" && \
echo "org.gradle.parallel=true" >> "$HOME/.gradle/gradle.properties" && \
echo "org.gradle.configureondemand=true" >> "$HOME/.gradle/gradle.properties" && \
echo "kapt.incremental.apt=true" >> "$HOME/.gradle/gradle.properties"
echo "org.gradle.configureondemand=true" >> "$HOME/.gradle/gradle.properties"
-1
View File
@@ -72,6 +72,5 @@ jobs:
{
echo "org.gradle.jvmargs=-Xmx1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
echo "org.gradle.configureondemand=true"
echo "kapt.incremental.apt=true"
} > "$HOME/.gradle/gradle.properties"
scripts/analysis/analysis-wrapper.sh "${{ steps.get-vars.outputs.branch }}" "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" "$GITHUB_RUN_NUMBER" "${{ steps.get-vars.outputs.pr }}"
-1
View File
@@ -35,5 +35,4 @@ jobs:
echo "org.gradle.caching=true" >> gradle.properties
echo "org.gradle.parallel=true" >> gradle.properties
echo "org.gradle.configureondemand=true" >> gradle.properties
echo "kapt.incremental.apt=true" >> gradle.properties
./gradlew assemble${{ matrix.flavor }}
+2 -2
View File
@@ -43,7 +43,7 @@ jobs:
with:
swap-size-gb: 10
- name: Initialize CodeQL
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
with:
languages: ${{ matrix.language }}
- name: Set up JDK 21
@@ -57,4 +57,4 @@ jobs:
echo "org.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
./gradlew --no-daemon assembleDebug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
+1 -1
View File
@@ -47,7 +47,7 @@ jobs:
run: |
mkdir -p "$HOME/.gradle"
echo "org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" > "$HOME/.gradle/gradle.properties"
echo "org.gradle.caching=true; org.gradle.parallel=true; org.gradle.configureondemand=true; kapt.incremental.apt=true" >> "$HOME/.gradle/gradle.properties"
echo "org.gradle.caching=true; org.gradle.parallel=true; org.gradle.configureondemand=true" >> "$HOME/.gradle/gradle.properties"
[ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" "app/build.gradle"
[ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" "app/build.gradle"
[ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode = ${{github.event.number}} /" "app/build.gradle.kts"
+1 -1
View File
@@ -42,6 +42,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
with:
sarif_file: results.sarif
+3 -4
View File
@@ -28,14 +28,14 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Gradle cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: AVD cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: avd-cache
with:
path: |
@@ -73,7 +73,6 @@ jobs:
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.parallel=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.configureondemand=true" >> $HOME/.gradle/gradle.properties
echo "kapt.incremental.apt=true" >> $HOME/.gradle/gradle.properties
- name: Build generic flavor
run: ./gradlew assembleGenericDebug
@@ -102,7 +101,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "${{ matrix.color }}-${{ matrix.scheme }}" "Screenshot" ${{github.event.number}}
- name: Archive Espresso results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
name: Report-${{ matrix.color }}-${{ matrix.scheme }}
+1 -1
View File
@@ -58,7 +58,7 @@ jobs:
- name: Upload jacoco artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results
path: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/html/
+1
View File
@@ -67,6 +67,7 @@ fastlane/Fastfile
obj/
*.o
*.a
.cxx/
# Testing & coverage
.kotlin/
+114 -56
View File
@@ -1,42 +1,49 @@
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Agents.md
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Agents.md
This file provides guidance to all AI agents (Claude, Codex, Gemini, etc.) working with code in this repository.
You are an experienced engineer specialized on Java, Kotlin and familiar with the platform-specific details of Android.
## Your Role
- You implement features and fix bugs.
- Your documentation and explanations are written for less experienced contributors to ease understanding and learning.
- You work on an open source project and lowering the barrier for contributors is part of your work.
## Project Overview
The Nextcloud Android Client is a application to synchronize files from Nextcloud Server with your Android device.
Java, Kotlin, XML, Jetpack Compose are the key technologies used for building the app.
## Project Structure: AI Agent Handling Guidelines
'./app/src/main/java/com' main package of the project.
'.app/src/main/java/com/nextcloud/utils/extensions' package used for creating extensions.
'./app/src/main/res/values' used for translations. Only update
'./app/src/main/res/values/strings.xml'. Do not modify any other translation files or folders. Ignore all values-
directories (e.g., values-es, values-fr).
## General Guidance
Every new file needs to get a SPDX header in the first rows according to this template.
The year in the first line must be replaced with the year when the file is created (for example, 2026 for files first added in 2026).
The commenting signs need to be used depending on the file type.
```plaintext
SPDX-FileCopyrightText: <YEAR> Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
You are an experienced engineer specialized on Java, Kotlin and familiar with the platform-specific details of Android.
## Your Role
- You implement features and fix bugs.
- Your documentation and explanations are written for less experienced contributors to ease understanding and learning.
- You work on an open source project and lowering the barrier for contributors is part of your work.
## Project Overview
The Nextcloud Android Client is a application to synchronize files from Nextcloud Server with your Android device.
Java, Kotlin, XML, Jetpack Compose are the key technologies used for building the app.
## Project Structure: AI Agent Handling Guidelines
- `./app/src/main/java/com/owncloud/android/` Legacy components (Activities, datamodel, operations)
- `./app/src/main/java/com/nextcloud/` Modern components (client APIs, DI, repositories, UI with Compose)
- `./app/src/main/java/com/nextcloud/utils/extensions/` Extension functions for common types
- `./app/src/main/java/com/nextcloud/ui/` Jetpack Compose UI components and screens
- `./app/src/main/java/com/nextcloud/client/di/` Dependency injection configuration (Dagger 2)
- `./app/src/main/java/com/nextcloud/client/assistant/` AI features (Assistant screen, chat, conversations, translations)
- `./app/src/test/` Unit tests (small, isolated tests without Android SDK)
- `./app/src/androidTest/` Instrumented tests (require Android SDK)
- `./app/src/main/res/values/` Translations. Only update `./app/src/main/res/values/strings.xml`. Do not modify any other translation files or folders. Ignore all `values-*` directories (e.g., `values-es`, `values-fr`).
## General Guidance
Every new file needs to get a SPDX header in the first rows according to this template.
The year in the first line must be replaced with the year when the file is created (for example, 2026 for files first added in 2026).
The commenting signs need to be used depending on the file type.
New contributions use AGPL-3.0-or-later license. Files may also have `OR GPL-2.0-only` in the license if they originated from GPL-licensed code.
```plaintext
SPDX-FileCopyrightText: <YEAR> Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
```
Kotlin/Java:
```kotlin
/*
@@ -55,9 +62,9 @@ XML:
~ SPDX-FileCopyrightText: <year> Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
```
Avoid creating source files that implement multiple types; instead, place each type in its own dedicated source file.
```
Avoid creating source files that implement multiple types; instead, place each type in its own dedicated source file.
## Design
@@ -65,7 +72,58 @@ Avoid creating source files that implement multiple types; instead, place each t
- In addition to any Material Design wording guidelines, follow the Nextcloud wording guidelines at https://docs.nextcloud.com/server/latest/developer_manual/design/foundations.html#wording
- Ensure the app works in both light and dark theme
- Ensure the app works with different server primary colors by using the colorTheme of viewThemeUtils
## Architecture & Patterns
### Jetpack Compose
Modern UI is built with Jetpack Compose (Material 3). Key directories:
- `com.nextcloud.ui.composeActivity` - Activities hosting Compose content
- `com.nextcloud.ui.composeComponents` - Reusable Compose components
- `com.nextcloud.client.assistant` - Compose-based Assistant screens and features
Use `StateFlow` and `MutableStateFlow` in ViewModels for state management. Collect state in Compose functions with `collectAsState()`.
### Dependency Injection
Uses Dagger 2 for major Android components (`Activity`, `Fragment`, `Service`, `BroadcastReceiver`, `ContentProvider`). Manual constructor injection for other components.
### Extension Functions
The `com.nextcloud.utils.extensions` package contains helper extensions organized by type (e.g., `FileExtensions.kt`, `StringExtensions.kt`, `ViewExtensions.kt`). Create focused extension files rather than putting multiple types in one file.
## Testing
### Unit Tests (`./app/src/test/`)
- Small, isolated tests without Android SDK
- Use Mockito with `mockito-kotlin` for easier mocking
- Recommended command: `./gradlew jacocoTestGplayDebugUnitTest`
- Tests use JUnit 4 with `@Test`, `@Before`, `@After` annotations
### Instrumented Tests (`./app/src/androidTest/`)
- Tests requiring Android SDK (Activities, Fragments, database access)
- Use Espresso for UI testing
- Tests should inherit from `AbstractOnServerIT` if they need server communication
- Always create a separate test user on test server to avoid data interference
- Run with: `./gradlew createGplayDebugCoverageReport -Pcoverage=true`
- Run specific test class: `./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=<fully.qualified.ClassName>`
- Run one test method: `./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=<fully.qualified.ClassName>#methodName`
### Screenshot Tests (Shot)
- Enabled via `SHOT_TEST=true` environment variable
- Use: `scripts/androidScreenshotTest` to check, `scripts/updateScreenshots.sh` to regenerate
- CI renders shadows differently; 0.5% tolerance is configured
## Code Quality Tools
All code is validated with the following tools. Fix findings in modified files:
- **lint** - Android linting (configured in `app/lint.xml`)
- **spotbugsGplayDebug** - Bug detection for Gplay variant
- **detekt** - Kotlin code analysis (configured in `app/detekt.yml`)
- **spotlessKotlinCheck** - Code formatting with ktlint
Run all checks with: `./gradlew check`
## Commit and Pull Request Guidelines
### Commits
@@ -90,25 +148,25 @@ Avoid creating source files that implement multiple types; instead, place each t
```
Pattern with roles: `AI-assistant: <coding-agent> <agent-version> (<role>: <model-name> <model-version>, <role>: <model-name> <model-version>)`
### Pull Requests
- Include a short summary of what changed. *Example:* `fix: prevent crash on empty todo title`.
- **Pull Request**: When the agent creates a PR, it should include a description summarizing the changes and why they were made. If a GitHub issue exists, reference it (e.g., “Closes #123”).
## Code Style
- Do not exceed 300 line of code per file.
- Include a short summary of what changed. *Example:* `fix: prevent crash on empty todo title`.
- **Pull Request**: When the agent creates a PR, it should include a description summarizing the changes and why they were made. If a GitHub issue exists, reference it (e.g., “Closes #123”).
## Code Style
- Do not exceed 300 lines of code per file.
- Line length: **120 characters**
- Standard Android Studio formatter with EditorConfig.
- Kotlin preferred for new code; legacy Java still present.
- Do not use decorative section-divider comments of any kind (e.g. `// ── Title ───`, `// ------`, `// ======`).
- Every new file must end with exactly one empty trailing line (no more, no less).
- Do not add comments, documentation for every function you created instead make it self explanatory as much as possible.
- Create models, states in different files instead of doing it one single file.
- Do not use magic number.
- Apply fail fast principle instead of using nested if-else statements.
- Do not use multiple boolean flags to determine states instead use enums or sealed classes.
- Use modern Java for Java classes. Optionals, virtual threads, records, streams if necessary.
- Avoid hardcoded strings, colors, dimensions. Use resources.
- Every new file must end with exactly one empty trailing line (no more, no less).
- Do not add comments, documentation for every function you created instead make it self explanatory as much as possible.
- Create models, states in different files instead of doing it one single file.
- Do not use magic numbers.
- Apply fail fast principle instead of using nested if-else statements.
- Do not use multiple boolean flags to determine states instead use enums or sealed classes.
- Use modern Java for Java classes. Optionals, virtual threads, records, streams if necessary.
- Avoid hardcoded strings, colors, dimensions. Use resources.
- Run lint, spotbugsGplayDebug, detekt, spotlessKotlinCheck and fix findings inside the files that have been changed.
+7 -9
View File
@@ -8,8 +8,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1234.0)
aws-sdk-core (3.244.0)
aws-partitions (1.1241.0)
aws-sdk-core (3.246.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -20,7 +20,7 @@ GEM
aws-sdk-kms (1.123.0)
aws-sdk-core (~> 3, >= 3.244.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.218.0)
aws-sdk-s3 (1.220.0)
aws-sdk-core (~> 3, >= 3.244.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
@@ -119,8 +119,7 @@ GEM
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-huawei_appgallery_connect (1.0.31)
cgi
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
fastlane-sirp (1.1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
@@ -164,13 +163,13 @@ GEM
httpclient (2.9.0)
mutex_m
jmespath (1.6.2)
json (2.19.3)
json (2.19.4)
jwt (2.10.2)
base64
logger (1.7.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.19.1)
multi_json (1.20.1)
multipart-post (2.4.1)
mutex_m (0.3.0)
nanaimo (0.4.0)
@@ -179,7 +178,7 @@ GEM
os (1.1.4)
plist (3.7.2)
public_suffix (6.0.2)
rake (13.3.1)
rake (13.4.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
@@ -198,7 +197,6 @@ GEM
simctl (1.6.10)
CFPropertyList
naturally
sysrandom (1.0.5)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
+2 -1
View File
@@ -1,3 +1,4 @@
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
/build
/build
/.cxx
+13 -15
View File
@@ -6,7 +6,6 @@
*/
@file:Suppress("UnstableApiUsage", "DEPRECATION")
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
import com.github.spotbugs.snom.Confidence
import com.github.spotbugs.snom.Effort
import com.github.spotbugs.snom.SpotBugsTask
@@ -24,11 +23,9 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.spotless)
alias(libs.plugins.kapt)
alias(libs.plugins.ksp)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.spotbugs)
alias(libs.plugins.detekt)
// needed to make renovate run without shot, as shot requires Android SDK
@@ -63,7 +60,7 @@ configurations.configureEach {
// semantic versioning for version code
val versionMajor = 33
val versionMinor = 1
val versionMinor = 2
val versionPatch = 0
val versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
@@ -84,8 +81,13 @@ val ncTestServerPassword = configProps["NC_TEST_SERVER_PASSWORD"]
val ncTestServerBaseUrl = configProps["NC_TEST_SERVER_BASEURL"]
android {
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
// install this NDK version and CMake to produce smaller APKs. Build will still work if not installed
ndkVersion = "${ndkEnv["NDK_VERSION"]}"
externalNativeBuild {
cmake {
version = "${ndkEnv["CMAKE_VERSION"]}"
}
}
namespace = "com.owncloud.android"
testNamespace = "${namespace}.test"
@@ -104,6 +106,10 @@ android {
targetSdk = 36
compileSdk = 36
ndk {
abiFilters += listOf("arm64-v8a", "x86_64", "x86")
}
buildConfigField("boolean", "CI", ciBuild.toString())
buildConfigField("boolean", "RUNTIME_PERF_ANALYSIS", perfAnalysis.toString())
@@ -168,12 +174,6 @@ android {
}
}
applicationVariants.configureEach {
outputs.configureEach {
if (this is ApkVariantOutputImpl) this.outputFileName = "${this.baseName}-${this.versionCode}.apk"
}
}
testOptions {
unitTests.isReturnDefaultValues = true
animationsDisabled = true
@@ -217,7 +217,8 @@ android {
"MissingQuantity",
"IconXmlAndPng",
"SelectedPhotoAccess",
"UnsafeIntentLaunch"
"UnsafeIntentLaunch",
"OldTargetApi"
)
)
htmlOutput = layout.buildDirectory.file("reports/lint/lint.html").get().asFile
@@ -233,8 +234,6 @@ android {
}
kapt.useBuildCache = true
ksp.arg("room.schemaLocation", "$projectDir/schemas")
// Configure KSP for test variants
@@ -457,7 +456,6 @@ dependencies {
// region Markdown rendering
implementation(libs.bundles.markdown.rendering)
kapt(libs.prism4j.bundler)
// endregion
// region Image cropping / rotation
File diff suppressed because it is too large. Load diff
@@ -69,6 +69,12 @@ class BitmapDecodeTests {
assertNull(result)
}
@Test
fun testToFileWhenPathIsNullShouldReturnNull() {
val result = null.toFile()
assertNull(result)
}
@Test
fun testToFileWhenFileDoesNotExistShouldReturnNull() {
val nonExistentPath = tempDir.resolve("does_not_exist.jpg")
@@ -0,0 +1,92 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.utils
import com.nextcloud.utils.extensions.webDavParentPath
import org.junit.Assert.assertEquals
import org.junit.Test
@Suppress("TooManyFunctions")
class WebDavParentPathTests {
@Test
fun testWebDavParentPathWhenGivenCorrectParentShouldReturnOneLevelAbove() {
assertEquals("/Photos/Vacation/", "/Photos/Vacation/beach.jpg".webDavParentPath())
assertEquals("/work/docs/", "/work/docs/notes.txt".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenDeepNestingShouldReturnDirectParent() {
assertEquals("/a/b/c/d/", "/a/b/c/d/e.txt".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenRootFileShouldReturnRoot() {
assertEquals("/", "/image.png".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenSlashShouldReturnRoot() {
assertEquals("/", "/".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenEmptyStringShouldReturnRoot() {
assertEquals("/", "".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenOnlySlashesShouldReturnRoot() {
assertEquals("/", "///".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenRelativePathShouldReturnOneLevelAbove() {
assertEquals("Documents/", "Documents/file.pdf".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenSingleWordPathShouldReturnRoot() {
assertEquals("/", "readme.md".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenTrailingSlashShouldReturnOneLevelAbove() {
assertEquals("/Photos/", "/Photos/Vacation/".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenMultipleTrailingSlashesShouldReturnOneLevelAbove() {
assertEquals("/Photos/", "/Photos/Vacation///".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenEncodedSpacesShouldPreserveEncoding() {
assertEquals("/My%20Photos/", "/My%20Photos/beach%20photo.jpg".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenEncodedSpecialCharsShouldPreserveEncoding() {
assertEquals("/files/%23reports/", "/files/%23reports/q1%262.pdf".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenUnicodeCharsShouldReturnOneLevelAbove() {
assertEquals("/照片/假期/", "/照片/假期/海滩.jpg".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenSingleCharFileAtRootShouldReturnRoot() {
assertEquals("/", "/a".webDavParentPath())
}
@Test
fun testWebDavParentPathWhenGivenSingleCharDirShouldReturnOneLevelAbove() {
assertEquals("/a/", "/a/b".webDavParentPath())
}
}
@@ -218,7 +218,7 @@ public abstract class AbstractIT {
@Before
public void enableAccessibilityChecks() {
androidx.test.espresso.accessibility.AccessibilityChecks.enable().setRunChecksFromRootView(true);
androidx.test.espresso.accessibility.AccessibilityChecks.enable().setRunChecksFromRootView(false);
}
@After
@@ -8,8 +8,6 @@
*/
package com.owncloud.android;
import android.net.Uri;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
@@ -97,12 +95,7 @@ public class DownloadIT extends AbstractOnServerIT {
assertTrue(new File(file1.getStoragePath()).exists());
assertTrue(new File(file2.getStoragePath()).exists());
// test against hardcoded path to make sure that it is correct
assertEquals("/storage/emulated/0/Android/media/"+targetContext.getPackageName()+"/nextcloud/" +
Uri.encode(account.name, "@") + "/testUpload/nonEmpty.txt",
file1.getStoragePath());
assertEquals("/storage/emulated/0/Android/media/"+targetContext.getPackageName()+"/nextcloud/" +
Uri.encode(account.name, "@") + "/testUpload/nonEmpty2.txt",
file2.getStoragePath());
assertEquals(FileStorageUtils.getDefaultSavePathFor(account.name, file1), file1.getStoragePath());
assertEquals(FileStorageUtils.getDefaultSavePathFor(account.name, file2), file2.getStoragePath());
}
}
@@ -32,10 +32,12 @@ import com.owncloud.android.operations.UploadFileOperation
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.MockitoAnnotations
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
import java.io.File
import java.util.Random
import java.util.UUID
@@ -47,6 +49,9 @@ import java.util.function.Supplier
@RunWith(AndroidJUnit4::class)
@SmallTest
class UploadStorageManagerTest : AbstractIT() {
@get:Rule
val mockitoRule: MockitoRule = MockitoJUnit.rule()
private lateinit var uploadsStorageManager: UploadsStorageManager
@Mock
@@ -58,8 +63,6 @@ class UploadStorageManagerTest : AbstractIT() {
@Before
fun setUp() {
MockitoAnnotations.openMocks(this)
val instrumentationCtx = ApplicationProvider.getApplicationContext<Context>()
val contentResolver = instrumentationCtx.contentResolver
uploadsStorageManager = UploadsStorageManager(currentAccountProvider, contentResolver)
@@ -233,7 +236,11 @@ class UploadStorageManagerTest : AbstractIT() {
@After
fun tearDown() {
deleteAllUploads()
userAccountManager.removeUser(user2)
if (::uploadsStorageManager.isInitialized) {
deleteAllUploads()
}
if (::userAccountManager.isInitialized && ::user2.isInitialized) {
userAccountManager.removeUser(user2)
}
}
}
@@ -1,155 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.ui.activity
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.notifications.models.Action
import com.owncloud.android.lib.resources.notifications.models.Notification
import com.owncloud.android.lib.resources.notifications.models.RichObject
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Test
import java.util.GregorianCalendar
class NotificationsActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.NotificationsActivityIT"
@Test
@ScreenshotTest
fun empty() {
launchActivity<NotificationsActivity>().use { scenario ->
scenario.onActivity { sut ->
sut.populateList(ArrayList())
}
val screenShotName = createName(testClassName + "_" + "empty", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@ScreenshotTest
@SuppressWarnings("MagicNumber")
fun showNotifications() {
val date = GregorianCalendar()
date.set(2005, 4, 17, 10, 35, 30) // random date
val notifications = ArrayList<Notification>()
notifications.add(
Notification(
1,
"files",
"user",
date.time,
"objectType",
"objectId",
"App recommendation: Tasks",
"SubjectRich",
HashMap<String, RichObject>(),
"Sync tasks from various devices with your Nextcloud and edit them online.",
"MessageRich",
HashMap<String, RichObject>(),
"link",
"icon",
ArrayList<Action>()
)
)
val actions = ArrayList<Action>().apply {
add(Action("Send usage", "link", "url", true))
add(Action("Not now", "link", "url", false))
}
notifications.add(
Notification(
1,
"files",
"user",
date.time,
"objectType",
"objectId",
"Help improve Nextcloud",
"SubjectRich",
HashMap<String, RichObject>(),
"Do you want to help us to improve Nextcloud" +
" by providing some anonymize data about your setup and usage?",
"MessageRich",
HashMap<String, RichObject>(),
"link",
"icon",
actions
)
)
val moreAction = ArrayList<Action>().apply {
add(Action("Send usage", "link", "url", true))
add(Action("Not now", "link", "url", false))
add(Action("third action", "link", "url", false))
add(Action("Delay", "link", "url", false))
}
notifications.add(
Notification(
2,
"files",
"user",
date.time,
"objectType",
"objectId",
"Help improve Nextcloud",
"SubjectRich",
HashMap<String, RichObject>(),
"Do you want to help us to improve Nextcloud by providing some anonymize data about your setup and " +
"usage?",
"MessageRich",
HashMap<String, RichObject>(),
"link",
"icon",
moreAction
)
)
launchActivity<NotificationsActivity>().use { scenario ->
scenario.onActivity { sut ->
sut.populateList(notifications)
}
val screenShotName = createName(testClassName + "_" + "showNotifications", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@ScreenshotTest
fun error() {
launchActivity<NotificationsActivity>().use { scenario ->
scenario.onActivity { sut ->
sut.setEmptyContent("Error", "Error! Please try again later!")
}
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
}
@@ -142,8 +142,8 @@ class GalleryFragmentIT : AbstractIT() {
.perform(actionOnItemAtPosition<RecyclerView.ViewHolder>(pos, longClickAllThumbnailsInRow()))
}
val checked = galleryFragment.commonAdapter.getCheckedItems()
assertEquals(imageCount, checked.size)
val checked = galleryFragment.commonAdapter?.getCheckedItems()
assertEquals(imageCount, checked?.size)
}
}
@@ -0,0 +1,172 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.ui.fragment
import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.nextcloud.test.GrantStoragePermissionRule.Companion.grant
import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.notifications.models.Action
import com.owncloud.android.lib.resources.notifications.models.Notification
import com.owncloud.android.ui.fragment.notifications.NotificationsFragment
import com.owncloud.android.ui.fragment.notifications.model.NotificationsUIState
import com.owncloud.android.ui.navigation.NavigatorActivity
import com.owncloud.android.ui.navigation.NavigatorScreen
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
import java.util.Date
import java.util.GregorianCalendar
class NotificationsFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.fragment.notifications.NotificationsFragmentIT"
@get:Rule
var storagePermissionRules: TestRule = grant()
private fun buildDate(): Date = GregorianCalendar().apply {
set(2005, 4, 17, 10, 35, 30)
}.time
private fun buildNotificationNoActions(): Notification = Notification(
1,
"files",
"user",
buildDate(),
"objectType",
"objectId",
"App recommendation: Tasks",
"SubjectRich",
HashMap(),
"Sync tasks from various devices with your Nextcloud and edit them online.",
"MessageRich",
HashMap(),
"link",
"icon",
ArrayList()
)
private fun buildNotificationTwoActions(): Notification {
val actions = ArrayList<Action>().apply {
add(Action("Send usage", "link", "url", true))
add(Action("Not now", "link", "url", false))
}
return Notification(
2,
"files",
"user",
buildDate(),
"objectType",
"objectId",
"Help improve Nextcloud",
"SubjectRich",
HashMap(),
"Do you want to help us to improve Nextcloud by providing some anonymize data about your setup and usage?",
"MessageRich",
HashMap(),
"link",
"icon",
actions
)
}
private fun buildNotificationManyActions(): Notification {
val actions = ArrayList<Action>().apply {
add(Action("Send usage", "link", "url", true))
add(Action("Not now", "link", "url", false))
add(Action("Third action", "link", "url", false))
add(Action("Delay", "link", "url", false))
}
return Notification(
3,
"files",
"user",
buildDate(),
"objectType",
"objectId",
"Help improve Nextcloud",
"SubjectRich",
HashMap(),
"Do you want to help us to improve Nextcloud by providing some anonymize data about your setup" +
" and usage?",
"MessageRich",
HashMap(),
"link",
"icon",
actions
)
}
fun buildMockNotifications(): ArrayList<Notification> = ArrayList<Notification>().apply {
add(buildNotificationNoActions())
add(buildNotificationTwoActions())
add(buildNotificationManyActions())
}
@Suppress("ReturnCount")
private fun findFragment(sut: NavigatorActivity): NotificationsFragment? {
val allFragments = sut.supportFragmentManager.fragments
for (f in allFragments) {
if (f is NotificationsFragment) return f
val child = f.childFragmentManager.fragments.filterIsInstance<NotificationsFragment>().firstOrNull()
if (child != null) return child
}
return null
}
private fun launchFragment(name: String, block: NotificationsFragment.() -> Unit) {
val intent = NavigatorActivity.intent(targetContext, NavigatorScreen.Notifications)
.putExtra(NotificationsFragment.EXTRA_INIT_FOR_TESTING, true)
ActivityScenario.launch<NavigatorActivity>(intent).use { scenario ->
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
val fragment = findFragment(sut)
?: throw IllegalStateException("NotificationsFragment not found in NavigatorActivity!")
fragment.block()
}
onView(isRoot()).check(matches(isDisplayed()))
val screenShotName = createName(testClassName + "_" + name, "")
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@ScreenshotTest
fun empty() {
launchFragment("empty") { initForTesting(NotificationsUIState.Empty) }
}
@Test
@ScreenshotTest
fun showNotifications() {
launchFragment("showNotifications") {
initForTesting(NotificationsUIState.Loaded(buildMockNotifications()))
}
}
@Test
@ScreenshotTest
fun error() {
launchFragment("error") {
initForTesting(NotificationsUIState.Error("Error! Please try again later!"))
}
}
}
@@ -1,161 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.ui.trashbin
import android.accounts.Account
import android.accounts.AccountManager
import android.content.Intent
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.owncloud.android.AbstractIT
import com.owncloud.android.MainApp
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Test
class TrashbinActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.trashbin.TrashbinActivityIT"
enum class TestCase {
ERROR,
EMPTY,
FILES
}
@Test
@ScreenshotTest
fun error() {
launchActivity<TrashbinActivity>().use { scenario ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.ERROR)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.loadFolder(
onComplete = { },
onError = { }
)
}
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
fun files() {
launchActivity<TrashbinActivity>().use { scenario ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.FILES)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.loadFolder(
onComplete = { },
onError = { }
)
}
val screenShotName = createName(testClassName + "_" + "files", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
fun empty() {
launchActivity<TrashbinActivity>().use { scenario ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.loadFolder(
onComplete = { },
onError = { }
)
}
val screenShotName = createName(testClassName + "_" + "empty", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
fun loading() {
launchActivity<TrashbinActivity>().use { scenario ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.showInitialLoading()
}
val screenShotName = createName(testClassName + "_" + "loading", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
fun normalUser() {
launchActivity<TrashbinActivity>().use { scenario ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.showUser()
}
val screenShotName = createName(testClassName + "_" + "normalUser", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
fun differentUser() {
val temp = Account("differentUser@https://nextcloud.localhost", MainApp.getAccountType(targetContext))
AccountManager.get(targetContext).apply {
addAccountExplicitly(temp, "password", null)
setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://nextcloud.localhost")
setUserData(temp, AccountUtils.Constants.KEY_USER_ID, "differentUser")
}
val intent = Intent(targetContext, TrashbinActivity::class.java).apply {
putExtra(Intent.EXTRA_USER, "differentUser@https://nextcloud.localhost")
}
launchActivity<TrashbinActivity>().use { scenario ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.showUser()
}
val screenShotName = createName(testClassName + "_" + "differentUser", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
}
@@ -0,0 +1,143 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2020 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.ui.trashbin
import android.accounts.Account
import android.accounts.AccountManager
import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.owncloud.android.AbstractIT
import com.owncloud.android.MainApp
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.ui.navigation.NavigatorActivity
import com.owncloud.android.ui.navigation.NavigatorScreen
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Test
class TrashbinFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.trashbin.TrashbinFragmentIT"
enum class TestCase {
ERROR,
EMPTY,
FILES
}
@Suppress("ReturnCount")
private fun findFragment(sut: NavigatorActivity): TrashbinFragment? {
val allFragments = sut.supportFragmentManager.fragments
for (f in allFragments) {
if (f is TrashbinFragment) return f
val child = f.childFragmentManager.fragments.filterIsInstance<TrashbinFragment>().firstOrNull()
if (child != null) return child
}
return null
}
private fun launchFragment(name: String, block: TrashbinFragment.() -> Unit) {
val intent = NavigatorActivity.intent(targetContext, NavigatorScreen.Trashbin)
ActivityScenario.launch<NavigatorActivity>(intent).use { scenario ->
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
val fragment = findFragment(sut)
?: throw IllegalStateException("TrashbinFragment not found in NavigatorActivity!")
fragment.block()
}
onView(isRoot()).check(matches(isDisplayed()))
val screenShotName = createName(testClassName + "_" + name, "")
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@ScreenshotTest
fun error() {
launchFragment("error") {
val trashbinRepository = TrashbinLocalRepository(TestCase.ERROR)
trashbinPresenter = TrashbinPresenter(trashbinRepository, this)
loadFolder(
onComplete = { },
onError = { }
)
}
}
@Test
@ScreenshotTest
fun files() {
launchFragment("files") {
val trashbinRepository = TrashbinLocalRepository(TestCase.FILES)
trashbinPresenter = TrashbinPresenter(trashbinRepository, this)
loadFolder(
onComplete = { },
onError = { }
)
}
}
@Test
@ScreenshotTest
fun empty() {
launchFragment("empty") {
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
trashbinPresenter = TrashbinPresenter(trashbinRepository, this)
loadFolder(
onComplete = { },
onError = { }
)
}
}
@Test
@ScreenshotTest
fun loading() {
launchFragment("loading") {
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
trashbinPresenter = TrashbinPresenter(trashbinRepository, this)
showInitialLoading()
}
}
@Test
@ScreenshotTest
fun normalUser() {
launchFragment("normalUser") {
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
trashbinPresenter = TrashbinPresenter(trashbinRepository, this)
showUser()
}
}
@Test
@ScreenshotTest
fun differentUser() {
val temp = Account("differentUser@https://nextcloud.localhost", MainApp.getAccountType(targetContext))
AccountManager.get(targetContext).apply {
addAccountExplicitly(temp, "password", null)
setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://nextcloud.localhost")
setUserData(temp, AccountUtils.Constants.KEY_USER_ID, "differentUser")
}
launchFragment("differentUser") {
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
trashbinPresenter = TrashbinPresenter(trashbinRepository, this)
showUser()
}
}
}
@@ -11,7 +11,7 @@ import com.owncloud.android.R
import com.owncloud.android.lib.resources.trashbin.model.TrashbinFile
import com.owncloud.android.ui.trashbin.TrashbinRepository.LoadFolderCallback
class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase) : TrashbinRepository {
class TrashbinLocalRepository(private val testCase: TrashbinFragmentIT.TestCase) : TrashbinRepository {
override fun emptyTrashbin(callback: TrashbinRepository.OperationCallback?) {
TODO("Not yet implemented")
}
@@ -27,9 +27,9 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
@Suppress("MagicNumber")
override fun getFolder(remotePath: String?, callback: LoadFolderCallback?) {
when (testCase) {
TrashbinActivityIT.TestCase.ERROR -> callback?.onError(R.string.trashbin_loading_failed)
TrashbinFragmentIT.TestCase.ERROR -> callback?.onError(R.string.trashbin_loading_failed)
TrashbinActivityIT.TestCase.FILES -> {
TrashbinFragmentIT.TestCase.FILES -> {
val files = ArrayList<TrashbinFile>()
files.add(
TrashbinFile(
@@ -71,7 +71,7 @@ class TrashbinLocalRepository(private val testCase: TrashbinActivityIT.TestCase)
callback?.onSuccess(files)
}
TrashbinActivityIT.TestCase.EMPTY -> callback?.onSuccess(ArrayList<TrashbinFile>())
TrashbinFragmentIT.TestCase.EMPTY -> callback?.onSuccess(ArrayList<TrashbinFile>())
}
}
}
-7
View File
@@ -282,9 +282,6 @@
<activity
android:name=".ui.activity.UserInfoActivity"
android:exported="false" />
<activity
android:name=".ui.activity.NotificationsActivity"
android:exported="false" />
<activity
android:name=".ui.activity.SyncedFoldersActivity"
android:exported="false" />
@@ -595,10 +592,6 @@
<activity
android:name=".ui.activity.UploadListActivity"
android:exported="false" />
<activity
android:name=".ui.trashbin.TrashbinActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:exported="true" />
<activity
android:name="com.nextcloud.client.onboarding.WhatsNewActivity"
android:theme="@style/Theme.ownCloud.noActionBar.Login" />
@@ -17,6 +17,7 @@ import com.nextcloud.client.core.Clock
import com.nextcloud.client.core.ClockImpl
import com.nextcloud.client.database.dao.ArbitraryDataDao
import com.nextcloud.client.database.dao.AssistantDao
import com.nextcloud.client.database.dao.CapabilityDao
import com.nextcloud.client.database.dao.FileDao
import com.nextcloud.client.database.dao.FileSystemDao
import com.nextcloud.client.database.dao.OfflineOperationDao
@@ -39,6 +40,7 @@ import com.nextcloud.client.database.entity.VirtualEntity
import com.nextcloud.client.database.migrations.DatabaseMigrationUtil
import com.nextcloud.client.database.migrations.MIGRATION_88_89
import com.nextcloud.client.database.migrations.MIGRATION_97_98
import com.nextcloud.client.database.migrations.MIGRATION_99_100
import com.nextcloud.client.database.migrations.Migration67to68
import com.nextcloud.client.database.migrations.RoomMigration
import com.nextcloud.client.database.migrations.addLegacyMigrations
@@ -96,6 +98,7 @@ import com.owncloud.android.db.ProviderMeta
AutoMigration(from = 96, to = 97, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
// manual migration used for 97 to 98
AutoMigration(from = 98, to = 99)
// manual migration used for 99 to 100
],
exportSchema = true
)
@@ -112,6 +115,7 @@ abstract class NextcloudDatabase : RoomDatabase() {
abstract fun syncedFolderDao(): SyncedFolderDao
abstract fun assistantDao(): AssistantDao
abstract fun shareDao(): ShareDao
abstract fun capabilityDao(): CapabilityDao
companion object {
const val FIRST_ROOM_DB_VERSION = 65
@@ -134,6 +138,7 @@ abstract class NextcloudDatabase : RoomDatabase() {
.addMigrations(Migration67to68())
.addMigrations(MIGRATION_88_89)
.addMigrations(MIGRATION_97_98)
.addMigrations(MIGRATION_99_100)
.build()
}
return instance!!
@@ -0,0 +1,19 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.client.database.dao
import androidx.room.Dao
import androidx.room.Query
import com.nextcloud.client.database.entity.CapabilityEntity
@Dao
interface CapabilityDao {
@Query("SELECT * FROM capabilities WHERE account = :accountName LIMIT 1")
suspend fun getByAccountName(accountName: String): CapabilityEntity?
}
@@ -11,6 +11,9 @@ import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta
import com.owncloud.android.lib.resources.status.CapabilityBooleanType
import com.owncloud.android.lib.resources.status.E2EVersion
import com.owncloud.android.lib.resources.status.OCCapability
@Entity(tableName = ProviderTableMeta.CAPABILITIES_TABLE_NAME)
data class CapabilityEntity(
@@ -124,13 +127,13 @@ data class CapabilityEntity(
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_SECURITY_GUARD)
val securityGuard: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FORBIDDEN_FILENAME_CHARACTERS)
val forbiddenFileNameCharacters: Int?,
val forbiddenFileNameCharacters: String?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FORBIDDEN_FILENAMES)
val forbiddenFileNames: Int?,
val forbiddenFileNames: String?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FORBIDDEN_FORBIDDEN_FILENAME_EXTENSIONS)
val forbiddenFileNameExtensions: Int?,
val forbiddenFileNameExtensions: String?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FORBIDDEN_FORBIDDEN_FILENAME_BASE_NAMES)
val forbiddenFilenameBaseNames: Int?,
val forbiddenFilenameBaseNames: String?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FILES_DOWNLOAD_LIMIT)
val filesDownloadLimit: Int?,
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_FILES_DOWNLOAD_LIMIT_DEFAULT)
@@ -150,3 +153,85 @@ data class CapabilityEntity(
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_CLIENT_INTEGRATION_JSON)
val clientIntegrationJson: String?
)
@Suppress("LongMethod", "ReturnCount")
fun CapabilityEntity?.toOCCapability(): OCCapability {
val capability = OCCapability()
if (this == null) return capability
val id = this.id ?: return capability
fun intToBoolean(value: Int?): CapabilityBooleanType =
value?.let { CapabilityBooleanType.fromValue(it) } ?: CapabilityBooleanType.UNKNOWN
capability.id = id.toLong()
capability.accountName = this.accountName
capability.versionMayor = this.versionMajor ?: 0
capability.versionMinor = this.versionMinor ?: 0
capability.versionMicro = this.versionMicro ?: 0
capability.versionString = this.versionString
capability.versionEdition = this.versionEditor
capability.extendedSupport = intToBoolean(this.extendedSupport)
capability.corePollInterval = this.corePollinterval ?: 0
capability.filesSharingApiEnabled = intToBoolean(this.sharingApiEnabled)
capability.filesSharingPublicEnabled = intToBoolean(this.sharingPublicEnabled)
capability.filesSharingPublicPasswordEnforced = intToBoolean(this.sharingPublicPasswordEnforced)
capability.filesSharingPublicAskForOptionalPassword = intToBoolean(this.sharingPublicAskForOptionalPassword)
capability.filesSharingPublicExpireDateEnabled = intToBoolean(this.sharingPublicExpireDateEnabled)
capability.filesSharingPublicExpireDateDays = this.sharingPublicExpireDateDays ?: 0
capability.filesSharingPublicExpireDateEnforced = intToBoolean(this.sharingPublicExpireDateEnforced)
capability.filesSharingPublicSendMail = intToBoolean(this.sharingPublicSendMail)
capability.filesSharingPublicUpload = intToBoolean(this.sharingPublicUpload)
capability.filesSharingUserSendMail = intToBoolean(this.sharingUserSendMail)
capability.filesSharingResharing = intToBoolean(this.sharingResharing)
capability.filesSharingFederationOutgoing = intToBoolean(this.sharingFederationOutgoing)
capability.filesSharingFederationIncoming = intToBoolean(this.sharingFederationIncoming)
capability.filesBigFileChunking = intToBoolean(this.filesBigfilechunking)
capability.filesUndelete = intToBoolean(this.filesUndelete)
capability.filesVersioning = intToBoolean(this.filesVersioning)
capability.externalLinks = intToBoolean(this.externalLinks)
capability.serverName = this.serverName
capability.serverColor = this.serverColor
capability.serverTextColor = this.serverTextColor
capability.serverElementColor = this.serverElementColor
capability.serverSlogan = this.serverSlogan
capability.serverLogo = this.serverLogo
capability.serverBackground = this.serverBackgroundUrl
capability.endToEndEncryption = intToBoolean(this.endToEndEncryption)
capability.endToEndEncryptionKeysExist = intToBoolean(this.endToEndEncryptionKeysExist)
capability.endToEndEncryptionApiVersion = this.endToEndEncryptionApiVersion?.let {
E2EVersion.fromValue(it)
} ?: E2EVersion.UNKNOWN
capability.serverBackgroundDefault = intToBoolean(this.serverBackgroundDefault)
capability.serverBackgroundPlain = intToBoolean(this.serverBackgroundPlain)
capability.activity = intToBoolean(this.activity)
capability.richDocuments = intToBoolean(this.richdocument)
capability.richDocumentsDirectEditing = intToBoolean(this.richdocumentDirectEditing)
capability.richDocumentsTemplatesAvailable = intToBoolean(this.richdocumentTemplates)
capability.richDocumentsMimeTypeList = this.richdocumentMimetypeList?.split(",") ?: emptyList()
capability.richDocumentsOptionalMimeTypeList = this.richdocumentOptionalMimetypeList?.split(",") ?: emptyList()
capability.richDocumentsProductName = this.richdocumentProductName
capability.directEditingEtag = this.directEditingEtag
capability.etag = this.etag
capability.userStatus = intToBoolean(this.userStatus)
capability.userStatusSupportsEmoji = intToBoolean(this.userStatusSupportsEmoji)
capability.userStatusSupportsBusy = intToBoolean(this.userStatusSupportsBusy)
capability.filesLockingVersion = this.filesLockingVersion
capability.assistant = intToBoolean(this.assistant)
capability.groupfolders = intToBoolean(this.groupfolders)
capability.dropAccount = intToBoolean(this.dropAccount)
capability.securityGuard = intToBoolean(this.securityGuard)
capability.forbiddenFilenameCharactersJson = this.forbiddenFileNameCharacters
capability.forbiddenFilenamesJson = this.forbiddenFileNames
capability.forbiddenFilenameExtensionJson = this.forbiddenFileNameExtensions
capability.forbiddenFilenameBaseNamesJson = this.forbiddenFilenameBaseNames
capability.isWCFEnabled = intToBoolean(this.isWCFEnabled)
capability.filesDownloadLimit = intToBoolean(this.filesDownloadLimit)
capability.filesDownloadLimitDefault = this.filesDownloadLimitDefault ?: 0
capability.recommendations = intToBoolean(this.recommendation)
capability.notesFolderPath = this.notesFolderPath
capability.defaultPermissions = this.defaultPermissions ?: 0
capability.hasValidSubscription = intToBoolean(this.hasValidSubscription)
capability.clientIntegrationJson = this.clientIntegrationJson
return capability
}
@@ -0,0 +1,92 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.client.database.migrations
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
@Suppress("MagicNumber", "LongMethod")
val MIGRATION_99_100 = object : Migration(99, 100) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("DROP TABLE IF EXISTS capabilities")
db.execSQL(
"""
CREATE TABLE IF NOT EXISTS capabilities (
_id INTEGER PRIMARY KEY AUTOINCREMENT,
account TEXT,
version_mayor INTEGER,
version_minor INTEGER,
version_micro INTEGER,
version_string TEXT,
version_edition TEXT,
extended_support INTEGER,
core_pollinterval INTEGER,
sharing_api_enabled INTEGER,
sharing_public_enabled INTEGER,
sharing_public_password_enforced INTEGER,
sharing_public_ask_for_optional_password INTEGER,
sharing_public_expire_date_enabled INTEGER,
sharing_public_expire_date_days INTEGER,
sharing_public_expire_date_enforced INTEGER,
sharing_public_send_mail INTEGER,
sharing_public_upload INTEGER,
sharing_user_send_mail INTEGER,
sharing_resharing INTEGER,
sharing_federation_outgoing INTEGER,
sharing_federation_incoming INTEGER,
files_bigfilechunking INTEGER,
files_undelete INTEGER,
files_versioning INTEGER,
files_locking_version TEXT,
external_links INTEGER,
server_name TEXT,
server_color TEXT,
server_text_color TEXT,
server_element_color TEXT,
background_url TEXT,
server_slogan TEXT,
server_logo TEXT,
background_default INTEGER,
background_plain INTEGER,
end_to_end_encryption INTEGER,
end_to_end_encryption_keys_exist INTEGER,
end_to_end_encryption_api_version TEXT,
activity INTEGER,
richdocument INTEGER,
recommendation INTEGER,
richdocument_mimetype_list TEXT,
richdocument_optional_mimetype_list TEXT,
richdocument_direct_editing INTEGER,
richdocument_direct_templates INTEGER,
richdocument_product_name TEXT,
direct_editing_etag TEXT,
etag TEXT,
user_status INTEGER,
user_status_supports_emoji INTEGER,
user_status_supports_busy INTEGER,
assistant INTEGER,
groupfolders INTEGER,
drop_account INTEGER,
security_guard INTEGER,
forbidden_filename_characters TEXT,
forbidden_filenames TEXT,
forbidden_filename_extensions TEXT,
forbidden_filename_basenames TEXT,
windows_compatible_filenames INTEGER,
files_download_limit INTEGER,
files_download_limit_default INTEGER,
notes_folder_path TEXT,
default_permissions INTEGER,
has_valid_subscription INTEGER,
client_integration_json TEXT
)
""".trimIndent()
)
}
}
@@ -61,7 +61,6 @@ import com.owncloud.android.ui.activity.FolderPickerActivity;
import com.owncloud.android.ui.activity.InternalTwoWaySyncActivity;
import com.owncloud.android.ui.activity.ManageAccountsActivity;
import com.owncloud.android.ui.activity.ManageSpaceActivity;
import com.owncloud.android.ui.activity.NotificationsActivity;
import com.owncloud.android.ui.activity.PassCodeActivity;
import com.owncloud.android.ui.activity.ReceiveExternalFilesActivity;
import com.owncloud.android.ui.activity.RequestCredentialsActivity;
@@ -118,6 +117,7 @@ import com.owncloud.android.ui.fragment.UnifiedSearchFragment;
import com.owncloud.android.ui.fragment.community.CommunityFragment;
import com.owncloud.android.ui.fragment.contactsbackup.BackupFragment;
import com.owncloud.android.ui.fragment.contactsbackup.BackupListFragment;
import com.owncloud.android.ui.fragment.notifications.NotificationsFragment;
import com.owncloud.android.ui.navigation.NavigatorActivity;
import com.owncloud.android.ui.preview.FileDownloadFragment;
import com.owncloud.android.ui.preview.PreviewBitmapActivity;
@@ -129,7 +129,7 @@ import com.owncloud.android.ui.preview.PreviewTextFileFragment;
import com.owncloud.android.ui.preview.PreviewTextFragment;
import com.owncloud.android.ui.preview.PreviewTextStringFragment;
import com.owncloud.android.ui.preview.pdf.PreviewPdfFragment;
import com.owncloud.android.ui.trashbin.TrashbinActivity;
import com.owncloud.android.ui.trashbin.TrashbinFragment;
import androidx.annotation.OptIn;
import androidx.media3.common.util.UnstableApi;
@@ -141,9 +141,15 @@ import dagger.android.ContributesAndroidInjector;
*/
@Module
abstract class ComponentsModule {
@ContributesAndroidInjector
abstract TrashbinFragment trashbinFragment();
@ContributesAndroidInjector
abstract ActivitiesFragment activitiesFragment();
@ContributesAndroidInjector
abstract NotificationsFragment notificationFragment();
@ContributesAndroidInjector
abstract AuthenticatorActivity authenticatorActivity();
@@ -192,9 +198,6 @@ abstract class ComponentsModule {
@ContributesAndroidInjector
abstract ManageSpaceActivity manageSpaceActivity();
@ContributesAndroidInjector
abstract NotificationsActivity notificationsActivity();
@ContributesAndroidInjector
abstract ComposeActivity composeActivity();
@@ -225,9 +228,6 @@ abstract class ComponentsModule {
@ContributesAndroidInjector
abstract SyncedFoldersActivity syncedFoldersActivity();
@ContributesAndroidInjector
abstract TrashbinActivity trashbinActivity();
@ContributesAndroidInjector
abstract TrashbinFileActionsBottomSheet trashbinFileActionsBottomSheet();
@@ -36,6 +36,7 @@ import com.nextcloud.client.preferences.AppPreferences
import com.owncloud.android.datamodel.ArbitraryDataProvider
import com.owncloud.android.datamodel.SyncedFolderProvider
import com.owncloud.android.datamodel.UploadsStorageManager
import com.owncloud.android.operations.factory.UploadFileOperationFactory
import com.owncloud.android.utils.theme.ViewThemeUtils
import org.greenrobot.eventbus.EventBus
import javax.inject.Inject
@@ -66,7 +67,8 @@ class BackgroundJobFactory @Inject constructor(
private val localBroadcastManager: Provider<LocalBroadcastManager>,
private val generatePdfUseCase: GeneratePDFUseCase,
private val syncedFolderProvider: SyncedFolderProvider,
private val database: NextcloudDatabase
private val database: NextcloudDatabase,
private val uploadFileOperationFactory: UploadFileOperationFactory
) : WorkerFactory() {
@SuppressLint("NewApi")
@@ -247,6 +249,7 @@ class BackgroundJobFactory @Inject constructor(
FileSystemRepository(dao = database.fileSystemDao(), uploadsStorageManager, context),
syncedFolderProvider,
context,
uploadFileOperationFactory,
params
)
@@ -40,7 +40,7 @@ import com.owncloud.android.lib.resources.notifications.DeleteNotificationRemote
import com.owncloud.android.lib.resources.notifications.GetNotificationRemoteOperation
import com.owncloud.android.lib.resources.notifications.models.Notification
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.ui.activity.NotificationsActivity
import com.owncloud.android.ui.navigation.NavigatorActivity
import com.owncloud.android.ui.notifications.NotificationUtils
import com.owncloud.android.utils.PushUtils
import com.owncloud.android.utils.theme.ViewThemeUtils
@@ -137,7 +137,7 @@ class NotificationWork constructor(
} else {
val intent: Intent
if (file == null) {
intent = Intent(context, NotificationsActivity::class.java)
intent = Intent(context, NavigatorActivity::class.java)
} else {
intent = Intent(context, FileDisplayActivity::class.java)
intent.action = Intent.ACTION_VIEW
@@ -72,8 +72,14 @@ class OfflineSyncWork(
if (files != null) {
for (file in files) {
val ocFile = storageManager.getFileByLocalPath(file.path)
val remotePath = ocFile?.remotePath
if (remotePath == null) {
Log_OC.w(TAG, "remote path is null can't sync")
continue
}
val synchronizeFileOperation = SynchronizeFileOperation(
ocFile?.remotePath,
remotePath,
user,
true,
context,
@@ -8,11 +8,17 @@
package com.nextcloud.client.jobs.gallery
import android.graphics.Bitmap
import android.graphics.Point
import android.media.ThumbnailUtils
import android.os.Build
import android.provider.MediaStore
import android.util.Size
import android.view.WindowManager
import android.widget.ImageView
import androidx.core.content.ContextCompat
import com.nextcloud.client.account.User
import com.nextcloud.utils.allocationKilobyte
import com.nextcloud.utils.extensions.isPNG
import com.nextcloud.utils.extensions.toFile
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.datamodel.FileDataStorageManager
@@ -20,6 +26,7 @@ import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.datamodel.ThumbnailsCacheManager
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.utils.BitmapUtils
import com.owncloud.android.utils.MimeTypeUtil
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -29,15 +36,12 @@ import kotlinx.coroutines.withContext
import java.util.Collections
import java.util.WeakHashMap
@Suppress("DEPRECATION", "TooGenericExceptionCaught", "ReturnCount")
class GalleryImageGenerationJob(private val user: User, private val storageManager: FileDataStorageManager) {
companion object {
private const val TAG = "GalleryImageGenerationJob"
private val semaphore = Semaphore(
maxOf(
3,
Runtime.getRuntime().availableProcessors() / 2
)
)
private val semaphore = Semaphore(maxOf(3, Runtime.getRuntime().availableProcessors() / 2))
private val activeJobs = Collections.synchronizedMap(WeakHashMap<ImageView, Job>())
fun cancelAllActiveJobs() {
@@ -83,57 +87,114 @@ class GalleryImageGenerationJob(private val user: User, private val storageManag
}
}
@Suppress("TooGenericExceptionCaught")
suspend fun run(file: OCFile, imageView: ImageView, listener: GalleryImageGenerationListener) {
try {
var newImage = false
if (file.remoteId == null && !file.isPreviewAvailable) {
Log_OC.e(TAG, "file has no remoteId and no preview")
withContext(Dispatchers.Main) {
listener.onError()
}
withContext(Dispatchers.Main) { listener.onError() }
return
}
val bitmap: Bitmap? = getBitmap(file, onThumbnailGeneration = {
newImage = true
})
var newImage = false
val bitmap: Bitmap? = getBitmap(file, onNewThumbnail = { newImage = true })
if (bitmap == null) {
withContext(Dispatchers.Main) {
listener.onError()
}
withContext(Dispatchers.Main) { listener.onError() }
return
}
setThumbnail(bitmap, file, imageView, newImage, listener)
} catch (_: Exception) {
withContext(Dispatchers.Main) {
listener.onError()
}
withContext(Dispatchers.Main) { listener.onError() }
}
}
private suspend fun getBitmap(file: OCFile, onThumbnailGeneration: () -> Unit): Bitmap? =
withContext(Dispatchers.IO) {
val key = file.remoteId
val cachedThumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(
ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + file.remoteId
)
if (cachedThumbnail != null && !file.isUpdateThumbnailNeeded) {
Log_OC.d(TAG, "cached thumbnail is used for: ${file.fileName}")
return@withContext getThumbnailFromCache(file, cachedThumbnail, key)
}
private suspend fun getBitmap(file: OCFile, onNewThumbnail: () -> Unit): Bitmap? = withContext(Dispatchers.IO) {
val cacheKey = ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + file.remoteId
Log_OC.d(TAG, "generating new thumbnail for: ${file.fileName}")
onThumbnailGeneration()
semaphore.withPermit {
return@withContext getThumbnailFromServerAndAddToCache(file, cachedThumbnail)
}
val cached = ThumbnailsCacheManager.getBitmapFromDiskCache(cacheKey)
if (cached != null && !file.isUpdateThumbnailNeeded) {
return@withContext applyVideoOverlayIfNeeded(file, cached)
}
onNewThumbnail()
val local = decodeLocalThumbnail(file)
if (local != null) {
ThumbnailsCacheManager.addBitmapToCache(cacheKey, local)
return@withContext applyVideoOverlayIfNeeded(file, local)
}
val remote = semaphore.withPermit { fetchFromServer(file) }
if (remote != null) {
return@withContext applyVideoOverlayIfNeeded(file, remote)
}
null
}
private fun decodeLocalThumbnail(file: OCFile): Bitmap? = if (MimeTypeUtil.isVideo(file)) {
createVideoThumbnail(file.storagePath)
} else {
createImageThumbnail(file)
}
private fun createImageThumbnail(file: OCFile): Bitmap? {
val wm = MainApp.getAppContext().getSystemService(android.content.Context.WINDOW_SERVICE) as WindowManager
val p = Point()
wm.defaultDisplay.getSize(p)
val pxW = p.x
val pxH = p.y
val cacheKey = ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE + file.remoteId
var bitmap = BitmapUtils.decodeSampledBitmapFromFile(file.storagePath, pxW, pxH) ?: return null
if (file.isPNG()) {
bitmap = ThumbnailsCacheManager.handlePNG(bitmap, pxW, pxH)
}
val thumbnail = ThumbnailsCacheManager.addThumbnailToCache(cacheKey, bitmap, file.storagePath, pxW, pxH)
file.isUpdateThumbnailNeeded = false
return thumbnail
}
private fun createVideoThumbnail(storagePath: String): Bitmap? {
val ioFile = storagePath.toFile() ?: return null
val size = ThumbnailsCacheManager.getThumbnailDimension()
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
try {
ThumbnailUtils.createVideoThumbnail(ioFile, Size(size, size), null)
} catch (e: Exception) {
Log_OC.e(TAG, "Failed to create video thumbnail from local file: ${e.message}")
null
}
} else {
@Suppress("DEPRECATION")
ThumbnailUtils.createVideoThumbnail(storagePath, MediaStore.Images.Thumbnails.MINI_KIND)
}
}
private suspend fun fetchFromServer(file: OCFile): Bitmap? = try {
val client = withContext(Dispatchers.IO) {
OwnCloudClientManagerFactory.getDefaultSingleton()
.getClientFor(user.toOwnCloudAccount(), MainApp.getAppContext())
}
ThumbnailsCacheManager.setClient(client)
ThumbnailsCacheManager.doResizedImageInBackground(file, storageManager)
} catch (t: Throwable) {
Log_OC.e(TAG, "Server fetch failed for $file", t)
null
}
private fun applyVideoOverlayIfNeeded(file: OCFile, bitmap: Bitmap): Bitmap = if (MimeTypeUtil.isVideo(file)) {
ThumbnailsCacheManager.addVideoOverlay(bitmap, MainApp.getAppContext())
} else {
bitmap
}
private suspend fun setThumbnail(
bitmap: Bitmap,
file: OCFile,
@@ -146,16 +207,11 @@ class GalleryImageGenerationJob(private val user: User, private val storageManag
if (imageView.tag.toString() == tagId) {
if (file.isPNG()) {
imageView.setBackgroundColor(
ContextCompat.getColor(
MainApp.getAppContext(),
R.color.bg_default
)
ContextCompat.getColor(MainApp.getAppContext(), R.color.bg_default)
)
}
if (newImage) {
listener.onNewGalleryImage()
}
if (newImage) listener.onNewGalleryImage()
if (imageView.isAttachedToWindow) {
imageView.setImageBitmap(bitmap)
@@ -165,40 +221,4 @@ class GalleryImageGenerationJob(private val user: User, private val storageManag
listener.onSuccess()
}
private fun getThumbnailFromCache(file: OCFile, thumbnail: Bitmap, key: String): Bitmap {
var result = thumbnail
if (MimeTypeUtil.isVideo(file)) {
result = ThumbnailsCacheManager.addVideoOverlay(thumbnail, MainApp.getAppContext())
}
if (thumbnail.allocationKilobyte() > ThumbnailsCacheManager.THUMBNAIL_SIZE_IN_KB) {
result = ThumbnailsCacheManager.getScaledThumbnailAfterSave(result, key)
}
return result
}
@Suppress("DEPRECATION", "TooGenericExceptionCaught")
private suspend fun getThumbnailFromServerAndAddToCache(file: OCFile, thumbnail: Bitmap?): Bitmap? {
var thumbnail = thumbnail
try {
val client = withContext(Dispatchers.IO) {
OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(
user.toOwnCloudAccount(),
MainApp.getAppContext()
)
}
ThumbnailsCacheManager.setClient(client)
thumbnail = ThumbnailsCacheManager.doResizedImageInBackground(file, storageManager)
if (MimeTypeUtil.isVideo(file) && thumbnail != null) {
thumbnail = ThumbnailsCacheManager.addVideoOverlay(thumbnail, MainApp.getAppContext())
}
} catch (t: Throwable) {
Log_OC.e(TAG, "Generation of gallery image for $file failed", t)
}
return thumbnail
}
}
@@ -25,7 +25,9 @@ import com.nextcloud.client.network.ConnectivityService
import com.nextcloud.client.notifications.AppWideNotificationManager
import com.nextcloud.utils.extensions.checkWCFRestrictions
import com.nextcloud.utils.extensions.getUploadIds
import com.nextcloud.utils.extensions.isAnonymous
import com.nextcloud.utils.extensions.isLastResultConflictError
import com.nextcloud.utils.extensions.isSame
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.datamodel.FileDataStorageManager
@@ -36,6 +38,7 @@ import com.owncloud.android.db.OCUpload
import com.owncloud.android.db.UploadResult
import com.owncloud.android.files.services.NameCollisionPolicy
import com.owncloud.android.lib.common.OwnCloudClient
import com.owncloud.android.lib.common.OwnCloudClientFactory
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener
import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.lib.common.utils.Log_OC
@@ -45,8 +48,9 @@ import com.owncloud.android.lib.resources.files.model.ServerFileInterface
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.operations.RemoveFileOperation
import com.owncloud.android.operations.UploadFileOperation
import com.owncloud.android.ui.adapter.uploadList.helper.ConflictHandlingResult
import com.owncloud.android.ui.adapter.uploadList.helper.UploadListAdapterActionHandler
import com.owncloud.android.utils.DisplayUtils
import com.owncloud.android.utils.FileUtil
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -167,25 +171,36 @@ class FileUploadHelper {
}
@Suppress("ComplexCondition")
private fun retryUploads(
private suspend fun retryUploads(
uploadsStorageManager: UploadsStorageManager,
connectivityService: ConnectivityService,
accountManager: UserAccountManager,
powerManagementService: PowerManagementService,
uploads: List<OCUpload>
): Boolean {
): Boolean = withContext(Dispatchers.IO) {
var showNotExistMessage = false
var showSyncConflictNotification = false
var conflictHandlingResult: ConflictHandlingResult? = null
val isOnline = checkConnectivity(connectivityService)
val connectivity = connectivityService.connectivity
val batteryStatus = powerManagementService.battery
val uploadsToRetry = mutableListOf<Long>()
val currentAccount = accountManager.currentAccount
val context = MainApp.getAppContext()
var ownCloudClient: OwnCloudClient? = null
if (!currentAccount.isAnonymous(context)) {
ownCloudClient =
OwnCloudClientFactory.createOwnCloudClient(accountManager.currentAccount, MainApp.getAppContext())
}
val uploadActionHandler = UploadListAdapterActionHandler()
for (upload in uploads) {
if (upload.isLastResultConflictError()) {
Log_OC.d(TAG, "retry upload skipped, sync conflict: ${upload.remotePath}")
showSyncConflictNotification = true
ownCloudClient?.let {
conflictHandlingResult =
uploadActionHandler.handleConflict(upload, ownCloudClient, uploadsStorageManager)
}
continue
}
@@ -226,11 +241,12 @@ class FileUploadHelper {
)
}
if (showSyncConflictNotification) {
if (conflictHandlingResult is ConflictHandlingResult.ShowConflictResolveDialog) {
Log_OC.d(TAG, "retry upload skipped, sync conflict: ${conflictHandlingResult.file.remotePath}")
AppWideNotificationManager.showSyncConflictNotification(MainApp.getAppContext())
}
return showNotExistMessage
return@withContext showNotExistMessage
}
@JvmOverloads
@@ -563,25 +579,17 @@ class FileUploadHelper {
}
@Suppress("MagicNumber", "ReturnCount", "ComplexCondition")
fun isSameFileOnRemote(user: User?, localFile: File?, remotePath: String?, context: Context?): Boolean {
if (user == null || localFile == null || remotePath == null || context == null) {
fun isSameFileOnRemote(user: User?, localPath: String?, remotePath: String?, context: Context?): Boolean {
if (user == null || localPath == null || remotePath == null || context == null) {
Log_OC.e(TAG, "cannot compare remote and local file")
return false
}
// Compare remote file to local file
val localLastModifiedTimestamp = localFile.lastModified() / 1000 // remote file timestamp in milli not micro sec
val localCreationTimestamp = FileUtil.getCreationTimestamp(localFile)
val localSize: Long = localFile.length()
val operation = ReadFileRemoteOperation(remotePath)
val result: RemoteOperationResult<*> = operation.execute(user, context)
if (result.isSuccess) {
val remoteFile = result.data[0] as RemoteFile
return remoteFile.size == localSize &&
localCreationTimestamp != null &&
localCreationTimestamp == remoteFile.creationTimestamp &&
remoteFile.modifiedTimestamp == localLastModifiedTimestamp * 1000
return remoteFile.isSame(localPath)
}
return false
}
@@ -648,7 +656,6 @@ class FileUploadHelper {
files: List<OCFile>,
accountName: String
): Pair<List<SyncedFolderEntity>, List<OCFile>> {
val autoUploadFolders = mutableListOf<SyncedFolderEntity>()
val nonAutoUploadFiles = mutableListOf<OCFile>()
@@ -29,7 +29,6 @@ import com.nextcloud.utils.extensions.getPercent
import com.nextcloud.utils.extensions.toFile
import com.nextcloud.utils.extensions.updateStatus
import com.owncloud.android.R
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.ForegroundServiceType
import com.owncloud.android.datamodel.SyncedFolder
import com.owncloud.android.datamodel.SyncedFolderProvider
@@ -44,6 +43,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.operations.UploadFileOperation
import com.owncloud.android.operations.factory.UploadFileOperationFactory
import com.owncloud.android.ui.notifications.NotificationUtils
import com.owncloud.android.utils.theme.ViewThemeUtils
import kotlinx.coroutines.Dispatchers
@@ -66,6 +66,7 @@ class FileUploadWorker(
val filesystemRepository: FileSystemRepository,
val syncedFolderProvider: SyncedFolderProvider,
val context: Context,
val uploadFileOperationFactory: UploadFileOperationFactory,
params: WorkerParameters
) : CoroutineWorker(context, params),
OnDatatransferProgressListener {
@@ -270,7 +271,7 @@ class FileUploadWorker(
}
fileUploadEventBroadcaster.sendUploadEnqueued(context)
val operation = createUploadFileOperation(upload, user)
val operation = uploadFileOperationFactory.create(context, upload, this@FileUploadWorker)
activeOperations[upload.uploadId] = operation
val currentIndex = (index + 1)
@@ -299,6 +300,7 @@ class FileUploadWorker(
return@withContext Result.success()
}
@Suppress("ReturnCount")
suspend fun isBelongToAnySyncedFolder(
upload: OCUpload,
syncFolderHelper: SyncFolderHelper,
@@ -348,24 +350,6 @@ class FileUploadWorker(
return result
}
private fun createUploadFileOperation(upload: OCUpload, user: User): UploadFileOperation = UploadFileOperation(
uploadsStorageManager,
connectivityService,
powerManagementService,
user,
null,
upload,
upload.nameCollisionPolicy,
upload.localAction,
context,
upload.isUseWifiOnly,
upload.isWhileChargingOnly,
true,
FileDataStorageManager(user, context.contentResolver)
).apply {
addDataTransferProgressListener(this@FileUploadWorker)
}
@Suppress("TooGenericExceptionCaught", "DEPRECATION")
private suspend fun upload(
upload: OCUpload,
@@ -8,6 +8,7 @@
package com.nextcloud.client.jobs.utils
import android.app.Notification
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
@@ -28,11 +29,15 @@ import com.owncloud.android.ui.activity.ConflictsResolveActivity
import com.owncloud.android.utils.ErrorMessageAdapter
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.File
object UploadErrorNotificationManager {
private const val TAG = "UploadErrorNotificationManager"
fun dismissConflictResolveNotification(context: Context, id: Long) {
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
manager.cancel(id.toInt())
}
/**
* Processes the result of an upload operation and manages error notifications.
* * It filters out successful or silent results and handles [ResultCode.SYNC_CONFLICT], [ResultCode.CONFLICT]
@@ -76,7 +81,7 @@ object UploadErrorNotificationManager {
val isSameFile = withContext(Dispatchers.IO) {
FileUploadHelper.instance().isSameFileOnRemote(
operation.user,
File(operation.storagePath),
operation.storagePath,
operation.remotePath,
context
)
@@ -10,6 +10,7 @@ package com.nextcloud.ui.fileactions
import android.content.Context
import android.content.Intent
import android.graphics.Canvas
import android.graphics.drawable.Drawable
import android.graphics.drawable.PictureDrawable
import android.os.Bundle
import android.view.LayoutInflater
@@ -81,48 +82,60 @@ class ClientIntegration(
}
text.text = endpoint.name
if (endpoint.icon != null) {
sheet.lifecycleScope.launch(Dispatchers.IO) {
val client = OwnCloudClientManagerFactory.getDefaultSingleton()
.getNextcloudClientFor(user.toOwnCloudAccount(), context)
sheet.lifecycleScope.launch(Dispatchers.IO) {
val client = OwnCloudClientManagerFactory.getDefaultSingleton()
.getNextcloudClientFor(user.toOwnCloudAccount(), context)
val drawable =
GlideHelper.getDrawable(context, client, client.baseUri.toString() + endpoint.icon)
?.mutate()
val rawDrawable = if (endpoint.icon != null) {
GlideHelper.getDrawable(context, client, client.baseUri.toString() + endpoint.icon)?.mutate()
} else {
null
}
val px = DisplayUtils.convertDpToPixel(
context.resources.getDimension(R.dimen.iconized_single_line_item_icon_size),
context
)
val returnedBitmap =
createBitmap(drawable?.intrinsicWidth ?: px, drawable?.intrinsicHeight ?: px)
val tintableDrawable = prepareDrawableForTinting(rawDrawable) ?: getDefaultIconDrawable()
val canvas = Canvas(returnedBitmap)
canvas.drawPicture((drawable as PictureDrawable).picture)
val d = returnedBitmap.toDrawable(context.resources)
val tintedDrawable = viewThemeUtils.platform.tintDrawable(
context,
d
)
withContext(Dispatchers.Main) {
icon.setImageDrawable(tintedDrawable)
withContext(Dispatchers.Main) {
tintableDrawable?.let {
val tinted = viewThemeUtils.platform.tintDrawable(context, it)
icon.setImageDrawable(tinted)
}
}
} else {
val tintedDrawable = viewThemeUtils.platform.tintDrawable(
context,
AppCompatResources.getDrawable(context, R.drawable.ic_activity)!!
)
icon.setImageDrawable(tintedDrawable)
}
}
return itemBinding.root
}
@Suppress("ReturnCount")
private fun prepareDrawableForTinting(drawable: Drawable?): Drawable? {
if (drawable == null) {
return null
}
if (drawable is PictureDrawable) {
val defaultSize = DisplayUtils.convertDpToPixel(
context.resources.getDimension(R.dimen.iconized_single_line_item_icon_size),
context
).toInt().coerceAtLeast(1)
val width = if (drawable.intrinsicWidth > 0) drawable.intrinsicWidth else defaultSize
val height = if (drawable.intrinsicHeight > 0) drawable.intrinsicHeight else defaultSize
val safeWidth = width.coerceAtLeast(1)
val safeHeight = height.coerceAtLeast(1)
val bitmap = createBitmap(safeWidth, safeHeight)
val canvas = Canvas(bitmap)
canvas.drawPicture(drawable.picture)
return bitmap.toDrawable(context.resources)
}
return drawable
}
private fun getDefaultIconDrawable(): Drawable? = AppCompatResources.getDrawable(context, R.drawable.ic_activity)
private fun requestClientIntegration(endpoint: Endpoint, fileId: String, filePath: String) {
sheet.lifecycleScope.launch(Dispatchers.IO) {
val client = OwnCloudClientManagerFactory.getDefaultSingleton()
@@ -124,8 +124,6 @@ enum class FileAction(
R.id.action_lock_file,
R.id.action_unlock_file,
R.id.action_edit,
R.id.action_favorite,
R.id.action_unset_favorite,
R.id.action_see_details,
R.id.action_move_or_copy,
R.id.action_stream_media,
@@ -18,6 +18,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.annotation.IdRes
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.os.BundleCompat
import androidx.core.os.bundleOf
import androidx.core.view.isEmpty
import androidx.core.view.isVisible
@@ -102,7 +103,9 @@ class FileActionsBottomSheet :
viewModel.load(requireArguments(), componentsGetter)
endpoints = arguments?.getParcelableArrayList(FileActionsViewModel.ARG_ENDPOINTS)
endpoints = arguments?.let { bundle ->
BundleCompat.getParcelableArrayList(bundle, FileActionsViewModel.ARG_ENDPOINTS, Endpoint::class.java)
} ?: mutableListOf()
val bottomSheetDialog = dialog as BottomSheetDialog
bottomSheetDialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED
@@ -368,7 +371,7 @@ class FileActionsBottomSheet :
FileActionsViewModel.ARG_FILES to ArrayList<OCFile>(files),
FileActionsViewModel.ARG_IS_OVERFLOW to isOverflow,
FileActionsViewModel.ARG_IN_SINGLE_FILE_FRAGMENT to inSingleFileFragment,
FileActionsViewModel.ARG_ENDPOINTS to endpoints
FileActionsViewModel.ARG_ENDPOINTS to java.util.ArrayList(endpoints)
)
additionalToHide?.let {
argsBundle.putIntArray(FileActionsViewModel.ARG_ADDITIONAL_FILTER, additionalToHide.toIntArray())
@@ -9,7 +9,7 @@ package com.nextcloud.utils
import com.owncloud.android.BuildConfig
object BuildHelper {
const val GPLAY: String = "gplay"
fun isFlavourGPlay(): Boolean = BuildConfig.FLAVOR == "gplay"
fun isFlavourGPlay(): Boolean = GPLAY == BuildConfig.FLAVOR
fun isHuaweiFlavor(): Boolean = BuildConfig.FLAVOR == "huawei"
}
@@ -11,7 +11,8 @@ import android.graphics.drawable.BitmapDrawable
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.toBitmap
import androidx.core.graphics.drawable.toDrawable
import androidx.exifinterface.media.ExifInterface
import com.nextcloud.utils.extensions.getBitmapSize
import com.nextcloud.utils.extensions.getExifSize
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
@@ -41,8 +42,8 @@ object OCFileUtils {
// Local file
val path = ocFile.storagePath
if (!path.isNullOrEmpty() && ocFile.exists()) {
getExifSize(path)?.let { return it }
getBitmapSize(path)?.let { return it }
path.getExifSize()?.let { return it }
path.getBitmapSize()?.let { return it }
}
// 3 Fallback
@@ -55,41 +56,6 @@ object OCFileUtils {
return fallbackPair
}
private fun getExifSize(path: String): Pair<Int, Int>? = try {
val exif = ExifInterface(path)
var w = exif.getAttributeInt(ExifInterface.TAG_IMAGE_WIDTH, 0)
var h = exif.getAttributeInt(ExifInterface.TAG_IMAGE_LENGTH, 0)
val orientation = exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL
)
if (orientation == ExifInterface.ORIENTATION_ROTATE_90 ||
orientation == ExifInterface.ORIENTATION_ROTATE_270
) {
val tmp = w
w = h
h = tmp
}
Log_OC.d(TAG, "Using exif imageDimension: $w x $h")
if (w > 0 && h > 0) w to h else null
} catch (_: Exception) {
null
}
private fun getBitmapSize(path: String): Pair<Int, Int>? = try {
val options = android.graphics.BitmapFactory.Options().apply { inJustDecodeBounds = true }
android.graphics.BitmapFactory.decodeFile(path, options)
val w = options.outWidth
val h = options.outHeight
Log_OC.d(TAG, "Using bitmap factory imageDimension: $w x $h")
if (w > 0 && h > 0) w to h else null
} catch (_: Exception) {
null
}
fun getMediaPlaceholder(file: OCFile, imageDimension: Pair<Int, Int>): BitmapDrawable {
val context = MainApp.getAppContext()
@@ -7,9 +7,11 @@
package com.nextcloud.utils.extensions
import com.nextcloud.client.database.entity.toOCCapability
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.resources.shares.OCShare
import com.owncloud.android.lib.resources.status.OCCapability
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@@ -48,3 +50,6 @@ fun FileDataStorageManager.getNonEncryptedSubfolders(id: Long, accountName: Stri
fileDao.getNonEncryptedSubfolders(id, accountName).map {
createFileInstance(it)
}
suspend fun FileDataStorageManager.getCapabilitiesByAccountName(accountName: String): OCCapability =
capabilityDao.getByAccountName(accountName).toOCCapability()
@@ -7,6 +7,7 @@
package com.nextcloud.utils.extensions
import androidx.exifinterface.media.ExifInterface
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.utils.DisplayUtils
@@ -36,7 +37,7 @@ fun Path.toLocalPath(): String = toAbsolutePath().toString()
* @return [File] instance if the file exists, or `null` if the path is null, empty, or non-existent.
*/
@Suppress("ReturnCount")
fun String.toFile(): File? {
fun String?.toFile(): File? {
if (isNullOrEmpty()) {
Log_OC.w(TAG, "given path is null or empty: $this")
return null
@@ -50,3 +51,38 @@ fun String.toFile(): File? {
return file
}
fun String.getExifSize(): Pair<Int, Int>? = try {
val exif = ExifInterface(this)
var w = exif.getAttributeInt(ExifInterface.TAG_IMAGE_WIDTH, 0)
var h = exif.getAttributeInt(ExifInterface.TAG_IMAGE_LENGTH, 0)
val orientation = exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL
)
if (orientation == ExifInterface.ORIENTATION_ROTATE_90 ||
orientation == ExifInterface.ORIENTATION_ROTATE_270
) {
val tmp = w
w = h
h = tmp
}
Log_OC.d(TAG, "Using exif imageDimension: $w x $h")
if (w > 0 && h > 0) w to h else null
} catch (_: Exception) {
null
}
fun String.getBitmapSize(): Pair<Int, Int>? = try {
val options = android.graphics.BitmapFactory.Options().apply { inJustDecodeBounds = true }
android.graphics.BitmapFactory.decodeFile(this, options)
val w = options.outWidth
val h = options.outHeight
Log_OC.d(TAG, "Using bitmap factory imageDimension: $w x $h")
if (w > 0 && h > 0) w to h else null
} catch (_: Exception) {
null
}
@@ -0,0 +1,45 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.utils.extensions
import com.nextcloud.utils.TimeConstants
import com.owncloud.android.lib.resources.files.model.RemoteFile
import com.owncloud.android.utils.FileUtil
import com.owncloud.android.utils.MimeTypeUtil
fun RemoteFile.isSame(path: String?): Boolean {
val localFile = path?.toFile() ?: return false
// remote file timestamp in millisecond not microsecond
val localLastModifiedTimestamp = localFile.lastModified() / TimeConstants.MILLIS_PER_SECOND
val localCreationTimestamp = FileUtil.getCreationTimestamp(localFile)
val localSize: Long = localFile.length()
return size == localSize &&
localCreationTimestamp != null &&
localCreationTimestamp == creationTimestamp &&
modifiedTimestamp == localLastModifiedTimestamp * TimeConstants.MILLIS_PER_SECOND &&
this.areImageDimensionsSame(path)
}
@Suppress("ReturnCount")
private fun RemoteFile.areImageDimensionsSame(path: String): Boolean {
if (!MimeTypeUtil.isImage(mimeType)) {
// can't compare it's not image
return true
}
val localFileImageDimension = path.getExifSize() ?: path.getBitmapSize()
if (localFileImageDimension == null) {
// can't compare local file image dimension is not determined
return true
}
return localFileImageDimension.first.toFloat() == imageDimension?.width &&
localFileImageDimension.second.toFloat() == imageDimension?.height
}
@@ -25,6 +25,13 @@ fun String.removeFileExtension(): String {
}
}
fun String.webDavParentPath(): String {
val normalized = this.trimEnd('/')
if (normalized.isEmpty()) return "/"
val parent = normalized.substringBeforeLast('/', "")
return if (parent.isEmpty()) "/" else "$parent/"
}
@Suppress("ComplexCondition")
fun String?.eTagChanged(eTagOnServer: String?): Boolean {
if (this == null || this.isEmpty() || eTagOnServer == null || eTagOnServer.isEmpty()) {
@@ -94,7 +94,7 @@ fun UploadResult.getFailedStatusText(context: Context): String = when (this) {
UploadResult.OLD_ANDROID_API -> context.getString(R.string.upload_old_android)
UploadResult.SYNC_CONFLICT -> context.getString(R.string.upload_sync_conflict)
UploadResult.SYNC_CONFLICT -> context.getString(R.string.upload_sync_conflict_check)
UploadResult.CANNOT_CREATE_FILE -> context.getString(R.string.upload_cannot_create_file)
@@ -17,15 +17,12 @@ import com.nextcloud.utils.fileNameValidator.FileNameValidator.isFileHidden
import com.owncloud.android.R
import com.owncloud.android.lib.resources.status.OCCapability
/**
* A TextWatcher which wraps around [FileNameValidator]
*/
@Suppress("LongParameterList")
class FileNameTextWatcher(
private val previousFileName: String?,
private val context: Context,
private val capabilitiesProvider: () -> OCCapability,
private val existingFileNamesProvider: () -> Set<String>?,
private val existingFileNamesProvider: () -> Set<String>,
private val onValidationError: Consumer<String>,
private val onValidationWarning: Consumer<String>,
private val onValidationSuccess: Runnable
@@ -34,20 +34,19 @@ object FileNameValidator {
* @return An error message if the filename is invalid, null otherwise.
*/
@Suppress("ReturnCount", "NestedBlockDepth")
@JvmOverloads
fun checkFileName(
filename: String,
capability: OCCapability,
context: Context,
existingFileNames: Set<String>? = null
existingFileNames: Set<String> = setOf()
): String? {
if (filename.isBlank()) {
return context.getString(R.string.filename_empty)
}
existingFileNames?.let {
if (isFileNameAlreadyExist(filename, existingFileNames)) {
return context.getString(R.string.file_already_exists)
}
if (isFileNameAlreadyExist(filename, existingFileNames)) {
return context.getString(R.string.file_already_exists)
}
if (!capability.checkWCFRestrictions()) {
@@ -34,6 +34,7 @@ import com.google.gson.JsonSyntaxException;
import com.nextcloud.android.lib.resources.files.FileDownloadLimit;
import com.nextcloud.client.account.User;
import com.nextcloud.client.database.NextcloudDatabase;
import com.nextcloud.client.database.dao.CapabilityDao;
import com.nextcloud.client.database.dao.FileDao;
import com.nextcloud.client.database.dao.OfflineOperationDao;
import com.nextcloud.client.database.dao.RecommendedFileDao;
@@ -112,6 +113,7 @@ public class FileDataStorageManager {
public final OfflineOperationDao offlineOperationDao = NextcloudDatabase.getInstance(MainApp.getAppContext()).offlineOperationDao();
public final FileDao fileDao = NextcloudDatabase.getInstance(MainApp.getAppContext()).fileDao();
public final ShareDao shareDao = NextcloudDatabase.getInstance(MainApp.getAppContext()).shareDao();
public final CapabilityDao capabilityDao = NextcloudDatabase.instance().capabilityDao();
private final Gson gson = new Gson();
public final OfflineOperationsRepositoryType offlineOperationsRepository;
@@ -358,8 +360,12 @@ public class FileDataStorageManager {
offlineOperationsRepository.updateNextOperations(entity);
}
private @Nullable
OCFile getFileByPath(String type, String path) {
@Nullable
private OCFile getFileByPath(String type, String path) {
if (path == null) {
return null;
}
final boolean shouldUseEncryptedPath = ProviderTableMeta.FILE_PATH.equals(type);
FileEntity fileEntity = shouldUseEncryptedPath ?
fileDao.getFileByEncryptedRemotePath(path, user.getAccountName()) :
@@ -934,13 +940,13 @@ public class FileDataStorageManager {
String expectedPath = FileStorageUtils.getDefaultSavePathFor(user.getAccountName(), ocFile);
if (!localPath.equalsIgnoreCase(expectedPath)) {
Log_OC.w(TAG, "removeLocalCopyIfNeeded: Path mismatch! Expected " + expectedPath
+ " but found " + localPath + ". Skipping deletion to prevent data loss.");
+ " but found " + localPath + ". Deleting from actual local path.");
}
Log_OC.d(TAG, "removeLocalCopyIfNeeded: deleting local file -> " + localPath);
boolean success = false;
try {
success = new File(expectedPath).delete();
success = new File(localPath).delete();
} catch (Exception e) {
Log_OC.e(TAG, "removeLocalCopyIfNeeded: deletion error: ", e);
}
@@ -187,6 +187,7 @@ public final class ThumbnailsCacheManager {
/**
* Add thumbnail to cache
*
* @param imageKey: thumb key
* @param bitmap: image for extracting thumbnail
* @param path: image path
@@ -194,7 +195,7 @@ public final class ThumbnailsCacheManager {
* @param pxH: thumbnail height in pixel
* @return Bitmap
*/
private static Bitmap addThumbnailToCache(String imageKey, Bitmap bitmap, String path, int pxW, int pxH){
public static Bitmap addThumbnailToCache(String imageKey, Bitmap bitmap, String path, int pxW, int pxH) {
Bitmap thumbnail = ThumbnailUtils.extractThumbnail(bitmap, pxW, pxH);
@@ -1092,10 +1093,12 @@ public final class ThumbnailsCacheManager {
c.drawBitmap(thumbnail, 0, 0, null);
float left = (thumbnail.getWidth() - px) / 2f;
float top = (thumbnail.getHeight() - px) / 2f;
Paint p = new Paint();
p.setAlpha(230);
c.drawBitmap(resizedPlayButton, px, px, p);
c.drawBitmap(resizedPlayButton, left, top, p);
return resultBitmap;
}
@@ -1140,7 +1143,7 @@ public final class ThumbnailsCacheManager {
/**
* adapted from <a href="https://stackoverflow.com/a/8113368">...</a>
*/
private static Bitmap handlePNG(Bitmap source, int newWidth, int newHeight) {
public static Bitmap handlePNG(Bitmap source, int newWidth, int newHeight) {
Bitmap softwareBitmap = source.copy(Bitmap.Config.ARGB_8888, false);
int sourceWidth = source.getWidth();
@@ -1296,7 +1299,7 @@ public final class ThumbnailsCacheManager {
Log_OC.d(TAG, "resized image generated");
}
} else {
Log_OC.e(TAG, "cannot generate thumbnail not supported file type, status: " + status);
Log_OC.e(TAG, "cannot generate thumbnail not supported file type, status: " + status + " file: " + file.getRemotePath());
mClient.exhaustResponse(getMethod.getResponseBodyAsStream());
}
@@ -41,7 +41,6 @@ import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.operations.UploadFileOperation
import com.owncloud.android.utils.theme.CapabilityUtils
import java.io.File
import java.util.Calendar
import java.util.Locale
import java.util.Observable
@@ -485,7 +484,7 @@ class UploadsStorageManager(
} else if (code.isConflict()) {
val isSame = FileUploadHelper().isSameFileOnRemote(
upload.user,
File(upload.storagePath),
upload.storagePath,
upload.remotePath,
upload.context
)
@@ -23,7 +23,7 @@ import java.util.List;
*/
public class ProviderMeta {
public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 99;
public static final int DB_VERSION = 100;
private ProviderMeta() {
// No instance
@@ -18,7 +18,9 @@ import android.text.TextUtils;
import android.webkit.MimeTypeMap;
import com.nextcloud.client.account.User;
import com.nextcloud.common.NextcloudClient;
import com.nextcloud.utils.extensions.ContextExtensionsKt;
import com.nextcloud.utils.extensions.OwnCloudClientExtensionsKt;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
import com.owncloud.android.datamodel.FileDataStorageManager;
@@ -42,7 +44,6 @@ import java.io.IOException;
import java.lang.ref.WeakReference;
import java.nio.file.Files;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -205,7 +206,8 @@ public class DownloadFileOperation extends RemoteOperation {
dataTransferListeners.forEach(downloadOperation::addDatatransferProgressListener);
}
result = downloadOperation.execute(client);
NextcloudClient nextcloudClient = OwnCloudClientExtensionsKt.toNextcloudClient(client, operationContext);
result = downloadOperation.execute(nextcloudClient);
@@ -1298,13 +1298,8 @@ public class UploadFileOperation extends SyncOperation {
// check if its real SYNC_CONFLICT
boolean isSameFileOnRemote = false;
if (mFile != null) {
String localPath = mFile.getStoragePath();
if (localPath != null) {
File localFile = new File(localPath);
isSameFileOnRemote = FileUploadHelper.Companion.instance()
.isSameFileOnRemote(user, localFile, mRemotePath, mContext);
}
isSameFileOnRemote = FileUploadHelper.Companion.instance()
.isSameFileOnRemote(user, mFile.getStoragePath(), mRemotePath, mContext);
}
if (isSameFileOnRemote) {
Loaded 100 of 275 files, more files were not shown because too many files have changed in this diff. Show more