Compare commits

..
Author SHA1 Message Date
tobiasKaminsky 99632b39df wip
Signed-off-by: tobiasKaminsky <[email protected]>
2026-01-09 12:32:47 +01:00
tobiasKaminsky 7103b5590a rebased
Signed-off-by: tobiasKaminsky <[email protected]>
2026-01-09 11:05:46 +01:00
tobiasKaminsky 06962348ca allow to create encrypted folder directly via bottom sheet dialog
Signed-off-by: tobiasKaminsky <[email protected]>
2026-01-09 10:57:25 +01:00
Tobias Kaminsky 5e42f5bd7c Merge pull request #16009 from Gorlesunilkumar/patch-1
fix(calendar): correct ICS event formatting and time zone usage
2026-01-09 09:44:31 +01:00
Tobias Kaminsky 55c5b59b6d Merge pull request #16034 from nextcloud/fix/battery-optimization-check
fix: battery optimization check
2026-01-09 09:30:30 +01:00
Tobias Kaminsky 8b0cc89b70 Merge pull request #16222 from nextcloud/copy-move
FolderPickerActivity: show correct folder
2026-01-09 09:24:17 +01:00
alperozturk c574b2cadd fix: battery optimization check
Signed-off-by: alperozturk <[email protected]>
2026-01-09 07:26:45 +01:00
Andy Scherzinger e8d3cf5e81 Merge pull request #16257 from nextcloud/renovate/nextcloud-pr-feedback-action-digest
chore(deps): update nextcloud/pr-feedback-action digest to 5227c55
2026-01-08 16:00:15 +01:00
Andy Scherzinger 7c242b30ce Merge pull request #16258 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.230.0
2026-01-08 15:59:54 +01:00
renovate[bot] 515ccbc761 chore(deps): update dependency fastlane to v2.230.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-08 13:05:29 +00:00
renovate[bot] d79c377641 chore(deps): update nextcloud/pr-feedback-action digest to 5227c55
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-08 13:04:52 +00:00
Tobias Kaminsky d279a0d456 Merge pull request #16254 from nextcloud/update-library
Manually bump library
2026-01-08 08:34:10 +01:00
tobiasKaminsky 6b688c3630 Manually bump library
Signed-off-by: tobiasKaminsky <[email protected]>
2026-01-07 11:59:20 +01:00
Nextcloud bot 96f9c3b2b4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-07 02:49:22 +00:00
Tobias Kaminsky aa666096b5 Merge pull request #15457 from nextcloud/renovate/major-slf4j-monorepo
fix(deps): update dependency org.slf4j:jcl-over-slf4j to v2
2026-01-02 15:31:30 +01:00
renovate[bot] eea93d86d3 fix(deps): update dependency org.slf4j:jcl-over-slf4j to v2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-01 02:08:03 +00:00
Andy Scherzinger a2bd8158b8 Merge pull request #16225 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.230.0
2025-12-31 15:13:49 +01:00
renovate[bot] 33ff664286 chore(deps): update dependency fastlane to v2.230.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-31 01:43:58 +00:00
Tobias Kaminsky 3231ba4ab9 Merge pull request #14367 from nextcloud/renovate/major-mockito-monorepo
fix(deps): update mockito monorepo to v5 (major)
2025-12-30 15:34:39 +01:00
renovate[bot] c10761ca50 fix(deps): update mockito monorepo to v5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-30 15:03:27 +01:00
Tobias Kaminsky 3a6613fc5f Merge pull request #14366 from nextcloud/renovate/major-mockitokotlinversion
fix(deps): update dependency org.mockito.kotlin:mockito-kotlin to v6
2025-12-30 15:01:25 +01:00
tobiasKaminsky 1860c20f1b Fix mockito
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-30 13:32:58 +01:00
renovate[bot] 2ab9e32a3c fix(deps): update dependency org.mockito.kotlin:mockito-kotlin to v6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-30 12:29:13 +01:00
Tobias Kaminsky 4be4416e87 Merge pull request #16223 from nextcloud/fixUnitTest
Fix PathUtilsTest.kt, failing with latest Kotlin
2025-12-30 11:39:25 +01:00
tobiasKaminsky b576a1aaeb Fix PathUtilsTest.kt, failing with latest Kotlin
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-30 11:27:19 +01:00
tobiasKaminsky 4ce5647043 FolderPickerActivity: show correct folder
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-30 08:32:44 +01:00
Andy Scherzinger 3161b78355 Merge pull request #16214 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.230.0
2025-12-29 09:43:05 +01:00
renovate[bot] 5ca3632e95 chore(deps): update dependency fastlane to v2.230.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-29 02:48:09 +00:00
Nextcloud bot 39330bbd50 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-28 02:48:12 +00:00
Andy Scherzinger 10fe08befc Merge pull request #16202 from nextcloud/renovate/webkitversion
fix(deps): update dependency androidx.webkit:webkit to v1.15.0
2025-12-27 18:41:23 +01:00
Andy Scherzinger 73de22c6db ci(chksm): Add meta data
Signed-off-by: Andy Scherzinger <[email protected]>
2025-12-27 18:39:57 +01:00
renovate[bot] 17b0ebf22b fix(deps): update dependency androidx.webkit:webkit to v1.15.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-27 18:32:48 +01:00
Andy Scherzinger 80df38f6b1 Merge pull request #16203 from nextcloud/renovate/kotlin-monorepo
fix(deps): update kotlin monorepo to v2.3.0
2025-12-27 18:31:34 +01:00
Andy Scherzinger c46628b672 ci(chksm): Add meta data
Signed-off-by: Andy Scherzinger <[email protected]>
2025-12-27 18:25:03 +01:00
renovate[bot] e6a4aa7e4e fix(deps): update kotlin monorepo to v2.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-27 18:15:06 +01:00
Andy Scherzinger 48f8701e8d Merge pull request #16204 from nextcloud/renovate/media3
fix(deps): update media3 to v1.9.0
2025-12-27 18:14:04 +01:00
Nextcloud bot 2e06401721 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-27 02:45:41 +00:00
Andy Scherzinger 703780cc7c Merge pull request #16200 from nextcloud/renovate/androidgifdrawableversion
fix(deps): update dependency pl.droidsonroids.gif:android-gif-drawable to v1.2.30
2025-12-27 00:36:44 +01:00
Andy Scherzinger 95368df3ce Merge pull request #16199 from nextcloud/renovate/composebom
fix(deps): update dependency androidx.compose:compose-bom to v2025.12.01
2025-12-26 23:35:42 +01:00
Andy Scherzinger 136cbe9cca Merge pull request #16197 from nextcloud/renovate/ksp-monorepo
chore(deps): update dependency com.google.devtools.ksp to v2.3.4
2025-12-26 21:14:40 +01:00
Andy Scherzinger e246e964ff Merge pull request #16198 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.9
2025-12-26 21:13:26 +01:00
Andy Scherzinger 46b981ef77 Merge pull request #16201 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.230.0
2025-12-26 21:12:59 +01:00
renovate[bot] 57fbc9247c fix(deps): update media3 to v1.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-26 19:16:03 +00:00
renovate[bot] dfdd298f57 chore(deps): update dependency fastlane to v2.230.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-26 19:12:40 +00:00
renovate[bot] 67272a315f fix(deps): update dependency pl.droidsonroids.gif:android-gif-drawable to v1.2.30
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-26 19:12:18 +00:00
renovate[bot] 7a534b1895 fix(deps): update dependency androidx.compose:compose-bom to v2025.12.01
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-26 19:11:39 +00:00
renovate[bot] c78f63bf8e chore(deps): update github/codeql-action action to v4.31.9
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-26 19:07:17 +00:00
renovate[bot] a960e728e3 chore(deps): update dependency com.google.devtools.ksp to v2.3.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-26 19:07:12 +00:00
Andy Scherzinger 4cdd8a0445 Merge pull request #16195 from nextcloud/style/noid/quoteLayoutBackgroundColor
Make quota bar the same background color as the remaining drawer
2025-12-26 19:40:42 +01:00
Andy Scherzinger 32bd9aedaa style(drawer): Make quota bar the same background color as the remaining drawer
Signed-off-by: Andy Scherzinger <[email protected]>
2025-12-26 19:18:06 +01:00
Nextcloud bot d2ca261db7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-25 02:46:51 +00:00
Nextcloud bot 1c520ac522 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-23 02:48:26 +00:00
Nextcloud bot 66ab839cab fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-22 13:48:32 +00:00
Tobias Kaminsky 1acae6201e Merge pull request #16187 from nextcloud/translation-updateLocation
Translation: new metadata location
2025-12-22 14:46:37 +01:00
tobiasKaminsky c3fc1ea1f1 Translation: new metadata location
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-22 14:45:25 +01:00
Andy Scherzinger dfe4120af2 Merge pull request #16185 from nextcloud/renovate/nextcloud-pr-feedback-action-digest
chore(deps): update nextcloud/pr-feedback-action digest to 908074d
2025-12-22 09:15:47 +01:00
renovate[bot] 46e14d1895 chore(deps): update nextcloud/pr-feedback-action digest to 908074d
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-22 00:30:09 +00:00
Tobias Kaminsky 73065f0895 Merge pull request #16160 from nextcloud/settingsKTS
settings: adapt includeBuild to new syntax
2025-12-19 14:53:57 +01:00
Alper Öztürk 0758e25ac4 Merge pull request #16142 from nextcloud/fix/oc-file-list-search-sub-dir-visibility-from-root
fix: search task root sub dir content fetch
2025-12-19 12:46:30 +01:00
alperozturk ade6bccfde fix etag saving logic
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:48 +01:00
alperozturk eb71854ef4 fix etag saving logic
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:48 +01:00
alperozturk 3159e7c10f revert
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:45 +01:00
alperozturk cb919ef5b0 use saveFileWithParent
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:37 +01:00
alperozturk 78638d7c16 use saveFileWithParent
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:37 +01:00
alperozturk 74c9dc126d fix: search task root sub dir content fetch
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:37 +01:00
alperozturk cb088eb263 fix: search task root sub dir content fetch
Signed-off-by: alperozturk <[email protected]>
2025-12-19 12:07:36 +01:00
Alper Öztürk 26f0eef7d5 Merge pull request #16179 from nextcloud/fix/loading-state
fix: loading state
2025-12-19 12:05:40 +01:00
alperozturk e96f5f8542 fix: loading state
Signed-off-by: alperozturk <[email protected]>
2025-12-19 11:49:22 +01:00
Alper Öztürk 84e7c41820 Merge pull request #16176 from nextcloud/fix/navigation-from-child-oc-file-list-fragment
fix: navigation from child oc file list fragment
2025-12-19 09:11:38 +01:00
alperozturk 6a884788f4 fix: navigation from child oc file list fragment
Signed-off-by: alperozturk <[email protected]>
2025-12-19 08:56:56 +01:00
Alper Öztürk f653e87b8f Merge pull request #16132 from nextcloud/fix/auto-upload-upload-non-existing-local-file
fix(auto-upload): remove non-existing local files without restarting
2025-12-19 08:44:03 +01:00
alperozturk 683757716f fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-19 08:31:35 +01:00
alperozturk 082328e21f fix: check exception during auto upload for non-existing file
Signed-off-by: alperozturk <[email protected]>
2025-12-19 08:31:35 +01:00
alperozturk d94ca1fdea fix: check deleted files for other local behaviour
Signed-off-by: alperozturk <[email protected]>
2025-12-19 08:31:35 +01:00
alperozturk 3b03877afc fix: check deleted files for local behaviour delete
Signed-off-by: alperozturk <[email protected]>
2025-12-19 08:31:35 +01:00
Alper Öztürk b7e3a2dd39 Apply suggestion from @alperozturk96
Signed-off-by: Alper Öztürk <[email protected]>
2025-12-19 08:31:35 +01:00
Alper ÖztürkandAndy Scherzinger e6fda09681 Update app/src/main/java/com/nextcloud/client/jobs/autoUpload/AutoUploadWorker.kt
Co-authored-by: Andy Scherzinger <[email protected]>
Signed-off-by: Alper Öztürk <[email protected]>
2025-12-19 08:31:35 +01:00
alperozturk 530bcc017f fix(auto-upload): remove not-existing local files without restarting
Signed-off-by: alperozturk <[email protected]>
2025-12-19 08:31:35 +01:00
alperozturk 006e12be74 fix(auto-upload): remove not-existing local files without restarting
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/client/jobs/autoUpload/FileSystemRepository.kt
2025-12-19 08:31:35 +01:00
Alper Öztürk b93b2702f5 Merge pull request #16146 from nextcloud/fix/upsert-single-file
fix: upsert single file
2025-12-19 08:14:52 +01:00
Alper Öztürk 0c1367dd50 Merge pull request #16159 from nextcloud/fix/empty-all-files
fix: empty all files
2025-12-19 08:12:58 +01:00
Alper Öztürk 447a7b7c01 Merge pull request #16167 from nextcloud/show-search-button
show search button
2025-12-19 08:12:23 +01:00
Alper Öztürk 184278cf5a Merge pull request #16144 from nextcloud/handle/metadata-worker-edge-cases
handle metadata worker edge cases
2025-12-18 16:24:06 +01:00
Alper Öztürk 3f5b20bcd4 Merge pull request #16164 from nextcloud/fix/e-tag-comparasion
fix: eTag comparison
2025-12-18 16:22:38 +01:00
alperozturk dd3a64d3fe fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-12-18 16:02:36 +01:00
alperozturk 72c77a00e5 better condition
Signed-off-by: alperozturk <[email protected]>
2025-12-18 15:57:54 +01:00
alperozturk f0a3f675af better condition
Signed-off-by: alperozturk <[email protected]>
2025-12-18 15:57:54 +01:00
alperozturk d2c1af687b fix: eTag comparison
Signed-off-by: alperozturk <[email protected]>
2025-12-18 15:57:54 +01:00
Alper Öztürk 2af51844ae Merge pull request #16165 from nextcloud/fix/listen-broadcast-manager
fix: register/unregister broadcast receivers
2025-12-18 15:54:30 +01:00
Alper ÖztürkandTom 90b19aa338 Apply suggestions from code review
Co-authored-by: Tom <[email protected]>
Signed-off-by: Alper Öztürk <[email protected]>
2025-12-18 15:50:41 +01:00
alperozturk bf5d0cb7ef show search button
Signed-off-by: alperozturk <[email protected]>
2025-12-18 14:53:14 +01:00
alperozturk 3e9e6a18a5 fix: register/unregister broadcast receivers
Signed-off-by: alperozturk <[email protected]>
2025-12-18 13:48:59 +01:00
tobiasKaminsky 1097d1e8ac settings: adapt includeBuild to new syntax
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-18 09:06:51 +01:00
Andy Scherzinger f83f36d030 Merge pull request #16161 from nextcloud/docs/nboid/reuseFixScreenshots
Update reuse infos
2025-12-17 17:00:27 +01:00
Andy Scherzinger 22c4b64fb4 docs(reuse): Update reuse infos
...based on changes in #16158

Signed-off-by: Andy Scherzinger <[email protected]>
2025-12-17 16:58:43 +01:00
alperozturk 77ecff2c84 fix: empty all files
Signed-off-by: alperozturk <[email protected]>
2025-12-17 15:51:12 +01:00
Tobias Kaminsky 673879f418 Merge pull request #16158 from nextcloud/fdroidScreenshots
Fdroid: restructure screenshots
2025-12-17 14:22:05 +01:00
Alper Öztürk 556607ed29 Merge pull request #16157 from nextcloud/fix/max-parallel-work-count-for-tests
fix: max parallel fork count for tests
2025-12-17 13:09:40 +01:00
tobiasKaminsky 686ca7dc36 Fdroid: restructure
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-17 12:50:39 +01:00
alperozturk 3e78385c9f fix: max parallel fork count for tests
Signed-off-by: alperozturk <[email protected]>
2025-12-17 12:05:42 +01:00
Alper Öztürk bc1f5a23e6 Merge pull request #15925 from PhilLab/move_or_copy_files_parent
Move or Copy files: Start in the parent folder instead of root
2025-12-17 12:04:34 +01:00
Alper Öztürk 33c5f6631d Merge pull request #15985 from nextcloud/fix/sort-concurrent-modification-exception
fix(file-sort): concurrent modification exception
2025-12-17 11:53:34 +01:00
alperozturk f11226c25a remove lock
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:52:38 +01:00
alperozturk 216402c20a fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:32:09 +01:00
alperozturk 70e1a0edde dont change sorting logic
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/LocalFileListFragment.java
2025-12-17 11:32:09 +01:00
alperozturk 0a8a8ba9f0 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:32:09 +01:00
alperozturk 62cf7c3ea6 fix(file-sort): concurrent modification exception
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:32:09 +01:00
alperozturk b778488dd9 fix(file-sort): concurrent modification exception
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:32:09 +01:00
alperozturk 18c8f665d2 fix(file-sort): concurrent modification exception
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:32:09 +01:00
alperozturk 89b704d4fe fix(file-sort): concurrent modification exception
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:32:09 +01:00
Alper Öztürk ec57fec9b6 Merge pull request #16133 from nextcloud/fix/cancel-gallery-thumbnail-generation-when-leave-media-tab
fix: stop running gallery background job when user leave
2025-12-17 11:30:54 +01:00
alperozturk a1fc5d8519 add cancel all function
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:30:31 +01:00
alperozturk 1ba8b80528 fix: stop running gallery background job when user leave
Signed-off-by: alperozturk <[email protected]>
2025-12-17 11:24:40 +01:00
Alper Öztürk a8f66d8621 Merge pull request #16114 from nextcloud/fix/gallery-image-scaling
fix: gallery image scaling
2025-12-17 11:18:33 +01:00
Alper Öztürk bc2a009a07 Merge pull request #16110 from nextcloud/fix/reopening-list-from-navigation-view
fix: reopening list from navigation view
2025-12-17 11:07:31 +01:00
Alper Öztürk b6402454eb Merge pull request #16105 from nextcloud/fix/e2ee-folder-unlock
fix: e2ee folder unlock
2025-12-17 11:07:10 +01:00
Tobias Kaminsky e7acd2424b Merge pull request #16147 from nextcloud/drone-android16
Drone: use Android16
2025-12-17 11:04:36 +01:00
Tobias Kaminsky 48280fbb4c Merge pull request #16121 from nextcloud/fix/file-system-provider
fix: file system provider
2025-12-17 10:04:42 +01:00
alperozturk 613fe6d1a2 fix: reopening list from navigation view
Signed-off-by: alperozturk <[email protected]>
2025-12-17 10:00:28 +01:00
Nextcloud bot 82d0d15077 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-17 02:45:53 +00:00
alperozturk 7fe17f21f7 add logs
Signed-off-by: alperozturk <[email protected]>
2025-12-16 19:25:43 +01:00
alperozturk d5223059a6 check nullability of the dim just in case
Signed-off-by: alperozturk <[email protected]>
2025-12-16 19:25:43 +01:00
alperozturk c6885451b7 fix: gallery image scaling
Signed-off-by: alperozturk <[email protected]>
2025-12-16 19:25:43 +01:00
alperozturk bd465ee07b fix: gallery image scaling
Signed-off-by: alperozturk <[email protected]>
2025-12-16 19:25:43 +01:00
alperozturk 51b322f9ed fix: gallery image scaling
Signed-off-by: alperozturk <[email protected]>
2025-12-16 19:25:43 +01:00
alperozturk b0e656f563 fix: gallery image scaling
Signed-off-by: alperozturk <[email protected]>
2025-12-16 19:25:43 +01:00
Philipp Hasper 385a89eb79 Make EXTRA_FOLDER key constant and guaranteed non-null
Minimal possible change to streamline the handling of this intent key.
Alternatively, the class.java.simpleName or the !! operator could've been
used at time of field definition. And the same would apply to several other
places as well.

Signed-off-by: Philipp Hasper <[email protected]>
2025-12-16 18:50:49 +01:00
Philipp Hasper f269f11103 Fixing annotation for optional OCFile parameter
Changing to OCFile? is required, as the parameter is indeed nullable.
This didn't turn up prior to the rebase nor was it flagged in the
pre-existing code, even though it is already an issue there.
What probably happened is a combination of updated detection tools and
the tools purposefully only flagging changed lines.

Additionally, the nullness annotation was added to the underlying Java
calls, to make sure the Kotlin type definition holds true.

Signed-off-by: Philipp Hasper <[email protected]>
2025-12-16 18:50:12 +01:00
Philipp Hasper 2b88c8f284 OCFileListFragment: Removed unused fromSearch arg of listDirectory()
Last usage of the argument inside of the method was removed in 905222c930,
so removing it doesn't have any impact on the behavior.
The only instance where the parameter was set to `true` was in the
ExtendedListFragment

Signed-off-by: Philipp Hasper <[email protected]>
2025-12-16 18:50:12 +01:00
Philipp Hasper 7114f33afc Move or Copy files: Start in the parent folder instead of root
Previous behavior always moved up to the root folder, which meant the user
lost the context of their current files. Especially in complicated nested
folder structures, this made standard operations overly complicated, like
duplicating in the same folder or duplicating/moving to a sibling folder.

This is now also in sync with the behavior of the iOS app and the web UI

Signed-off-by: Philipp Hasper <[email protected]>
2025-12-16 18:38:38 +01:00
tobiasKaminsky c89a7e2d3f Drone: use Android16
Signed-off-by: tobiasKaminsky <[email protected]>
2025-12-16 13:48:31 +01:00
alperozturk e093d22a8d add tests for upsert file
Signed-off-by: alperozturk <[email protected]>
2025-12-16 13:14:16 +01:00
alperozturk 5dc9f3f940 add tests for upsert file
Signed-off-by: alperozturk <[email protected]>
2025-12-16 12:43:33 +01:00
alperozturk a6fa939f03 fix: upsert single file
Signed-off-by: alperozturk <[email protected]>
2025-12-16 12:04:20 +01:00
alperozturk dd0e339e21 handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
alperozturk 050828f627 handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
alperozturk 71391fe522 handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
alperozturk 5b17836c5f handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
alperozturk 6c0d88f38a handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
alperozturk 307960e5ff handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
alperozturk a8a4424568 handle metadata worker edge cases
Signed-off-by: alperozturk <[email protected]>
2025-12-16 08:22:49 +01:00
Nextcloud bot 3479e47597 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-16 03:00:49 +00:00
Alper Öztürk 8b55b34533 Merge pull request #16097 from nextcloud/fix/action-bar-appereance
fix: action bar appereance
2025-12-15 13:07:35 +01:00
Andy Scherzinger b42af69446 Merge pull request #16135 from nextcloud/renovate/actions-cache-5.x
chore(deps): update actions/cache action to v5
2025-12-15 11:41:46 +01:00
Andy Scherzinger 3392060b0d Merge pull request #16136 from nextcloud/renovate/major-github-artifact-actions
chore(deps): update actions/upload-artifact action to v6
2025-12-15 11:41:06 +01:00
alperozturk ee658aa205 fix action bar press back from unified search fragment and when fda created or recreated
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 9291bebfe9 fix back press from file details
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 74e9900754 fix back press from file details
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 1e0db99c18 fix getPreviousFile
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 5c2549b9f4 fix FileDetailsFragmentBinding.progressBlock' on a null object reference
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk fec57f4f31 fix: search fragment value
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 26bb229a99 fix image preview
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk aa0af25774 reset file depth for bottom navigation view as well
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk ec0e916418 fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk dd5139f480 fix file name in action bar
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 6800d3811f fix back button behaviour from trashbin
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk b9058f7294 fix multiple item highlight
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 12f4c8700c fix on device action bar
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk f49594ba7e fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk b5d9debea1 fix overriding calculated behaviour via drawer slide
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 850be12094 fix back button action
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk d293e69d27 while setting toolbar check toolbar style as well
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 89436466c3 remove duplicated calls
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk c73f0907a2 override updateActionBarTitleAndHomeButton with search type
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 30909eeedd fix crash
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk efccbba541 rely on existing architecture
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk e5ca9f7872 fix: shared tab action bar
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
alperozturk 1d7037b746 fix shared tab
Signed-off-by: alperozturk <[email protected]>
2025-12-15 11:06:54 +01:00
Andy Scherzinger 8777b76105 Merge pull request #16134 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.8
2025-12-15 10:47:24 +01:00
renovate[bot] 15afb8c184 chore(deps): update actions/upload-artifact action to v6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 09:19:50 +00:00
renovate[bot] 043a763b96 chore(deps): update actions/cache action to v5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 09:19:43 +00:00
renovate[bot] 078b3feaac chore(deps): update github/codeql-action action to v4.31.8
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 09:19:37 +00:00
Andy Scherzinger 0d88157c6d Merge pull request #16130 from nextcloud/renovate/spotbugsgradleplugin
chore(deps): update dependency com.github.spotbugs to v6.4.8
2025-12-15 09:50:09 +01:00
Andy Scherzinger 93fceaea1e Merge pull request #16131 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.229.1
2025-12-15 09:49:38 +01:00
Andy Scherzinger e71e1e2507 Merge pull request #16129 from nextcloud/renovate/codecov-codecov-action-5.x
chore(deps): update codecov/codecov-action action to v5.5.2
2025-12-15 09:49:18 +01:00
alperozturk 68474b178b fix tests
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk 3b65421fc0 add repo to tests
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk d9401c48ae deduplicate logic
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk e53e113cdf deduplicate logic
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk ff29bc460a deduplicate logic
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk c25d9a4d2b obey folder configuration
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk 22c1eccaec obey folder configuration
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk a062b7e537 obey folder configuration
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk c7cd5c6233 fix: file system provider
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk f112697e51 fix: file system provider
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk 2c2d4e8fb9 fix: file system provider
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
alperozturk 23000718f1 fix: file system provider
Signed-off-by: alperozturk <[email protected]>
2025-12-15 09:26:34 +01:00
Alper Öztürk e968ed2d83 Merge pull request #16128 from nextcloud/renovate/androidpluginversion
chore(deps): update androidpluginversion to v8.13.2
2025-12-15 09:26:10 +01:00
renovate[bot] 101eb9b48e chore(deps): update androidpluginversion to v8.13.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 09:22:57 +01:00
renovate[bot] 9e3f651b5a chore(deps): update dependency fastlane to v2.229.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 02:55:30 +00:00
renovate[bot] d0775ec08a chore(deps): update dependency com.github.spotbugs to v6.4.8
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 02:54:50 +00:00
Nextcloud bot c33862010a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-15 02:53:49 +00:00
renovate[bot] 7bba8f84eb chore(deps): update codecov/codecov-action action to v5.5.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-15 00:42:31 +00:00
Nextcloud bot cd6721430a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-13 02:44:39 +00:00
Alper Öztürk 8a58b2efcd Merge pull request #16108 from nextcloud/fix/sub-file-visibility
fix: sub file visibility
2025-12-12 16:04:10 +01:00
Alper Öztürk 7416f51109 Merge pull request #16122 from nextcloud/fix/calculate-scan-interval-network-on-main-thread
fix: calculate scan interval network on main thread exception
2025-12-12 13:39:58 +01:00
alperozturk 87886024cb fix: calculate scan interval network on main thread exception
Signed-off-by: alperozturk <[email protected]>
2025-12-12 13:13:23 +01:00
Alper Öztürk 49c3be89ab Merge pull request #16119 from PhilLab/add_gradle_signing_key
Fix Gradle project sync error
2025-12-11 10:56:03 +01:00
Philipp Hasper f3d97558d4 Added the gradle signing key to the keyring to fix project sync error
The commit 5fd2e2942c introduced stricter
dependency verification, but this resulted in the Gradle project syncing
to fail with the error:
> Multiple build operations failed.
> Dependency verification failed for configuration ':app:androidTestUtil':
>   - On artifact gradle-9.2.1-src.zip (gradle:gradle:9.2.1) in repository
> 'Gradle distributions': Artifact was signed with key 'E2F38302C8075E3D'
> but it wasn't found in any key server so it couldn't be verified
> This can indicate that a dependency has been compromised. Please
> carefully verify the signatures and checksums

This happened inpedendent of the used gradle version..

The followup 32545d42f2 added the key's
fingerprint, but this was not enough to establish trust. Adding the public
key to the keyring. The key was taken from
https://github.com/gradle/gradle/blob/b99fe7d304e68b978011840c31c08068f671f794/KEYS.md
and cross-checked with https://gradle.org/keys/

Signed-off-by: Philipp Hasper <[email protected]>
2025-12-11 09:15:09 +01:00
Nextcloud bot fbaa242c51 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-11 02:46:13 +00:00
alperozturk 6809763fe3 remove filters
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk d5359f4f1b remove filters
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk 41fc243938 check nested files
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk 983635ca7b remove unused source
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk 7605a32b4e add tests
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk 0b421947fe fix: shared sub file visibility
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk 98fb31d90f fix: favorite sub file visibility
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:38 +01:00
alperozturk ad40517d30 remove reset folder unlock token since ocupload will be used for each item
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:17 +01:00
alperozturk 7733a50c1c fix: e2ee folder unlock
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:17 +01:00
alperozturk 4eaf50249c fix: e2ee folder unlock
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:17 +01:00
alperozturk 0415db9648 token cannot be null
Signed-off-by: alperozturk <[email protected]>
2025-12-10 14:52:17 +01:00
Alper Öztürk 48a3130ebe Merge pull request #16113 from nextcloud/fix/lint-issues
fix: lint issues
2025-12-10 14:51:57 +01:00
alperozturk 4effcf14b5 fix: lint issues
Signed-off-by: alperozturk <[email protected]>
2025-12-10 13:34:21 +01:00
Tobias Kaminsky 7e811f6b9b Merge pull request #16106 from nextcloud/fix/settings-activity-action-bar-padding
fix: settings activity action bar padding
2025-12-10 10:08:36 +01:00
Gorlesunilkumar ae16c738eb fix(calendar): correct ICS event formatting and time zone usage
The ICS event file has been updated to follow proper RFC 5545 formatting.

Changes:
- Added a valid DESCRIPTION field instead of an empty one
- Unified DTSTART and DTEND to use the same TZID (Europe/Berlin)
- Ensured the event duration is correct and consistent
- Cleaned up extra blank lines to avoid parsing issues
- Retained the complete VTIMEZONE block for compatibility with Nextcloud, Google Calendar, and iOS

This improves interoperability with calendar clients and prevents parsing errors caused by mixed time formats.


Signed-off-by: Gorlesunilkumar <[email protected]>
2025-12-10 08:24:29 +01:00
Nextcloud bot f09e71e33c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-10 02:47:52 +00:00
alperozturk b82a9881fe fix: settings activity action bar padding
Signed-off-by: alperozturk <[email protected]>
2025-12-09 15:01:54 +01:00
Alper Öztürk 2ef418808b Merge pull request #16059 from nextcloud/fix/update-file-download-limit
fix: update file download limit
2025-12-09 12:13:20 +01:00
alperozturk d76ed5a769 ui fixes
Signed-off-by: alperozturk <[email protected]>
2025-12-09 11:56:36 +01:00
alperozturk c4ccea7f76 fix: update file download limit
Signed-off-by: alperozturk <[email protected]>
2025-12-09 11:00:10 +01:00
alperozturk 945ad6f843 fix: update file download limit
Signed-off-by: alperozturk <[email protected]>
2025-12-09 11:00:10 +01:00
alperozturk f4bea54bfd fix: update file download limit
Signed-off-by: alperozturk <[email protected]>
2025-12-09 11:00:10 +01:00
alperozturk f10666ff64 fix: update file download limit
Signed-off-by: alperozturk <[email protected]>
2025-12-09 11:00:10 +01:00
Nextcloud bot 655b6010f4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-09 02:49:27 +00:00
Andy Scherzinger e172e710ca Merge pull request #16095 from nextcloud/renovate/mockkversion
fix(deps): update mockkversion to v1.14.7
2025-12-08 11:44:00 +01:00
Andy Scherzinger 163648e763 Merge pull request #16089 from nextcloud/renovate/fbcontribversion
fix(deps): update dependency com.mebigfatguy.fb-contrib:fb-contrib to v7.7.2
2025-12-08 10:45:32 +01:00
Alper Öztürk e3b0af9bd9 Merge pull request #16073 from nextcloud/fix/fastfile
fix fastfile for build gradle kts
2025-12-08 09:44:31 +01:00
renovate[bot] 9eb5e4037f fix(deps): update mockkversion to v1.14.7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-08 08:41:52 +00:00
Alper Öztürk 1df79b6a42 Merge pull request #16092 from nextcloud/fix/event-bus-drawer-activity
fix: event bus drawer activity
2025-12-08 08:44:01 +01:00
alperozturk d499122e2e fix: event bus drawer activity
Signed-off-by: alperozturk <[email protected]>
2025-12-08 08:22:45 +01:00
Andy Scherzinger 2a0b507ec0 Merge pull request #16088 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.7
2025-12-08 07:48:12 +01:00
Tobias Kaminsky 646917b5fd Merge pull request #16077 from nextcloud/update-library-2025-12-07
Update library to 2025-12-07
2025-12-08 06:58:25 +01:00
Nextcloud bot ea06d34fbc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-08 02:44:27 +00:00
renovate[bot] 0d51ff0c2e fix(deps): update dependency com.mebigfatguy.fb-contrib:fb-contrib to v7.7.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-08 00:37:07 +00:00
renovate[bot] 2da9010134 chore(deps): update github/codeql-action action to v4.31.7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-08 00:23:48 +00:00
Nextcloud bot ffe2cc1edd fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-07 02:44:36 +00:00
Tobias Kaminsky 5b544dc25a Update library to 2025-12-07
Signed-off-by: Tobias Kaminsky <[email protected]>
2025-12-07 00:01:39 +01:00
Nextcloud bot 7463d33a5b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-06 02:46:45 +00:00
alperozturk f9c7d5e1d2 fix fastfile for build gradle kts
Signed-off-by: alperozturk <[email protected]>
2025-12-05 15:57:56 +01:00
Alper Öztürk b595eed437 Merge pull request #16071 from nextcloud/fix/files-sync-work-crash
fix: auto upload worker crash
2025-12-05 15:40:24 +01:00
alperozturk de99952964 fix: auto upload worker crash
Signed-off-by: alperozturk <[email protected]>
2025-12-05 15:39:08 +01:00
Alper Öztürk 4be340f073 Merge pull request #16068 from nextcloud/chore/3.36
chore: next minor version
2025-12-05 15:38:31 +01:00
Alper Öztürk 75b9794e60 Merge pull request #16066 from nextcloud/fix/group-folder-adapter-crash
fix: group folder adapter crash
2025-12-05 14:41:10 +01:00
alperozturk 29d68adfdf chore: next minor version
Signed-off-by: alperozturk <[email protected]>
2025-12-05 14:33:01 +01:00
Alper Öztürk e82bb019e5 Merge pull request #16065 from nextcloud/drop-not-supported-api-levels
drop not supported api levels
2025-12-05 14:31:05 +01:00
alperozturk 32545d42f2 fix lib ver
Signed-off-by: alperozturk <[email protected]>
2025-12-05 14:29:26 +01:00
Andy Scherzinger 628b6147e9 ci(chksm): Update meta data
Signed-off-by: Andy Scherzinger <[email protected]>
2025-12-05 14:21:52 +01:00
alperozturk da2aa8d861 increase api level for ss tests
Signed-off-by: alperozturk <[email protected]>
2025-12-05 10:26:53 +01:00
alperozturk 17f396637c drop not supported api levels
Signed-off-by: alperozturk <[email protected]>
2025-12-05 10:26:53 +01:00
Alper Öztürk 1307cdb0dc Merge pull request #16062 from nextcloud/change-upload-cancel-button-wording
change upload buttons wording
2025-12-05 10:26:43 +01:00
alperozturk 9db5b5bd71 change wording
Signed-off-by: alperozturk <[email protected]>
2025-12-05 10:25:23 +01:00
Alper Öztürk 4dc6faa9e2 Merge pull request #16058 from nextcloud/fix/npe-fda-on-start
fix: fda on start npe
2025-12-05 10:22:19 +01:00
alperozturk 5b1fe83ba4 change upload cancel button wording
Signed-off-by: alperozturk <[email protected]>
2025-12-05 10:15:22 +01:00
alperozturk c969a6014f fix: group folder adapter crash
Signed-off-by: alperozturk <[email protected]>
2025-12-05 09:35:13 +01:00
alperozturk d914618b32 fix: fda on start npe
Signed-off-by: alperozturk <[email protected]>
2025-12-05 08:35:04 +01:00
Alper Öztürk 9bbf716cc2 Merge pull request #16061 from nextcloud/fix/folder-download-progress
fix: folder download progress
2025-12-05 08:32:43 +01:00
Nextcloud bot 7d1231d40d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-05 02:45:25 +00:00
Andy Scherzinger ef243ebcf0 Merge pull request #15653 from nextcloud/renovate/bcpkixjdk18onversion
fix(deps): update dependency org.bouncycastle:bcpkix-jdk18on to v1.83
2025-12-04 18:43:55 +01:00
alperozturk 6f9d3256e5 fix: notification
Signed-off-by: alperozturk <[email protected]>
2025-12-04 16:05:00 +01:00
alperozturk 10becaa76a fix: folder download progress notification
Signed-off-by: alperozturk <[email protected]>
2025-12-04 16:05:00 +01:00
alperozturk 4a3f2328e4 fix: folder download progress notification
Signed-off-by: alperozturk <[email protected]>
2025-12-04 16:05:00 +01:00
Andy Scherzinger 5d4af37768 Merge pull request #15696 from nextcloud/renovate/workruntime
fix(deps): update workruntime to v2.11.0
2025-12-04 15:36:11 +01:00
renovate[bot] 5e297fbd89 fix(deps): update workruntime to v2.11.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 14:34:43 +00:00
renovate[bot] 35c1a573d0 fix(deps): update dependency org.bouncycastle:bcpkix-jdk18on to v1.83
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 14:31:45 +00:00
Andy Scherzinger 2a50467d9e Merge pull request #16060 from nextcloud/fix/file-list-view
fix: file list view
2025-12-04 15:26:58 +01:00
alperozturk 0ff3f91625 fix: file list view
Signed-off-by: alperozturk <[email protected]>
2025-12-04 15:22:25 +01:00
Andy Scherzinger f127d5725a Merge pull request #15937 from nextcloud/renovate/reactivecircus-android-emulator-runner-2.x
chore(deps): update reactivecircus/android-emulator-runner action to v2.35.0
2025-12-04 15:01:10 +01:00
Andy Scherzinger 35b0d0e8b4 Merge pull request #16030 from nextcloud/renovate/foundationversion
fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.0
2025-12-04 14:59:48 +01:00
Andy Scherzinger 7f4c5e7199 Merge pull request #15915 from nextcloud/renovate/splash.screen
fix(deps): update dependency androidx.core:core-splashscreen to v1.2.0
2025-12-04 14:41:38 +01:00
Andy Scherzinger 444ca2eaaa Merge pull request #15936 from nextcloud/renovate/ksp-monorepo
chore(deps): update dependency com.google.devtools.ksp to v2.3.3
2025-12-04 14:07:58 +01:00
Andy Scherzinger 7085312dbb Merge pull request #16057 from nextcloud/renovate/androidcommonlibraryversion
fix(deps): update dependency com.github.nextcloud.android-common:ui to v0.30.0
2025-12-04 13:50:04 +01:00
Andy Scherzinger 0238cb71b3 Merge pull request #16031 from nextcloud/renovate/androidimagecropperversion
fix(deps): update dependency com.vanniktech:android-image-cropper to v4.7.0
2025-12-04 13:49:45 +01:00
Alper Öztürk b89a7dd409 Merge pull request #16038 from nextcloud/fix/worker-start-not-allowed-exception
fix: worker start not allowed exception
2025-12-04 13:15:10 +01:00
Alper Öztürk 2d89180eac Merge pull request #16048 from nextcloud/fix/cancel-uploads
fix: upload cancel & remove
2025-12-04 13:14:22 +01:00
Alper Öztürk d9e517dd09 Merge pull request #16051 from nextcloud/fix/shared-folder-navigation
fix: shared folder navigation
2025-12-04 13:14:09 +01:00
Alper Öztürk b0656a6ed1 Merge pull request #15923 from nextcloud/fix/observe-worker-state
fix: observe worker state
2025-12-04 13:13:56 +01:00
renovate[bot] b65e86c141 fix(deps): update dependency com.github.nextcloud.android-common:ui to v0.30.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 11:52:12 +00:00
Andy Scherzinger ff139a7780 Merge pull request #15914 from nextcloud/renovate/composebom
fix(deps): update dependency androidx.compose:compose-bom to v2025.12.00
2025-12-04 12:30:06 +01:00
Andy Scherzinger f1a886564f Merge pull request #16055 from nextcloud/renovate/exifinterfaceversion
fix(deps): update dependency androidx.exifinterface:exifinterface to v1.4.2
2025-12-04 11:57:37 +01:00
Andy Scherzinger a31246bf95 Merge pull request #16056 from nextcloud/renovate/actions-setup-java-5.x
chore(deps): update actions/setup-java action to v5.1.0
2025-12-04 10:55:06 +01:00
Andy Scherzinger 68df0057f0 Merge pull request #16053 from nextcloud/renovate/actions-stale-10.x
chore(deps): update actions/stale action to v10.1.1
2025-12-04 10:54:41 +01:00
Andy Scherzinger 97d6a706f8 Merge pull request #16054 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.6
2025-12-04 10:54:01 +01:00
Andy Scherzinger e692275bef Merge pull request #16052 from nextcloud/renovate/actions-checkout-6.x
chore(deps): update actions/checkout action to v6.0.1
2025-12-04 10:53:35 +01:00
alperozturk 2ef92184a9 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:09:19 +01:00
alperozturk b46969d845 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:08:42 +01:00
renovate[bot] 51cd7c9260 chore(deps): update actions/setup-java action to v5.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 09:08:06 +00:00
renovate[bot] c14c19d184 fix(deps): update dependency androidx.exifinterface:exifinterface to v1.4.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 09:05:52 +00:00
alperozturk 290bcf76aa speed up grid view listing
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:02:25 +01:00
alperozturk 3c6ff66f40 speed up grid view listing
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:02:23 +01:00
alperozturk 256c286093 insert file while keeping order
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:02:21 +01:00
alperozturk 159acc261f fix calls
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:02:21 +01:00
alperozturk 5b9245cc9b fix: layout switching for local file indicator
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:02:21 +01:00
alperozturk 34eaa95dbf fix: local file indicator in grid view
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:02:19 +01:00
alperozturk 778c1bc5f0 fix: observing worker states
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/OCFileListDelegate.kt
2025-12-04 10:02:17 +01:00
alperozturk 544ca89580 fix: shared folder navigation
Signed-off-by: alperozturk <[email protected]>
2025-12-04 10:01:31 +01:00
renovate[bot] c163f666c0 chore(deps): update github/codeql-action action to v4.31.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 08:57:37 +00:00
renovate[bot] f3307dc43a chore(deps): update actions/stale action to v10.1.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 08:57:10 +00:00
alperozturk 0a9a8c1d70 fix: shared folder navigation
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:57:06 +01:00
renovate[bot] de46d186dd chore(deps): update actions/checkout action to v6.0.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 08:57:04 +00:00
alperozturk eb2abbb493 fix: shared folder navigation
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:32:16 +01:00
alperozturk 6cba0320a1 fix: shared folder navigation
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:32:16 +01:00
alperozturk e768ecd9ec fix: shared folder navigation
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:32:16 +01:00
alperozturk e39653e688 fix: shared folder navigation
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:32:16 +01:00
renovate[bot] 058ba20a0c fix(deps): update dependency com.vanniktech:android-image-cropper to v4.7.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 08:19:31 +00:00
alperozturk 3fedca14df fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:15:46 +01:00
alperozturk b73c881513 fix: upload cancel & remove
Signed-off-by: alperozturk <[email protected]>
2025-12-04 09:15:46 +01:00
renovate[bot] d112302b79 fix(deps): update dependency androidx.compose:compose-bom to v2025.12.00
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-04 08:09:21 +00:00
Alper Öztürk d078795157 Merge pull request #16047 from nextcloud/use-snackbar-instead-of-toast
feat: use snackbar instead of toast
2025-12-04 08:58:55 +01:00
Alper Öztürk 036d1e47a6 Merge pull request #15976 from nextcloud/fix/empty-list-state-visibility
fix: empty list state visibility
2025-12-04 08:33:49 +01:00
Alper Öztürk 4982894840 Merge pull request #16015 from nextcloud/trashbinShowCorrectSortingOrder
Trashbin: show correct sorting order
2025-12-04 08:10:35 +01:00
Nextcloud bot 7d5acea1bb fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-04 02:44:42 +00:00
renovate[bot] cb729dc1b9 fix(deps): update dependency androidx.compose.foundation:foundation to v1.10.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-03 20:53:47 +00:00
Alper Öztürk e223453c30 Merge pull request #15627 from eltos/eltos-dense-layout
Implement dense layout option
2025-12-03 16:20:13 +01:00
Alper Öztürk 4a876f0edc Merge pull request #16023 from nextcloud/fix/screenshot-test-logic
fix: screenshot tests logic
2025-12-03 15:02:27 +01:00
alperozturk 3d5bcbb3ea fix event bus disabling logic for android 8.1
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:37:25 +01:00
alperozturk e470957819 fix event bus disabling logic for android 8.1
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:18:54 +01:00
alperozturk 4f9ca16075 disable event bus for tests
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk 1177e3b67d fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk 533c8a8deb fix
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/androidTest/java/com/owncloud/android/ui/fragment/SharedListFragmentIT.kt
2025-12-03 13:04:30 +01:00
alperozturk 32e6ada963 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk 0cbad554b9 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk 720d753202 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk eb3e5abe00 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk 857cd674dd fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk 58ceea0462 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk a15986231e remove ui thread annotation
Signed-off-by: alperozturk <[email protected]>
2025-12-03 13:04:30 +01:00
alperozturk f1e59ec7e8 configure empty view correctly.
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:48:44 +01:00
alperozturk c609fe9340 configure empty view correctly.
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:48:42 +01:00
alperozturk 1903257a2e Rename .java to .kt
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:48:41 +01:00
alperozturk 4f922d7b94 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:48:41 +01:00
alperozturk 65ef548743 fix: empty list state visibility
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:48:41 +01:00
alperozturk 8de1bbf74f fix: empty list state visibility
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.kt

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java
2025-12-03 11:48:38 +01:00
alperozturk 8781a2363b fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:36:46 +01:00
alperozturk 5337d840a0 fix: worker start not allowed exception
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:36:01 +01:00
Alper Öztürk 112508d03a Merge pull request #15949 from nextcloud/fix/back-press-settings-activity
fix: back press handling in settings activity
2025-12-03 11:33:36 +01:00
alperozturk eb328d6740 SettingsActivity flag added to preserve activity state
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:19:48 +01:00
alperozturk 69f6d688a5 SettingsActivity flag added to preserve activity state
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:19:48 +01:00
alperozturk 2afc7108c9 SettingsActivity flag added to preserve activity state
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:19:48 +01:00
alperozturk 762d798a42 fix: back press handling in settings activity
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:19:48 +01:00
alperozturk 231353c95b fix: back press handling in settings activity
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:19:48 +01:00
alperozturk a026eabb02 fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:14:16 +01:00
alperozturk 1d259c049b fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-03 11:09:16 +01:00
alperozturk 65a43377c0 feat: use snackbar instead of toast
Signed-off-by: alperozturk <[email protected]>
2025-12-03 09:26:49 +01:00
alperozturk df7546775c feat: use snackbar instead of toast
Signed-off-by: alperozturk <[email protected]>
2025-12-03 09:26:49 +01:00
Alper Öztürk adb30bbf75 Merge pull request #16040 from nextcloud/feat/show-feedback-only-on-error
feat: show feedback only on error
2025-12-03 09:20:25 +01:00
alperozturk a952e7229b remove pdf zoom tip
Signed-off-by: alperozturk <[email protected]>
2025-12-03 08:54:42 +01:00
alperozturk c04a70b064 feat: show feedback only on error
Signed-off-by: alperozturk <[email protected]>
2025-12-03 08:41:15 +01:00
alperozturk 0b87ea55c2 feat: show feedback only on error
Signed-off-by: alperozturk <[email protected]>
2025-12-03 08:41:15 +01:00
Alper Öztürk f4e1e9172b Merge pull request #16043 from nextcloud/fix/metadata-photo-size
fix: metadata photo size
2025-12-03 08:40:18 +01:00
Nextcloud bot c80c60f69a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-03 02:45:32 +00:00
alperozturk b21d7a6458 only save if previous image dimension is null
Signed-off-by: alperozturk <[email protected]>
2025-12-02 16:14:14 +01:00
alperozturk 1ed6bdd8ec fix: metadata photo size
Signed-off-by: alperozturk <[email protected]>
2025-12-02 16:14:14 +01:00
alperozturk 10cc59efc1 fix: metadata photo size
Signed-off-by: alperozturk <[email protected]>
2025-12-02 16:14:14 +01:00
alperozturk a34df90502 fix: metadata photo size
Signed-off-by: alperozturk <[email protected]>
2025-12-02 16:14:14 +01:00
Alper Öztürk d80668d375 Merge pull request #16046 from nextcloud/fix/unit-tests
fix: unit tests
2025-12-02 16:13:51 +01:00
alperozturk 4e16ee617d fix: unit tests
Signed-off-by: alperozturk <[email protected]>
2025-12-02 16:13:37 +01:00
alperozturk d09c2f84b5 fix: unit tests
Signed-off-by: alperozturk <[email protected]>
2025-12-02 15:54:12 +01:00
Alper Öztürk 8e69d8722e Merge pull request #16045 from nextcloud/fix/gallery-row-item-identifying
fix: gallery row item identifying
2025-12-02 15:43:43 +01:00
alperozturk ca602666af fix: gallery row item identifying
Signed-off-by: alperozturk <[email protected]>
2025-12-02 14:52:21 +01:00
alperozturk 54f68b589e fix: gallery row item identifying
Signed-off-by: alperozturk <[email protected]>
2025-12-02 14:52:21 +01:00
Alper Öztürk 156ebac1cf Merge pull request #16044 from nextcloud/fix/gallery-image-generation-job
fix: image generation job
2025-12-02 12:56:36 +01:00
alperozturk c3ddbe8971 fix: image generation job
Signed-off-by: alperozturk <[email protected]>
2025-12-02 11:10:22 +01:00
Alper Öztürk 0b94d26dfe Merge pull request #15988 from nextcloud/feat/cache-content-of-different-tabs
feat: cache content of different tabs 🚀
2025-12-02 10:01:56 +01:00
alperozturk c387abcd4a fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:58:31 +01:00
alperozturk 35255cd781 fix: ocfile constructor from share
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:05 +01:00
alperozturk 493d660686 fix caching mechanism use file dao
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:05 +01:00
alperozturk 6ae533c595 fix caching mechanism use file dao
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:05 +01:00
alperozturk 9098840a5b fix caching mechanism use file dao
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:05 +01:00
alperozturk 905ef229c8 detect new shares
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:05 +01:00
alperozturk dc86f03128 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:05 +01:00
alperozturk e5094f4155 fix
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 5dfd9a018a speed up parseAndSaveShares
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 80b1a9c04a speed up parseAndSaveShares
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 7b3e948b4d speed up parseAndSaveShares
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 48351df0f9 speed up parseAndSaveShares
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 62838621ba add more OCFileListAdapterHelperTest
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 75e59553ce add more OCFileListAdapterHelperTest
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:04 +01:00
alperozturk 77f3151550 add OCFileListAdapterHelperTest
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:03 +01:00
alperozturk 1f92478c61 do not set empty list state outside of the empty list recycler view
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:03 +01:00
alperozturk ac25f9b0a4 do not set empty list state outside of the empty list recycler view
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:57:03 +01:00
alperozturk 1107c08f3e faster filtering
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/utils/extensions/OCFileExtensions.kt
2025-12-02 09:57:01 +01:00
alperozturk 54a07493c4 fix state management
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:57 +01:00
alperozturk fdf77da0be only update if new data passed
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:57 +01:00
alperozturk cab8728fde only update if new data passed
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:56 +01:00
alperozturk a5ce31a4e7 fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:56 +01:00
alperozturk e13343b3bc fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:56 +01:00
alperozturk 949251af93 fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:56 +01:00
alperozturk 1e87a96da3 fix lint
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:56 +01:00
alperozturk 90f5a1e196 remove diff util
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:55 +01:00
alperozturk 8b9cb5fe29 offload swapDirectory io jobs from main thread.
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:55 +01:00
alperozturk 68dd4044b2 extract diff util to new class
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:55 +01:00
alperozturk c375e21cc0 offload jobs from adapter
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:55 +01:00
alperozturk 2d6bf25c0d offload jobs from adapter
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:55 +01:00
alperozturk 144d639528 perf: implement diff util for adapter
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:54 +01:00
alperozturk d105cc148f feat: cache content of different tabs
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:56:54 +01:00
Alper Öztürk d02b341c0a Merge pull request #15987 from nextcloud/perf/gallery-image-task
perf: gallery image task
2025-12-02 09:55:55 +01:00
alperozturk 2757665a73 use correct placeholder and image size
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:47:36 +01:00
alperozturk 812f9717ac use correct placeholder and image size
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk a73ebf8116 use correct mime type
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk 926a11a3b5 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk cd9ba70e58 perf: simplify
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk fd784e9c01 perf: simplify
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk e16bc82fee perf: simplify
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk e7762e438e perf: simplify
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/GalleryRowHolder.kt
2025-12-02 09:15:10 +01:00
alperozturk ac0e9780a6 perf: simplify
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk f86b296822 perf: use cache if exists
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk 4d3955d9d8 perf: use cache if exists
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
alperozturk 9a5ac00ecc perf: convert gallery image generation task to coroutine
Signed-off-by: alperozturk <[email protected]>
2025-12-02 09:15:10 +01:00
Nextcloud bot 022124ac10 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-02 02:48:31 +00:00
renovate[bot] 375e534cc9 fix(deps): update dependency androidx.core:core-splashscreen to v1.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-01 09:54:44 +00:00
Andy Scherzinger 67d79594f7 Merge pull request #16037 from nextcloud/renovate/spotbugsgradleplugin
chore(deps): update dependency com.github.spotbugs to v6.4.7
2025-12-01 10:45:09 +01:00
renovate[bot] 7a35205951 chore(deps): update dependency com.github.spotbugs to v6.4.7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-01 09:05:22 +00:00
Alper Öztürk 8241e6f796 Merge pull request #15996 from nextcloud/perf/gallery-adapter-full-refresh-after-delete
fix(gallery): prevent multiple onRefresh calls during multi-image delete to avoid flicker
2025-12-01 08:24:39 +01:00
Nextcloud bot 9333feedc8 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-01 02:46:23 +00:00
Nextcloud bot ae15eb1a3f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-30 02:48:46 +00:00
Andy Scherzinger 18d1a7751a Merge pull request #16036 from nextcloud/rakekniven-patch-2
chore(i18n): Added space before ellipsis
2025-11-29 21:39:44 +01:00
rakekniven bb3181d4d6 chore(i18n): Added space before ellipsis
https://docs.nextcloud.com/server/latest/developer_manual/basics/translations.html#dos-and-don-ts

Reported at Transifex.

Signed-off-by: rakekniven <[email protected]>
2025-11-29 19:46:45 +01:00
Andy Scherzinger c079c0ad98 Merge pull request #16000 from nextcloud/renovate/lifecycleviewmodelktxversion
fix(deps): update lifecycleviewmodelktxversion to v2.10.0
2025-11-29 07:24:34 +01:00
Nextcloud bot 34f98b2a92 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-29 02:45:43 +00:00
renovate[bot] d8aef68648 chore(deps): update dependency com.google.devtools.ksp to v2.3.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-29 02:04:54 +00:00
Andy Scherzinger ba6def86f2 Merge pull request #15939 from nextcloud/renovate/commonsioversion
fix(deps): update dependency commons-io:commons-io to v2.21.0
2025-11-28 20:42:40 +01:00
renovate[bot] 67cdf5779e fix(deps): update dependency commons-io:commons-io to v2.21.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 19:18:40 +00:00
Andy Scherzinger 9ac81a4cfd Merge pull request #16032 from nextcloud/renovate/emojigoogleversion
fix(deps): update dependency com.vanniktech:emoji-google to v0.23.0
2025-11-28 19:50:44 +01:00
Andy Scherzinger d8b874bca7 Merge pull request #16028 from nextcloud/renovate/spotbugsgradleplugin
chore(deps): update dependency com.github.spotbugs to v6.4.6
2025-11-28 19:49:04 +01:00
Alper Öztürk c49412bd23 Merge pull request #16033 from nextcloud/fix/lint
fix: lint
2025-11-28 15:22:19 +01:00
alperozturk b0939f0b46 fix: lint
Signed-off-by: alperozturk <[email protected]>
2025-11-28 14:55:22 +01:00
Alper Öztürk af85f82687 Merge pull request #16026 from nextcloud/userSwitch
fix user account switch, use account name instead of hash
2025-11-28 14:30:11 +01:00
tobiasKaminsky bccd3654e4 fix user account switch, use account name instead of hash
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-28 14:27:26 +01:00
renovate[bot] c9cfb0ff57 fix(deps): update dependency com.vanniktech:emoji-google to v0.23.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 12:13:44 +00:00
renovate[bot] 84ef075f62 fix(deps): update lifecycleviewmodelktxversion to v2.10.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 13:10:49 +01:00
Tobias Kaminsky 012ee5279a Merge pull request #16029 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.229.1
2025-11-28 13:10:05 +01:00
renovate[bot] 3e6b2f7c5a chore(deps): update dependency fastlane to v2.229.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 12:08:28 +00:00
renovate[bot] 3e7494b76d chore(deps): update dependency com.github.spotbugs to v6.4.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-28 12:07:59 +00:00
Alper Öztürk 5dd572c676 Merge pull request #15934 from nextcloud/feat/chat-ui
feat: chat ui
2025-11-28 10:58:54 +01:00
alperozturk a37a94a2eb fix lint errors
Signed-off-by: alperozturk <[email protected]>
2025-11-28 10:32:14 +01:00
alperozturk 8265b7737a fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-28 10:25:13 +01:00
alperozturk c6818310c4 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-28 09:20:49 +01:00
alperozturk cbcc2d672f upgrade lib version
Signed-off-by: alperozturk <[email protected]>
2025-11-28 09:15:35 +01:00
alperozturk 3127afa17e hide history button is chat task type does not exists
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk c1bf049abd dont allow user doesnt have chat ui feature to open conversation list
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 3c7c60b6c8 update ui
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 407fc053a7 update ui
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk c14c11b8fc update ui
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk f6cbd48dad update ui
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 5ef90dbf70 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk db5fd624a4 fix delete
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk f79fd6e6d7 fix ui
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 4894bf4768 fix: chat date display
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 09651c2efd update lib
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 9e2428a981 better polling
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 835d668880 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 5d7c6f51fc fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 47e2590bf5 fix polling, chat choose
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 9a0bf09208 fix icon alignment
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk c0d637d36e consolidate screenState
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk bf4393c6c1 implement pager for side conversation screen
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 7a96aa1b13 implement fast chat
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 7bfa542110 implement fast chat
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk f898140c2e implement chat content
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk cef991cace implement chat content
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 69e517e35e feat: chat ui api calls
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk 6fa7a316ca feat: chat ui api calls
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
alperozturk ff3dd36dcd feat: chat ui
Signed-off-by: alperozturk <[email protected]>
2025-11-28 08:58:38 +01:00
Nextcloud bot 028fdfedaa fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-28 02:44:05 +00:00
Andy Scherzinger c02f880a10 Merge pull request #15938 from nextcloud/renovate/fbcontribversion
fix(deps): update dependency com.mebigfatguy.fb-contrib:fb-contrib to v7.7.1
2025-11-27 22:27:49 +01:00
renovate[bot] 04c83ead01 fix(deps): update dependency com.mebigfatguy.fb-contrib:fb-contrib to v7.7.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-27 20:52:09 +00:00
Alper Öztürk 0830e68dd5 Merge pull request #16020 from nextcloud/fix/set-status-message-time-set
fix: set status message time set
2025-11-27 11:16:55 +01:00
Tobias Kaminsky 3bd4ce210e Merge pull request #16022 from nextcloud/fix/ss-tests-build
fix: dialog fragment it
2025-11-27 10:23:42 +01:00
alperozturk 6b85e436df fix: dialog fragment it
Signed-off-by: alperozturk <[email protected]>
2025-11-27 10:14:52 +01:00
Tobias Kaminsky 991302f5d1 Merge pull request #15583 from nextcloud/renovate/emojigoogleversion
fix(deps): update dependency com.vanniktech:emoji-google to v0.22.0
2025-11-27 09:51:35 +01:00
alperozturk 5a049b75d7 fix: set status message time set
Signed-off-by: alperozturk <[email protected]>
2025-11-27 09:23:17 +01:00
Tobias Kaminsky c6b33f588e Merge pull request #15849 from nextcloud/renovate/major-spotless
chore(deps): update dependency com.diffplug.spotless to v8
2025-11-27 09:03:41 +01:00
renovate[bot] 4b108f258c fix(deps): update dependency com.vanniktech:emoji-google to v0.22.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-27 09:00:52 +01:00
tobiasKaminsky da64f1770f update verification-metadata.xml and apply changes
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-27 08:54:10 +01:00
Nextcloud bot f292800286 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-27 02:50:38 +00:00
Andy Scherzinger d49532caaa Merge pull request #15998 from nextcloud/renovate/roomversion
fix(deps): update roomversion to v2.8.4
2025-11-26 14:13:21 +01:00
renovate[bot] a96d529012 fix(deps): update roomversion to v2.8.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-26 13:39:44 +01:00
Alper Öztürk 128ac02c33 Merge pull request #15975 from nextcloud/simplify-do-thumbnail-from-oc-file-in-background
refactor(thumbnails): simplify doThumbnailFromOCFileInBackground logic
2025-11-26 13:06:08 +01:00
Tobias Kaminsky 617185314c Merge pull request #16017 from nextcloud/uploadNewSpotbugsOnlyIfExist
Spotbugs: update xml only if it exists
2025-11-26 13:04:22 +01:00
tobiasKaminsky 8cca3e1061 Spotbugs: update xml only if it exists
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-26 12:56:19 +01:00
alperozturk e439312a4c refactor(thumbnails): simplify doThumbnailFromOCFileInBackground logic
Signed-off-by: alperozturk <[email protected]>
2025-11-26 12:10:59 +01:00
Alper Öztürk 931fcdaeb5 Merge pull request #15920 from nextcloud/fix/handle-ask-user-name-collision-policy
fix: handle ask user name collision policy
2025-11-26 12:10:20 +01:00
alperozturk 5ca943484a fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-26 12:10:07 +01:00
alperozturk 77e08666c8 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:55:57 +01:00
alperozturk ff815e310f fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:51:34 +01:00
alperozturk f7be02e79f fix notification error id handling
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:46:24 +01:00
alperozturk 31c37420a7 fix notification error id handling
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:46:24 +01:00
alperozturk 7d9256829c fix error handling
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:46:23 +01:00
alperozturk c8f83f87fe fix error handling
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:46:21 +01:00
alperozturk df14197b67 fix pending intents
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:46:19 +01:00
alperozturk c889012358 simplify SyncConflictManager
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:46:19 +01:00
alperozturk 7246e5b7b7 fix: handle ask user name collision policy
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/client/jobs/upload/UploadNotificationManager.kt
2025-11-26 11:46:16 +01:00
Alper Öztürk 34b7eadc9a Merge pull request #15336 from nextcloud/refactor-utils
Refactor utils
2025-11-26 11:45:04 +01:00
Tobias Kaminsky 5770b93523 Merge pull request #15661 from nextcloud/mte
Opt-in to Arm MTE
2025-11-26 11:42:50 +01:00
Alper Öztürk e64a017b8e Merge pull request #15974 from nextcloud/simplify-do-rezised-image-in-background
refactor(thumbnails): simplify doResizedImageInBackground logic
2025-11-26 11:40:04 +01:00
Alper Öztürk 43f838cfa1 Merge pull request #15962 from nextcloud/fix/do-not-show-current-dir-if-not-exists-in-unified-search-fragment
fix(unified-search): hide current directory section when path does not exists
2025-11-26 11:39:35 +01:00
Alper Öztürk 90e9a4f88e Merge pull request #15977 from nextcloud/improve-storage-permission-ui-ux
improve storage permission ui ux
2025-11-26 11:39:22 +01:00
alperozturk 7e49ba7444 fix changes
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:33:40 +01:00
alperozturk 56edf135b3 fix dark mode background color
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 19222459c6 listen user's choice
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 602db2e499 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 6c0bea1a75 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 17221fb8cd fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk aa6624db1b fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk f179b3cd91 handle edge case scenarious
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 4c89b09650 handle back button behaviour
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk e3d22f07ab change translations
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
Alper Öztürkandkramo 1c41ddaa29 Update app/src/main/res/values/strings.xml
Co-authored-by: kramo <[email protected]>
Signed-off-by: Alper Öztürk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 9f507b3210 ask media permission as well after full file access
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 6088b9839f fix: unused parameter lint
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk af19d396b1 chooseStoragePathItem button will close the current screen if no permission
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk cbd614cfb5 fix remove double check, simply permissions
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk a611ea0876 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 53553fce05 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk bbb5fce979 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 468d9ad584 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 5ff6549ed2 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 5d2efc8ae3 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
alperozturk 974f01a299 improve storage permission ui ux
Signed-off-by: alperozturk <[email protected]>
2025-11-26 11:24:39 +01:00
Tobias Kaminsky 00d57f2b68 Merge pull request #15902 from nextcloud/perf/gallery-row-holder-caching
perf: gallery row holder caching
2025-11-26 09:58:08 +01:00
Tobias Kaminsky d1c80d5470 Merge pull request #15221 from nextcloud/showQuotaErrorMessage
Show quota error message
2025-11-26 09:43:47 +01:00
tobiasKaminsky 2c066345d8 Trashbin: show correct sorting order
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-26 07:43:00 +01:00
Nextcloud bot 121b60a253 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-26 02:48:21 +00:00
Andy Scherzinger 592e2ab152 Merge pull request #16008 from duvvuvenkataramana/patch-5
Update strings.xml Fix typo in offline_operations_file_does_not_exist…
2025-11-25 20:51:19 +01:00
duvvuvenkataramana 43e626e726 Update strings.xml Fix typo in offline_operations_file_does_not_exists_yet value
Signed-off-by: duvvuvenkataramana <[email protected]>
2025-11-25 23:55:33 +05:30
renovate[bot] 3d6c006122 chore(deps): update reactivecircus/android-emulator-runner action to v2.35.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-25 10:07:10 +01:00
Tobias Kaminsky f2a09e45f6 Merge pull request #15948 from nextcloud/fix/search-view-focus
fix: search view focus
2025-11-25 09:57:47 +01:00
Alper Öztürk 7a5e28316a Merge pull request #16003 from nextcloud/build/fix-gradle-9.2.1
build: fix gradle 9.2.1
2025-11-25 08:33:02 +01:00
alperozturk c15102b35c build: fix gradle 9.2.1
Signed-off-by: alperozturk <[email protected]>
2025-11-25 08:32:04 +01:00
Nextcloud bot 13746ab58e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-25 02:52:06 +00:00
renovate[bot] b4b9c70bad chore(deps): update dependency com.diffplug.spotless to v8
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 21:29:20 +00:00
Joas Schilling f35bb52da9 Merge pull request #16002 from nextcloud/nickvergessen-patch-1
Update renovate configuration for scheduling and rebase
2025-11-24 21:08:50 +01:00
Joas Schilling 9914ea0d8b Update renovate configuration for scheduling and rebase
Signed-off-by: Joas Schilling <[email protected]>
2025-11-24 21:06:41 +01:00
Andy Scherzinger c02a49e558 Merge pull request #15979 from nextcloud/renovate/gradle-9.x
chore(deps): update gradle to v9.2.1
2025-11-24 20:04:54 +01:00
Andy Scherzinger 4164553469 Merge pull request #15997 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.5
2025-11-24 20:04:04 +01:00
renovate[bot] bc22506794 chore(deps): update gradle to v9.2.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 18:40:23 +00:00
renovate[bot] d4fe4e8881 chore(deps): update github/codeql-action action to v4.31.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 18:35:17 +00:00
Andy Scherzinger 476b94e946 Merge pull request #15995 from RamsaiPolisetti/fix/my-change
Fix typo in README: correct signing certificate verification link
2025-11-24 19:30:51 +01:00
Andy Scherzinger 2bc7de234c Merge pull request #15999 from nextcloud/renovate/fastlane-2.x-lockfile
chore(deps): update dependency fastlane to v2.229.0
2025-11-24 19:24:46 +01:00
Andy Scherzinger 586264cecd Merge pull request #16001 from nextcloud/renovate/actions-checkout-6.x
chore(deps): update actions/checkout action to v6
2025-11-24 19:24:10 +01:00
renovate[bot] 641dafe934 chore(deps): update actions/checkout action to v6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 17:23:15 +00:00
renovate[bot] 70cf59f3e4 chore(deps): update dependency fastlane to v2.229.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-24 17:22:03 +00:00
alperozturk 9676f0f044 perf: gallery adapter fix full refresh after multiple files deletion
Signed-off-by: alperozturk <[email protected]>
2025-11-24 15:37:29 +01:00
Ramsai Polisetti 35f5b93e85 Fix typo in README: correct signing certificate verification link 2025-11-24 19:43:18 +05:30
alperozturk 006fc5a685 fix: only rebuild if file count changed
Signed-off-by: alperozturk <[email protected]>
2025-11-24 14:02:45 +01:00
alperozturk 1613d064e9 fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-24 14:02:45 +01:00
alperozturk 35c30f23ba perf: gallery row holder caching
Signed-off-by: alperozturk <[email protected]>
2025-11-24 14:02:45 +01:00
alperozturk 11d30a9440 perf: gallery row holder caching
Signed-off-by: alperozturk <[email protected]>
2025-11-24 14:02:45 +01:00
Nextcloud bot 4a5d23baf9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-24 02:49:22 +00:00
Nextcloud bot f7041bbb25 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-23 02:52:24 +00:00
Nextcloud bot b5a3fdd8cc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-22 02:47:59 +00:00
Alper Öztürk 0c8291f979 Merge pull request #15947 from nextcloud/fix/search-task-screen-state-handling
fix: search task screen state handling
2025-11-20 13:17:34 +01:00
Nextcloud bot 04689b9548 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-20 02:50:54 +00:00
Nextcloud bot 243d7e4d36 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-19 02:49:44 +00:00
Andy Scherzinger 60d3c3f9b8 Merge pull request #15981 from nextcloud/renovate/actions-checkout-5.x
chore(deps): update actions/checkout action to v5.0.1
2025-11-18 21:27:31 +01:00
renovate[bot] 29752e297f chore(deps): update actions/checkout action to v5.0.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-18 11:36:40 +00:00
Andy Scherzinger db2de63269 Merge pull request #15964 from nextcloud/renovate/spotbugsgradleplugin
chore(deps): update dependency com.github.spotbugs to v6.4.5
2025-11-18 12:34:14 +01:00
renovate[bot] 9fede9a7d1 chore(deps): update dependency com.github.spotbugs to v6.4.5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-18 03:08:19 +00:00
Nextcloud bot 6e1315783d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-18 02:48:16 +00:00
Andy Scherzinger e753e57ed4 Merge pull request #15978 from nextcloud/renovate/ubuntu-noble
chore(deps): update ubuntu:noble docker digest to c35e29c
2025-11-17 21:56:39 +01:00
renovate[bot] 0348cec5d1 chore(deps): update ubuntu:noble docker digest to c35e29c
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-17 18:02:57 +00:00
Andy Scherzinger 3a1b6af95c Merge pull request #15941 from nextcloud/renovate/androidpluginversion
chore(deps): update androidpluginversion to v8.13.1
2025-11-17 12:18:10 +01:00
renovate[bot] facca2f048 chore(deps): update androidpluginversion to v8.13.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-17 10:47:36 +00:00
Alper Öztürk a155050158 Merge pull request #15951 from nextcloud/brandedClientsHideInternalUploader
branded clients: no internal uploader
2025-11-17 11:26:23 +01:00
alperozturk d5dfaba25b fix build
Signed-off-by: alperozturk <[email protected]>
2025-11-17 11:22:44 +01:00
tobiasKaminsky ef39ff3a0a branded clients: no internal uploader
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-17 11:20:48 +01:00
Alper Öztürk 270bfd961f Merge pull request #15952 from nextcloud/fix/galleryBottomSheetVisibility
Gallery: open bottom sheet full in landscape mode
2025-11-17 11:20:35 +01:00
tobiasKaminsky 10304a4771 Gallery: open bottom sheet full in landscape mode
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-17 11:15:17 +01:00
Alper Öztürk 6691d119b7 Merge pull request #15967 from Edge-Seven/Fix/typos/20251115094849
docs: fix typos in some files
2025-11-17 11:14:48 +01:00
Alper Öztürk c9c3c99583 Merge pull request #15932 from nextcloud/fix/loading-indicator
fix: loading indicator
2025-11-17 10:38:25 +01:00
alperozturk cde23750e5 refactor(thumbnails): simplify doResizedImageInBackground logic
Signed-off-by: alperozturk <[email protected]>
2025-11-17 08:48:16 +01:00
alperozturk bb5e54d0cd refactor(thumbnails): simplify doResizedImageInBackground logic
Signed-off-by: alperozturk <[email protected]>
2025-11-17 08:47:37 +01:00
Nextcloud bot 8bab7946b0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-17 02:43:48 +00:00
Nextcloud bot aca2456819 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-16 02:42:52 +00:00
khanhkhanhlele 4568ba012e Fix typos in some files 2025-11-15 09:48:49 +07:00
Nextcloud bot ced32a7fc5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-15 02:43:43 +00:00
Andy Scherzinger ef9629c2e3 Merge pull request #15965 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.3
2025-11-14 20:43:13 +01:00
renovate[bot] ec816956a6 chore(deps): update github/codeql-action action to v4.31.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-14 18:45:48 +00:00
Andy Scherzinger 0262e6f0ed Merge pull request #15963 from nextcloud/renovate/ubuntu-noble
chore(deps): update ubuntu:noble docker digest to e96e81f
2025-11-14 19:19:01 +01:00
renovate[bot] 69ed26d36c chore(deps): update ubuntu:noble docker digest to e96e81f
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-14 18:15:07 +00:00
alperozturk eeeb6db32a fix(unified-search): hide current directory section when path does not exist
Signed-off-by: alperozturk <[email protected]>
2025-11-14 16:12:08 +01:00
Tobias Kaminsky e72fc522bd Merge pull request #15959 from nextcloud/signDrone
sign drone
2025-11-14 10:52:06 +01:00
tobiasKaminsky 4e359c778d sign drone
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-14 10:50:43 +01:00
Alper Öztürk 1c7a39e407 Merge pull request #15880 from nextcloud/fix/image-rotation
fix: image rotation
2025-11-14 10:50:04 +01:00
Alper Öztürk f2c313768c Merge pull request #15872 from nextcloud/fix/choose-correct-upload-ids-for-retry
fix: choose correct upload ids for retry
2025-11-14 10:49:50 +01:00
Tobias Kaminsky 661048d53c Merge pull request #15897 from nextcloud/feat/improve-llm
feat: improve llm
2025-11-14 10:05:20 +01:00
alperozturk 589b9d7d9f fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-14 10:01:40 +01:00
alperozturk ae2846d928 fix: image rotation
Signed-off-by: alperozturk <[email protected]>
2025-11-14 10:01:40 +01:00
alperozturk bf2ea03d2f fix: image rotation
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/utils/extensions/FileExtensions.kt
2025-11-14 10:01:40 +01:00
alperozturk e9dc26070b fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-14 09:56:28 +01:00
alperozturk 0a42dc7952 fix: retryFailedUploads calls
Signed-off-by: alperozturk <[email protected]>
2025-11-14 09:56:28 +01:00
alperozturk 27c97bc773 fix: retryFailedUploads calls
Signed-off-by: alperozturk <[email protected]>
2025-11-14 09:56:28 +01:00
alperozturk 66b26040ef fix: choose correct upload ids for retry
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/client/jobs/upload/FileUploadHelper.kt
2025-11-14 09:56:28 +01:00
Nextcloud bot 49890e77df fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-14 02:43:25 +00:00
Alper Öztürk d4b4254710 Merge pull request #15954 from nextcloud/fix/unit-test-yml
fix: unit test yml
2025-11-13 14:36:05 +01:00
Alper Öztürk 612e5e1a83 Merge pull request #15933 from nextcloud/clearify-passcode-explanation
change passcode explanation text
2025-11-13 12:19:57 +01:00
alperozturk cbedadcabe fix: unit test yml
Signed-off-by: alperozturk <[email protected]>
2025-11-13 11:01:16 +01:00
alperozturk f67862cba8 fix: unit test yml
Signed-off-by: alperozturk <[email protected]>
2025-11-13 10:52:02 +01:00
alperozturk 27a2e88e41 fix: unit test yml
Signed-off-by: alperozturk <[email protected]>
2025-11-13 10:46:48 +01:00
Nextcloud bot 4c5ee6e104 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-13 02:46:30 +00:00
alperozturk 54b28f60a3 fix: search view focus
Signed-off-by: alperozturk <[email protected]>
2025-11-12 15:34:46 +01:00
alperozturk e99a4348ae fix: search task screen state handling
Signed-off-by: alperozturk <[email protected]>
2025-11-12 14:25:38 +01:00
alperozturk 7732562f0c fix: search task screen state handling
Signed-off-by: alperozturk <[email protected]>
2025-11-12 14:20:02 +01:00
Nextcloud bot 16195c57a7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-12 02:46:38 +00:00
Nextcloud bot a9b5dc86dc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-11 06:33:27 +00:00
alperozturk 682dd708c0 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-10 13:57:45 +01:00
alperozturk 4eaecf72c9 fix: ui state
Signed-off-by: alperozturk <[email protected]>
2025-11-10 13:57:45 +01:00
alperozturk 6635afa01a fix: ui state
Signed-off-by: alperozturk <[email protected]>
2025-11-10 13:57:45 +01:00
alperozturk 549b455c49 feat: add polling mechanism for fetching task list
Signed-off-by: alperozturk <[email protected]>
2025-11-10 13:57:45 +01:00
alperozturk 7ecd74b7de feat: cache results
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/94.json
#	app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt
#	app/src/main/java/com/owncloud/android/db/ProviderMeta.java
2025-11-10 13:57:45 +01:00
alperozturk 3565c27ee2 feat: add indicate when a response is AI-generated.
Signed-off-by: alperozturk <[email protected]>
2025-11-10 13:57:45 +01:00
alperozturk 4af7b86b5b change passcode explanation text
Signed-off-by: alperozturk <[email protected]>
2025-11-10 10:45:01 +01:00
alperozturk 596468e635 fix: codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-10 09:41:12 +01:00
alperozturk 30fc950e0d fix: loading indicator
Signed-off-by: alperozturk <[email protected]>
2025-11-10 09:23:32 +01:00
Alper Öztürk 378dbbf752 Merge pull request #15919 from nextcloud/fix/gallery-adapter-ids
fix: gallery adapter ids
2025-11-07 14:43:39 +01:00
Alper Öztürk 55f3275e84 Merge pull request #15874 from nextcloud/fix/handle-skip-name-collision-policy
fix: handle skip name collision policy
2025-11-07 12:30:30 +01:00
alperozturk 3ab1163d8e add reason text for skip pollicy
Signed-off-by: alperozturk <[email protected]>
2025-11-07 12:29:48 +01:00
Andy Scherzinger 6dcf4f1029 style(icon): Use outline variant
Signed-off-by: Andy Scherzinger <[email protected]>
2025-11-07 12:28:38 +01:00
alperozturk 92aae7f31d add better documentation for name collision policy
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
alperozturk 1889cd7fe1 add better documentation for name collision policy
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
alperozturk 62353b1067 add better documentation for name collision policy
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
alperozturk 35d10fce29 add skipped upload group
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
alperozturk 00cc8194db mark as skipped
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
alperozturk 89848fd104 fix: handle skip name collision policy
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
alperozturk dd405080a3 fix: handle skip name collision policy
Signed-off-by: alperozturk <[email protected]>
2025-11-07 09:52:39 +01:00
Alper Öztürk b0522e1103 Merge pull request #15921 from nextcloud/rakekniven-patch-2
fix(i18n): Plural wasn't working on i18n system
2025-11-07 08:55:29 +01:00
rakekniven 2848589c5f fix(i18n): Plural wasn't working on i18n system
Reported at Transifex

Signed-off-by: rakekniven <[email protected]>
2025-11-06 18:53:49 +01:00
alperozturk 69b9452eae fix: gallery adapter ids
Signed-off-by: alperozturk <[email protected]>
2025-11-06 11:18:01 +01:00
alperozturk d0ac88bc59 fix: gallery adapter ids
Signed-off-by: alperozturk <[email protected]>
2025-11-06 11:01:45 +01:00
alperozturk 676d10c436 fix: gallery adapter ids
Signed-off-by: alperozturk <[email protected]>
2025-11-06 10:58:46 +01:00
alperozturk 2e710fad05 fix: gallery adapter ids
Signed-off-by: alperozturk <[email protected]>
2025-11-06 10:46:53 +01:00
Alper Öztürk 869f64cdef Merge pull request #15917 from nextcloud/fix/master-build
fix: master build
2025-11-06 09:34:31 +01:00
alperozturk 857802d505 fix: master build
Signed-off-by: alperozturk <[email protected]>
2025-11-06 09:11:24 +01:00
Tobias Kaminsky c62ffddd75 Merge pull request #15916 from nextcloud/lintError
Lint: treat warnings as errors, fail with exit code 1
2025-11-06 08:15:36 +01:00
tobiasKaminsky 9e4ea8fa3a Lint: treat warnings as errors, fail with exit code 1
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-06 07:45:46 +01:00
Andy Scherzinger 57867bcef0 Merge pull request #15913 from nextcloud/renovate/ksp-monorepo
chore(deps): update dependency com.google.devtools.ksp to v2.3.1
2025-11-05 22:35:43 +01:00
renovate[bot] 42daa4029d chore(deps): update dependency com.google.devtools.ksp to v2.3.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-05 21:14:04 +00:00
Andy Scherzinger 73942bd401 Merge pull request #15687 from nextcloud/renovate/roomversion
fix(deps): update roomversion to v2.8.3
2025-11-05 21:42:08 +01:00
Andy Scherzinger b4e52b0b2d Merge pull request #15898 from nextcloud/renovate/gradle-9.x
chore(deps): update gradle to v9.2.0
2025-11-05 21:40:35 +01:00
renovate[bot] 0e6f073363 chore(deps): update gradle to v9.2.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-05 15:25:29 +00:00
renovate[bot] 4e3abe0b7b fix(deps): update roomversion to v2.8.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-05 15:20:30 +00:00
Alper Öztürk e387317280 Merge pull request #15911 from nextcloud/lintZero
suppress all lint to have it down to zero
2025-11-05 16:08:38 +01:00
tobiasKaminsky 9ce1ee8747 suppress all lint to have it down to zero
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-05 15:51:22 +01:00
Alper Öztürk 9602b409f3 Merge pull request #15772 from nextcloud/sub
show outdated warning depending on subscription key
2025-11-05 11:19:12 +01:00
alperozturk 2391368ab0 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-05 11:18:11 +01:00
tobiasKaminsky 4e7699dd9f show warning only within app, due to login flow v2 other is barely visible
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-05 11:12:36 +01:00
tobiasKaminsky 1965ad192f show outdated warning depending on subscription key
Signed-off-by: tobiasKaminsky <[email protected]>

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/94.json
#	app/src/main/java/com/nextcloud/client/database/entity/CapabilityEntity.kt
#	build.gradle
2025-11-05 11:12:33 +01:00
Alper Öztürk 2493285d76 Merge pull request #15901 from nextcloud/perf/gallery-adapter-caching
perf: gallery adapter caching
2025-11-05 11:11:27 +01:00
alperozturk 6ede6d617b fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-05 11:07:01 +01:00
alperozturk 3296f9945f perf: gallery adapter caching
Signed-off-by: alperozturk <[email protected]>
2025-11-05 11:05:10 +01:00
alperozturk 08ef1b3982 perf: gallery adapter caching
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/adapter/GalleryAdapter.kt
2025-11-05 11:05:08 +01:00
Alper Öztürk 78a17b7fca Merge pull request #15824 from nextcloud/skip-auto-rename-if-wcf-disabled
skip auto rename and filename validator if wcf disabled
2025-11-05 11:01:42 +01:00
alperozturk c136c2e7b0 use NextcloudVersion
Signed-off-by: alperozturk <[email protected]>
2025-11-05 11:00:58 +01:00
alperozturk 3006898c07 fix condition and add tests
Signed-off-by: alperozturk <[email protected]>
2025-11-05 10:54:19 +01:00
alperozturk 08548923ff solve git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-05 10:54:19 +01:00
alperozturk 549fd05eaa fix tests
Signed-off-by: alperozturk <[email protected]>
2025-11-05 10:54:19 +01:00
alperozturk 567eefa484 skip auto rename if wcf disabled
Signed-off-by: alperozturk <[email protected]>
2025-11-05 10:54:18 +01:00
Alper Öztürk ea25524542 Merge pull request #15884 from nextcloud/handle-nullable-current-file
handle nullable current file
2025-11-05 10:53:39 +01:00
Alper Öztürk 6921155e35 Merge pull request #15861 from nextcloud/fix/insert-custom-folder-db
fix: insert custom folder db
2025-11-05 10:53:04 +01:00
Tobias Kaminsky 978c574ead Merge pull request #15900 from nextcloud/fix/refreshing-gallery-adapter-fully
fix: only refresh related gallery row
2025-11-05 10:23:27 +01:00
Tobias Kaminsky 33feff4c79 Merge pull request #15883 from nextcloud/fix/read-only-collection
fix: read only collection
2025-11-05 10:10:16 +01:00
alperozturk d608d9c903 handle nullable current file
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:48:43 +01:00
alperozturk fa54e8aa13 fix shouldSkipFile
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 667ab2949d fix shouldSkipFile
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 6e728c53f9 fix shouldSkipFile
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 7f10f801b4 add doc for isExisting
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 261490a2cc fix alsoUploadExistingFiles
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 69217bd118 add skip existing files on remote, add tests
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 13bacfe59a fix codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk a5c2b2f875 fix: insert custom folder db
Signed-off-by: alperozturk <[email protected]>
2025-11-05 08:46:41 +01:00
alperozturk 8d4bfeff9f fix: only refresh related gallery row
Signed-off-by: alperozturk <[email protected]>
2025-11-04 12:05:31 +01:00
Andy Scherzinger 90ebd53227 Merge pull request #15893 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.2
2025-11-03 23:09:39 +01:00
renovate[bot] 04bd74ac09 chore(deps): update github/codeql-action action to v4.31.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-03 09:25:47 +00:00
Alper Öztürk 104d1e6663 Merge pull request #15873 from nextcloud/fix/yml-files
fix: yml files
2025-11-03 10:24:46 +01:00
Alper Öztürk 04aec3f7c8 Merge branch 'master' into fix/yml-files
Signed-off-by: Alper Öztürk <[email protected]>
2025-11-03 09:33:53 +01:00
Alper Öztürk f5814b9822 Merge pull request #15890 from nextcloud/rakekniven-patch-2
chore(i18n): Removed quotation mark
2025-11-03 09:32:23 +01:00
Alper Öztürk 0710c82101 Merge pull request #15756 from nextcloud/fix/handle-slow-internet-connection-better-for-fetching-shares
fix: handle slow internet connection better for fetching shares
2025-11-03 09:20:25 +01:00
alperozturk e8b0d378f3 fix github actions
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:15:59 +01:00
alperozturk cd4c43ce82 fix github actions
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:15:59 +01:00
alperozturk d384dc5a43 fix yml file
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:15:59 +01:00
alperozturk f7c1f921bb fix: yml files
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	scripts/buildDev
2025-11-03 09:15:59 +01:00
alperozturk d31db26d00 fix git conflict
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:14:12 +01:00
alperozturk dff8ee60a3 add: new no internet icon
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:14:12 +01:00
alperozturk 9be50ef142 fix: codacy
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:14:12 +01:00
alperozturk 3a8bbd0ebb fix: showFederatedShareAvatar
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:14:12 +01:00
alperozturk 0dbaf81dbb add: task timeout
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:14:12 +01:00
alperozturk d9d0f88bce add: task timeout
Signed-off-by: alperozturk <[email protected]>
2025-11-03 09:14:12 +01:00
alperozturk 0f7ce1e33f add: new empty list type
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/res/values/strings.xml
2025-11-03 09:14:12 +01:00
alperozturk 4c80d1c5c3 fix: handle slow internet connection better for fetching shares
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	build.gradle
2025-11-03 09:14:12 +01:00
Tobias Kaminsky ed4b7addff Merge pull request #15847 from nextcloud/renovate/playservicesbaseversion
fix(deps): update dependency com.google.android.gms:play-services-base to v18.9.0
2025-11-03 09:08:53 +01:00
renovate[bot] 300b499a10 fix(deps): update dependency com.google.android.gms:play-services-base to v18.9.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-03 07:13:44 +00:00
Tobias Kaminsky 6fa1ed5c3d Merge pull request #15892 from nextcloud/adjustBuildDev
adjust buildDev script to .kts syntax
2025-11-03 08:00:48 +01:00
tobiasKaminsky dfddbf0e07 adjust buildDev script to .kts syntax
Signed-off-by: tobiasKaminsky <[email protected]>
2025-11-03 07:58:46 +01:00
Nextcloud bot 24053b5bd9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-03 02:44:59 +00:00
rakekniven bc3b4218a1 chore(i18n): Removed quotation mark
Signed-off-by: rakekniven <[email protected]>
2025-11-02 17:14:44 +01:00
Nextcloud bot 9a2a313b8f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-01 02:39:53 +00:00
alperozturk fdbe3822c5 fix: read only collection
Signed-off-by: alperozturk <[email protected]>
2025-10-31 15:49:47 +01:00
Alper Öztürk b5a3e6be29 Merge pull request #15879 from nextcloud/fix/set-current-file
fix: set current file
2025-10-31 15:48:09 +01:00
Alper Öztürk a5c7b87bf1 Merge pull request #15818 from nextcloud/add/idle-empty-list-state
fix: folder picker activity empty list state
2025-10-31 15:20:27 +01:00
alperozturk e89141a714 fix: set current file
Signed-off-by: alperozturk <[email protected]>
2025-10-31 09:38:03 +01:00
Alper Öztürk dc3b8c6918 Merge pull request #15876 from nextcloud/style/noid/mimetypeIconForWhiteboard
Add mimetype icon for Nextcloud whiteboard files
2025-10-31 08:20:32 +01:00
Nextcloud bot 54dd53c6ff fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-31 02:42:32 +00:00
Andy Scherzinger 96f6cc3a43 Merge pull request #15875 from nextcloud/fix/empty-list-loading-text-color
fix: empty list loading text color
2025-10-30 22:31:50 +01:00
Andy Scherzinger 9d0740294c style(icons): Add mimetype icon for Nextcloud whiteboard files
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-30 18:57:20 +01:00
Alper Öztürk 4fe9328b4c Merge pull request #15714 from eltos/eltos-remove-share-button
Hide share button in portrait mode to save space
2025-10-30 16:15:18 +01:00
alperozturk 349c1bc919 fix: empty list loading text color
Signed-off-by: alperozturk <[email protected]>
2025-10-30 16:08:35 +01:00
Philipp Niedermayer e69f2976a0 Hide share button in portrait mode to save space
Signed-off-by: Philipp Niedermayer <[email protected]>
2025-10-30 15:52:56 +01:00
Alper Öztürk dd87b213d7 Merge pull request #15859 from jimlyas/chore/gradle-new
Chore: Improve Gradle Configuration
2025-10-30 08:53:31 +01:00
Jimly Asshiddiqy 96debdd3a5 chore(gradle): update libraries
Signed-off-by: Jimly Asshiddiqy <[email protected]>
2025-10-30 13:36:14 +07:00
Jimly Asshiddiqy bdc9bb1829 chore(gradle): update header
Signed-off-by: Jimly Asshiddiqy <[email protected]>
2025-10-30 13:36:14 +07:00
Jimly Asshiddiqy 07c09e1e99 chore(gradle): Resolve comments
Signed-off-by: Jimly Asshiddiqy <[email protected]>
2025-10-30 13:36:14 +07:00
Jimly Asshiddiqy 5fd2e2942c chore(gradle): Improve Gradle Configuration
- Rename build.gradle to build.gradle.kts
- Rename settings.gradle to settings.gradle
- Rename jacoco.gradle to jacoco.gradle.kts
- Refactor some entries in the libs.versions.toml
- Change running test task from to run jacoco task to trigger task, now it's reversed... we run the test task that will trigger the jacoco task

Signed-off-by: Jimly Asshiddiqy <[email protected]>
2025-10-30 13:36:14 +07:00
Tobias Kaminsky 2bb71c8b89 Merge pull request #15863 from nextcloud/galleryMenu
Gallery Bottom Sheet can be shown during search
2025-10-30 07:16:20 +01:00
Nextcloud bot 64f79d8462 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-30 02:41:35 +00:00
Alper Öztürk ac7d82a7f0 Merge pull request #15855 from nextcloud/fix/open-file-intent-crash
fix: open file intent crash
2025-10-29 11:16:32 +01:00
alperozturk 27340def2c fix: ui glitch when press back from shortcut
Signed-off-by: alperozturk <[email protected]>
2025-10-29 11:06:00 +01:00
alperozturk e8a8a82671 fix: open file intent crash
Signed-off-by: alperozturk <[email protected]>
2025-10-29 11:06:00 +01:00
tobiasKaminsky 7a1ac3b3bf Gallery Bottom Sheet can be shown during search
Signed-off-by: tobiasKaminsky <[email protected]>
2025-10-29 07:17:54 +01:00
Nextcloud bot 416e2b80f8 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-29 02:46:33 +00:00
Alper Öztürk 176577aae8 Merge pull request #15860 from nextcloud/revert-input-stream-binder
revert input stream changes
2025-10-28 10:22:20 +01:00
alperozturk 2500a692a7 revert input stream changes
Signed-off-by: alperozturk <[email protected]>
2025-10-28 10:21:05 +01:00
Nextcloud bot 076972789e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-28 02:46:17 +00:00
Andy Scherzinger 0c737e04c5 Merge pull request #15842 from nextcloud/renovate/kotlin-monorepo
fix(deps): update kotlin monorepo to v2.2.21
2025-10-27 16:26:37 +01:00
renovate[bot] 46d1253210 chore(deps): update kotlin to v2.2.21
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 13:44:40 +01:00
renovate[bot] 2719530f7a chore(deps): update dependency com.google.devtools.ksp to v2.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 13:20:13 +01:00
renovate[bot] 72ff3a5f26 fix(deps): update kotlin monorepo to v2.2.21
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 13:18:37 +01:00
Andy Scherzinger 0028b6f0fd Merge pull request #15852 from nextcloud/renovate/composebom
fix(deps): update dependency androidx.compose:compose-bom to v2025.10.01
2025-10-27 13:18:08 +01:00
Andy Scherzinger e77b10ebdc ci(lint): Lower lint sore
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-27 10:11:12 +01:00
Andy Scherzinger 88fc3f362b ci(chksm): Add meta-data
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-27 09:31:16 +01:00
Andy Scherzinger 1d19cc6992 ci(lint): Lower score to reflect current state
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-27 09:31:16 +01:00
renovate[bot] d831a8b96d fix(deps): update dependency androidx.compose:compose-bom to v2025.10.01
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 09:31:15 +01:00
Alper Öztürk 3453a7a1f3 Merge pull request #15806 from nextcloud/use-dao-in-upload-list-adapter-for-consistency
use dao in upload list adapter
2025-10-27 08:57:32 +01:00
alperozturk 2f58e63b45 fix: load upload group async load
Signed-off-by: alperozturk <[email protected]>
2025-10-27 08:53:52 +01:00
alperozturk cbe2e9e433 use dao in upload list adapter
Signed-off-by: alperozturk <[email protected]>
2025-10-27 08:53:52 +01:00
Alper Öztürk 17e6e553e5 Merge pull request #15669 from PhilLab/fix_15636_deleting_from_slideshow
Fix deleting from slideshow
2025-10-27 08:33:59 +01:00
Philipp Hasper 4453eaf5d3 fix: deletion from slideshow for cases were user is not present
In that case, deleting the currently viewed file had the following issues:
1. When deleting the first image, the UI just stayed with it.
2. When deleting another image, the UI switched to the previous image,
   instead of the next one, which is inconsistent to the behavior when
   user is available
3. When switching to the next image, the title shown at the top did
   not correctly update

Signed-off-by: Philipp Hasper <[email protected]>
2025-10-27 08:30:21 +01:00
Philipp Hasper 21e0c82e65 fix: deletion from slideshow works again
The patch added in #14782 prevented that the callback
onRemoteOperationFinish() was ever called.

Secondly, the manual update of adapter and pager is only needed if user
is not present. When user is present, the initViewPager() takes care
of everything.

Signed-off-by: Philipp Hasper <[email protected]>
2025-10-27 08:30:21 +01:00
Andy Scherzinger 7a5f707e9a Merge pull request #15843 from nextcloud/renovate/mockkversion
fix(deps): update mockkversion to v1.14.6
2025-10-27 07:12:41 +01:00
Andy Scherzinger cbe4932b85 Merge pull request #15846 from nextcloud/renovate/androidcommonlibraryversion
fix(deps): update dependency com.github.nextcloud.android-common:ui to v0.29.0
2025-10-27 07:12:02 +01:00
renovate[bot] be2b8416da fix(deps): update dependency com.github.nextcloud.android-common:ui to v0.29.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 22:18:31 +00:00
renovate[bot] 57acd7d046 fix(deps): update mockkversion to v1.14.6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 22:12:18 +00:00
Andy Scherzinger 622e22f801 Merge pull request #15840 from nextcloud/renovate/fbcontribversion
fix(deps): update dependency com.mebigfatguy.fb-contrib:fb-contrib to v7.6.15
2025-10-26 22:39:35 +01:00
Andy Scherzinger 8bc660e9b0 Merge pull request #15845 from nextcloud/renovate/github-codeql-action-4.x
chore(deps): update github/codeql-action action to v4.31.0
2025-10-26 22:38:39 +01:00
renovate[bot] b431522ceb chore(deps): update github/codeql-action action to v4.31.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 21:38:00 +00:00
renovate[bot] aa5d00dc85 fix(deps): update dependency com.mebigfatguy.fb-contrib:fb-contrib to v7.6.15
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 22:35:47 +01:00
Andy Scherzinger 675017c0b7 Merge pull request #15848 from nextcloud/renovate/major-github-artifact-actions
chore(deps): update actions/upload-artifact action to v5
2025-10-26 22:33:06 +01:00
Andy Scherzinger 79f3938a10 Merge pull request #15698 from nextcloud/renovate/daggerversion
fix(deps): update daggerversion to v2.57.2
2025-10-26 22:11:38 +01:00
renovate[bot] 55ee6af50c chore(deps): update actions/upload-artifact action to v5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 19:02:04 +00:00
Andy Scherzinger 02684cb212 ci(test): Sort fav and forlder on top
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-26 19:15:21 +01:00
Andy Scherzinger 8169857a28 ci(chksm): Update meta data
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-26 19:15:21 +01:00
Andy Scherzinger 145b79633e ci(test): Fix test
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-26 19:15:20 +01:00
renovate[bot] eb6282f885 fix(deps): update daggerversion to v2.57.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 19:15:20 +01:00
Andy Scherzinger a66095eead Merge pull request #15841 from nextcloud/renovate/jacoco_version
fix(deps): update jacoco_version to v0.8.14
2025-10-26 19:14:49 +01:00
Andy Scherzinger 5cc8c43531 Merge pull request #15839 from nextcloud/renovate/spotbugsgradleplugin
fix(deps): update dependency com.github.spotbugs.snom:spotbugs-gradle-plugin to v6.4.4
2025-10-26 19:14:08 +01:00
Andy Scherzinger 1036b44975 Merge pull request #15851 from nextcloud/renovate/gradle-actions-5.x
chore(deps): update gradle/actions action to v5
2025-10-26 19:13:30 +01:00
renovate[bot] 8510970467 fix(deps): update jacoco_version to v0.8.14
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 18:09:33 +00:00
renovate[bot] 782adad8a5 fix(deps): update dependency com.github.spotbugs.snom:spotbugs-gradle-plugin to v6.4.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 18:05:40 +00:00
Andy Scherzinger f3df1dd4f5 Merge pull request #15850 from nextcloud/renovate/fsfe-reuse-action-6.x
chore(deps): update fsfe/reuse-action action to v6
2025-10-26 18:51:14 +01:00
renovate[bot] 94fed2aa62 chore(deps): update gradle/actions action to v5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 16:59:17 +00:00
renovate[bot] bca8dae206 chore(deps): update fsfe/reuse-action action to v6
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 16:59:12 +00:00
Andy Scherzinger a7f42e8caa Merge pull request #15686 from nextcloud/renovate/composebom
fix(deps): update dependency androidx.compose:compose-bom to v2025.09.01
2025-10-26 17:17:01 +01:00
Andy Scherzinger 8a315b9f9f ci(chksm): Add metadata
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-26 15:58:50 +01:00
tobiasKaminsky bcbc089094 new lib material-icons-core needed
Signed-off-by: tobiasKaminsky <[email protected]>
2025-10-26 14:24:05 +01:00
renovate[bot] 2fbf25e765 fix(deps): update dependency androidx.compose:compose-bom to v2025.09.01
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-26 14:24:05 +01:00
Andy Scherzinger 4e0c1083bb Merge pull request #15836 from nextcloud/update-library-2025-10-26
Update library to 2025-10-26
2025-10-26 14:23:37 +01:00
Andy Scherzinger 1ae05df898 ci(chksm): Update meta data
Signed-off-by: Andy Scherzinger <[email protected]>
2025-10-26 13:04:40 +01:00
Tobias Kaminsky 699cbc525b Update library to 2025-10-26
Signed-off-by: Tobias Kaminsky <[email protected]>
2025-10-26 12:49:47 +01:00
Nextcloud bot e1a80b64f4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-26 02:43:02 +00:00
Nextcloud bot 52bb721afc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-25 02:42:18 +00:00
Nextcloud bot bb1782e7cc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-24 02:42:38 +00:00
Alper Öztürk 004f14ea7f Merge pull request #15407 from nextcloud/sorting
folders/favorites first as option
2025-10-23 16:11:16 +02:00
alperozturk b1d842c6f6 fix: git conflict, kotlin spotless bugs, coda analytics
Signed-off-by: alperozturk <[email protected]>
2025-10-23 16:10:10 +02:00
alperozturk f5acb815b3 fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-10-23 16:00:34 +02:00
Alper Öztürk feed19eea4 Merge pull request #14299 from nextcloud/powerWarning
enable power warning for emulators
2025-10-23 15:58:42 +02:00
Alper Öztürk 7dbfa0d551 Merge pull request #14796 from nextcloud/breadcrumb
Fix breadcumb with details view
2025-10-23 15:55:05 +02:00
tobiasKaminsky a222d55b0c Fix breadcumb with details view
Signed-off-by: tobiasKaminsky <[email protected]>
2025-10-23 15:54:53 +02:00
tobiasKaminsky 16996c7601 enable power warning for emulators
Signed-off-by: tobiasKaminsky <[email protected]>
2025-10-22 15:28:56 +02:00
Alper Öztürk 3a3072612d Merge pull request #15595 from nextcloud/printAsyncDirectory
SpotBugs: Fix Method ignores exceptional return value - PrintAsyncTask
2025-10-22 09:13:28 +02:00
Tobias Kaminsky f7dee5449f Merge pull request #15644 from Saeedhany/master
Create Readme-AR.md
2025-10-22 07:58:01 +02:00
Nextcloud bot f1434d833d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-22 02:39:21 +00:00
Alex 195c398ca4 updated method
Signed-off-by: Alex <[email protected]>
2025-10-21 12:19:00 -04:00
Alex 5a86c0f00a fix make directories
Signed-off-by: Alex <[email protected]>
2025-10-21 12:19:00 -04:00
alperozturk a9a00f0619 fix: folder picker activity empty list state 2025-10-21 10:58:15 +02:00
Alper Öztürk db0d113b52 Merge pull request #15815 from nextcloud/fix/local-file-list-adapter-scroll-to-top
fix: local file list adapter scroll to top
2025-10-21 10:37:52 +02:00
Nextcloud bot 8fac856d87 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-21 02:39:43 +00:00
Andy Scherzinger 083c393c0b Merge pull request #15817 from nextcloud/renovate/ubuntu-noble
chore(deps): update ubuntu:noble docker digest to 66460d5
2025-10-20 18:29:55 +02:00
renovate[bot] 07e81c2c87 chore(deps): update ubuntu:noble docker digest to 66460d5
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-20 10:12:20 +00:00
alperozturk 5b9a7d291b fix: local file list |adapter scroll to top
Signed-off-by: alperozturk <[email protected]>
2025-10-20 10:14:02 +02:00
Alper Öztürk 3bb1c7f4d8 Merge pull request #15513 from nextcloud/createNewBackground
Create new dialog: non white background
2025-10-20 09:45:51 +02:00
Alper Öztürk 7e9c8ccbfc Merge pull request #15591 from nextcloud/renameFileDirectory
SpotBugs: Fix Method ignores exceptional return value - RenameFileOperation
2025-10-20 09:41:38 +02:00
tobiasKaminsky 3686edd55c Create new dialog: non white background
Signed-off-by: tobiasKaminsky <[email protected]>
2025-10-20 09:31:51 +02:00
Alex 62a51e4063 delete if exists
Signed-off-by: Alex <[email protected]>
2025-10-20 09:30:45 +02:00
Alex 5b11ed7b20 fix Exception
Signed-off-by: Alex <[email protected]>
2025-10-20 09:30:45 +02:00
Alex 4e9247a130 Handle exceptions
Signed-off-by: Alex <[email protected]>
2025-10-20 09:30:45 +02:00
Alex 81296dcf8b fix entire function to use newer API
Signed-off-by: Alex <[email protected]>
2025-10-20 09:30:45 +02:00
Alex Knop a704326574 use create file and different delete function
Signed-off-by: Alex Knop <[email protected]>
2025-10-20 09:30:45 +02:00
Alper Öztürk 3cab716a97 Merge pull request #15597 from nextcloud/fileStorageDelete
SpotBugs: Fix Method ignores exceptional return value - FileStorageUtils
2025-10-20 08:57:05 +02:00
Andy Scherzinger 596264d5cd Merge pull request #15807 from nextcloud/fix/npe-left-fragment-adapter
fix: npe left fragment adapter
2025-10-20 08:12:50 +02:00
Andy Scherzinger 50d4b8d187 Merge pull request #15795 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2025-10-20 07:26:01 +02:00
Nextcloud bot cf5cbb1635 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-20 02:38:17 +00:00
nextcloud-android-bot a71c7fd1d9 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2025-10-20 02:34:54 +00:00
Nextcloud bot ea3d6407c5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-19 02:38:09 +00:00
Nextcloud bot b4bba97efc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-18 02:38:49 +00:00
Alex 84be18b5fb delete if exists
Signed-off-by: Alex <[email protected]>
2025-10-17 13:07:23 -04:00
Alex 2a64e26c10 fix Exception
Signed-off-by: Alex <[email protected]>
2025-10-17 13:07:23 -04:00
Alex 67a638ad4e add exception
Signed-off-by: Alex <[email protected]>
2025-10-17 13:07:23 -04:00
Alex 8f4096e6dc using modern Files delete method
Signed-off-by: Alex <[email protected]>
2025-10-17 13:07:23 -04:00
alperozturk a26beacc40 fix: npe left fragment adapter
Signed-off-by: alperozturk <[email protected]>
2025-10-17 15:53:48 +02:00
Alper Öztürk 1a40920dd7 Merge pull request #15759 from nextcloud/fix/auto-upload-state
fix: auto upload db state
2025-10-17 15:21:49 +02:00
alperozturk 6de9b48fd3 fix: git conflicts
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 1000c82d5e fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk f03f517593 revert changes due to split prs
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 3155c65a74 fix: upload list state
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 7e1880c3de fix: cant get file from URI
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 794d48e665 fix: pagination
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 5d033e7986 fix: pagination
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 279b5fa209 fix: CursorIndexOutOfBoundsException
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/client/database/dao/SyncedFolderDao.kt
2025-10-17 11:14:41 +02:00
alperozturk d562e5feb3 add: comments
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 18481f45d7 fix: id incrementation
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
alperozturk 683ed9b0b8 fix: git conflicts
Signed-off-by: alperozturk <[email protected]>
2025-10-17 11:14:41 +02:00
Alper Öztürk d4e131e81f Merge pull request #15799 from nextcloud/fix/bidi-control-character-incomplete-trailing-escape
fix: incomplete trailing space during decoding filename
2025-10-17 09:10:32 +02:00
Alper Öztürk 484fe04245 Merge pull request #15800 from nextcloud/fix/file-upload-limit-message-visibility
fix: file upload limit message visibility
2025-10-17 09:08:07 +02:00
Nextcloud bot b0f429b477 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-17 02:39:10 +00:00
alperozturk 13f40c4026 fix: file upload limit message visibility
Signed-off-by: alperozturk <[email protected]>
2025-10-16 12:06:34 +02:00
alperozturk 2ea35f2f0b fix: incomplete trailing space during decoding filename
Signed-off-by: alperozturk <[email protected]>
2025-10-16 11:24:20 +02:00
Alper Öztürk 9e4197e4b9 Merge pull request #15712 from nextcloud/fix/cancel-upload
fix: upload cancel
2025-10-16 09:29:00 +02:00
Alper Öztürk 7a021f4be9 Merge pull request #15797 from nextcloud/fix/handle-not-modified-and-no-content-response
fix: handle not modified response in input stream binder implementation
2025-10-16 08:58:41 +02:00
Nextcloud bot 03c22ee4a0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-16 02:38:05 +00:00
alperozturk 4fbaaa307d chore: update lib
Signed-off-by: alperozturk <[email protected]>
2025-10-15 17:41:57 +02:00
alperozturk 7275d8b14e fix: handle not modified
Signed-off-by: alperozturk <[email protected]>
2025-10-15 16:52:05 +02:00
alperozturk 199e754e9b fix: handle not modified and no content response
Signed-off-by: alperozturk <[email protected]>
2025-10-15 16:50:46 +02:00
alperozturk db028503d9 fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:15:36 +02:00
alperozturk 8a028567d1 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:10:04 +02:00
alperozturk 7a97e558c3 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>

# Conflicts:
#	build.gradle
2025-10-15 14:10:02 +02:00
alperozturk b83ac7d6a4 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:10:00 +02:00
alperozturk 6bdbbcb0d7 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:10:00 +02:00
alperozturk 45a5e6bd26 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:09:59 +02:00
alperozturk 8d2182a29e fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:09:57 +02:00
alperozturk 5479c135eb fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:09:57 +02:00
alperozturk 3c5aaad6d6 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:09:57 +02:00
alperozturk eb13420f35 fix: upload cancel
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:09:55 +02:00
alperozturk 26158aba2c fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-10-15 14:09:52 +02:00
Alper Öztürk c89832b1ff Merge pull request #15796 from nextcloud/fix/save-file-download-in-folder-download
fix: saving file for folder download
2025-10-15 14:07:54 +02:00
Alper Öztürk 6e3f63d4d4 Merge pull request #15791 from nextcloud/fix/make-file-upload-worker-long-running-job
fix: make file upload worker long running task
2025-10-15 14:07:23 +02:00
alperozturk eedd3473f5 fix: save file for folder download
Signed-off-by: alperozturk <[email protected]>
2025-10-15 13:53:28 +02:00
alperozturk 5ebb4cfad2 fix: save file for folder download
Signed-off-by: alperozturk <[email protected]>
2025-10-15 13:00:45 +02:00
Alper Öztürk 8baa0a6988 Merge pull request #15743 from nextcloud/build/upgrade-android-sdk-16
upgrade android sdk 36
2025-10-15 10:47:59 +02:00
alperozturk 1f900b7a55 fix: back press of fda
Signed-off-by: alperozturk <[email protected]>
2025-10-15 10:47:47 +02:00
alperozturk c18278b973 fix: back press of fda
Signed-off-by: alperozturk <[email protected]>
2025-10-15 10:14:22 +02:00
alperozturk 7fe00834ed add: Unsupported platform APIs and unable to migrate due to outdated PreferenceActivity for SettingsActivity
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
alperozturk 83d3cfba1d fix: code analytics
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
alperozturk 30e67b530f fix: code analytics
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
alperozturk a4eb0c9275 fix: custom back press navigation
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
alperozturk 39a7aff33c fix: custom back press navigation
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
alperozturk 07e7484c5a refactor: update back press gesture
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
alperozturk a1ce48da06 chore: upgrade android sdk 36
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:05:42 +02:00
Alper Öztürk 8dd522d600 Merge pull request #14166 from nextcloud/feature/sync-worker
Add Sync Worker
2025-10-15 09:05:07 +02:00
alperozturk b489ddae99 rename to folder download worker
Signed-off-by: alperozturk <[email protected]>
2025-10-15 09:04:35 +02:00
Nextcloud bot 80552ca895 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-15 02:38:07 +00:00
alperozturk e6aa4471b8 rename to folder download worker
Signed-off-by: alperozturk <[email protected]>
2025-10-14 17:06:35 +02:00
Alper Öztürk 79d2ed8889 Merge pull request #15792 from nextcloud/fix/local-file-list-adapter-duplicate-item
fix: local file list duplicate item and load
2025-10-14 17:05:17 +02:00
alperozturk 2a6ba436aa fix: folder download 2025-10-14 16:53:49 +02:00
alperozturk 4e9f63873c fix: local file list duplicate item
Signed-off-by: alperozturk <[email protected]>
2025-10-14 15:44:06 +02:00
alperozturk 895fd68e84 fix: make file upload worker long running task
Signed-off-by: alperozturk <[email protected]>
2025-10-14 11:49:14 +02:00
Alper Öztürk 614bacc074 Merge pull request #15731 from nextcloud/fix/local-file-list-adapter-file-listing
paginate: local file list adapter
2025-10-14 09:26:11 +02:00
Alper Öztürk e7d0c1d0ec Merge pull request #15785 from nextcloud/fix/file-sort-order-by-size
fix: file sort order by size
2025-10-14 08:46:32 +02:00
Alper Öztürk fc927e7bac Merge pull request #15784 from nextcloud/fix/sync-folder-layout-shimmer-order
fix: sync folder layout shimmer order
2025-10-14 08:46:23 +02:00
Nextcloud bot d52dbb705c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-14 02:53:19 +00:00
Alper Öztürk ea07d3c5ee Merge pull request #15786 from nextcloud/fix/background-job-factory-test
fix: BackgroundJobFactoryTest
2025-10-13 14:46:08 +02:00
Alper Öztürk 50fc0d3d7f Merge pull request #15764 from nextcloud/fix/auto-upload-collect-change-files-file-from-uri
fix: auto upload collect changed files
2025-10-13 14:45:47 +02:00
alperozturk 1587631797 fix: BackgroundJobFactoryTest.kt
Signed-off-by: alperozturk <[email protected]>
2025-10-13 14:10:51 +02:00
alperozturk 3f9ed092df fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-10-13 13:41:21 +02:00
alperozturk 63f6edc1d4 fix: git conflict
Signed-off-by: alperozturk <[email protected]>
2025-10-13 13:40:04 +02:00
Alper Öztürk 0f237fc3dc Merge pull request #15767 from nextcloud/fix/content-observer-work
fix: content observer work
2025-10-13 13:20:20 +02:00
alperozturk 0776265f6d fix: file sort order by size
Signed-off-by: alperozturk <[email protected]>
2025-10-13 12:12:17 +02:00
alperozturk 312be7b171 fix: sync folder layout shimmer order
Signed-off-by: alperozturk <[email protected]>
2025-10-13 10:19:43 +02:00
Nextcloud bot 3b26d54de5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-13 07:38:59 +00:00
Nextcloud bot 1ba667e925 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-12 03:00:16 +00:00
Andy Scherzinger 1bc0e70453 Merge pull request #15777 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2025-10-11 07:47:23 +02:00
nextcloud-android-bot 1be313a21c 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2025-10-11 05:46:13 +00:00
Nextcloud bot 37e936b19a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-11 02:44:43 +00:00
Alper Öztürk 3aaf7603f9 Merge pull request #15744 from nextcloud/fix/unified-search-filter
fix: unified search filter
2025-10-10 13:40:10 +02:00
Alper Öztürk f6c790f13c Merge pull request #15729 from nextcloud/fix/sync-icon-logic-during-folder-item-download
fix: sync icon logic for folder item download
2025-10-10 13:39:56 +02:00
alperozturk f0ebd7d2c7 fix: content observer work
Signed-off-by: alperozturk <[email protected]>
2025-10-10 12:56:58 +02:00
alperozturk e307143074 fix: content observer work
Signed-off-by: alperozturk <[email protected]>
2025-10-10 12:41:48 +02:00
alperozturk f5b288b59f fix: content observer work
Signed-off-by: alperozturk <[email protected]>
2025-10-10 12:41:48 +02:00
Alper Öztürk bef0cfa885 Merge pull request #15766 from nextcloud/fix/media-folder-detection-worker
fix: media folder detection worker
2025-10-10 12:38:23 +02:00
Alper Öztürk 5e895ec306 Merge pull request #15765 from nextcloud/fix/background-job-factory-tests
fix: background job factory test
2025-10-10 12:31:37 +02:00
alperozturk 9122d0a261 fix: media folder detection worker
Signed-off-by: alperozturk <[email protected]>
2025-10-10 11:54:07 +02:00
alperozturk 98c4ea9c77 fix: background job factory test
Signed-off-by: alperozturk <[email protected]>
2025-10-10 11:46:05 +02:00
Alper Öztürk a1aa3a5455 Merge pull request #15749 from nextcloud/feat/indicate-auto-upload-scan-interval
feat: indicate auto upload scan interval
2025-10-10 08:51:17 +02:00
Nextcloud bot 20ea984885 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-10 05:05:22 +00:00
alperozturk 5dbe8d5eab make scan indicator text style normal
Signed-off-by: alperozturk <[email protected]>
2025-10-09 16:36:22 +02:00
alperozturk d267d4cb2c fix: lint
Signed-off-by: alperozturk <[email protected]>
2025-10-09 16:34:11 +02:00
alperozturk 24a11c5e5e add subtitle
Signed-off-by: alperozturk <[email protected]>
2025-10-09 16:34:11 +02:00
alperozturk f639788ebc fix: lint
Signed-off-by: alperozturk <[email protected]>
2025-10-09 16:34:11 +02:00
alperozturk b622174c95 feat: indicate auto upload scan interval
Signed-off-by: alperozturk <[email protected]>
2025-10-09 16:34:11 +02:00
alperozturk 31fa1c4413 feat: indicate auto upload scan interval
Signed-off-by: alperozturk <[email protected]>
2025-10-09 16:34:11 +02:00
Tobias Kaminsky 2f6b724540 Merge pull request #15761 from nextcloud/unused
remove synced_folder_padding_end
2025-10-09 14:57:17 +02:00
tobiasKaminsky 0814e10937 remove synced_folder_padding_end
Signed-off-by: tobiasKaminsky <[email protected]>
2025-10-09 14:53:20 +02:00
alperozturk 18e9019a14 fix: code analytics
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk 86e35bc871 add: file helper tests
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk a85379bafb fix: sorting order
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk d1d06c144f refactor: pagination
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk 7352fa05e4 refactor: pagination
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk fad3ed061f paginate: local file list adapter
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk b90110b605 paginate: local file list adapter
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
alperozturk 5d5e5106d1 paginate: local file list adapter
Signed-off-by: alperozturk <[email protected]>
2025-10-08 17:01:39 +02:00
Alper Öztürk 032e906778 Merge pull request #15694 from nextcloud/fix/auto-upload-worker
fix: auto upload worker
2025-10-08 08:57:39 +02:00
Alper Öztürk 84de8e64c4 Merge pull request #15745 from nextcloud/fix/rotate-bitmap-according-to-the-exif
fix: rotate bitmap according to the exif
2025-10-08 08:56:39 +02:00
Andy Scherzinger 4f873754f8 Merge pull request #15751 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2025-10-07 23:26:53 +02:00
nextcloud-android-bot 7531426c0b 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2025-10-07 22:58:06 +02:00
Andy Scherzinger 65e93d8500 Merge pull request #15747 from nextcloud/renovate/gradle-actions-4.x
chore(deps): update gradle/actions action to v4.4.4
2025-10-07 22:51:36 +02:00
renovate[bot] f065874a96 chore(deps): update gradle/actions action to v4.4.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 20:04:42 +00:00
Andy Scherzinger 1956e0e582 Merge pull request #15746 from nextcloud/renovate/ubuntu-noble
chore(deps): update ubuntu:noble docker digest to 728785b
2025-10-07 22:02:52 +02:00
renovate[bot] e1877d0cb4 chore(deps): update ubuntu:noble docker digest to 728785b
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-07 17:21:45 +00:00
Alper Öztürk 505d6b72ac Merge pull request #15750 from nextcloud/make-placeholders-non-translatable
make placeholders non translatable
2025-10-07 19:19:47 +02:00
alperozturk 74a5282dbb remove translations for placeholders
Signed-off-by: alperozturk <[email protected]>
2025-10-07 16:47:45 +02:00
alperozturk 94a1a7e34d add missing non translatable placeholders
Signed-off-by: alperozturk <[email protected]>
2025-10-07 16:41:47 +02:00
alperozturk 2cbda4ed42 make placeholders non translatable
Signed-off-by: alperozturk <[email protected]>
2025-10-07 16:05:02 +02:00
alperozturk 9c80a480f4 fix: kt spotless check
Signed-off-by: alperozturk <[email protected]>
2025-10-07 11:47:25 +02:00
alperozturk af76c5c9b6 fix: auto upload worker
Signed-off-by: alperozturk <[email protected]>
2025-10-07 11:16:57 +02:00
alperozturk 4503d4431e fix: code analytics GetExifOrientationTests
Signed-off-by: alperozturk <[email protected]>
2025-10-07 10:38:57 +02:00
alperozturk 29a0956614 fix: rotate bitmap according to the exif
Signed-off-by: alperozturk <[email protected]>
2025-10-07 10:38:57 +02:00
alperozturk 1c7749bcb4 fix: unified search filter
Signed-off-by: alperozturk <[email protected]>
2025-10-06 16:51:32 +02:00
alperozturk ff1196e19b fix: any cert verification success verify signed message
Signed-off-by: alperozturk <[email protected]>
2025-10-06 13:43:30 +02:00
alperozturk db1d454e9f revert: folder emptiness check for verify metadata
Signed-off-by: alperozturk <[email protected]>
2025-10-06 13:43:30 +02:00
alperozturk e537ce27af add: folder emptiness check for verifying cms signed data
Signed-off-by: alperozturk <[email protected]>
2025-10-06 13:43:30 +02:00
alperozturk 5d0417cc82 refactor
Signed-off-by: alperozturk <[email protected]>
2025-10-06 13:43:30 +02:00
alperozturk 9c3c15d5a8 refactor
Signed-off-by: alperozturk <[email protected]>
2025-10-06 13:43:30 +02:00
Saeedhany 93d4244859 Merge branch 'master' into master 2025-10-02 15:53:09 +03:00
Saeedhany 726fcbc8e4 Update Readme-AR.md
Signed-off-by: Saeedhany <[email protected]>
2025-10-01 15:15:07 +03:00
Saeedhany aab2051f5f Update Readme-AR.md
Signed-off-by: Saeedhany <[email protected]>
2025-10-01 15:10:29 +03:00
alperozturk 7a80da65cb fix: sync icon logic for folder item download
Signed-off-by: alperozturk <[email protected]>
2025-10-01 10:36:21 +02:00
Philipp Niedermayer 96ad1c96f1 Make dense layout the default
Signed-off-by: Philipp Niedermayer <[email protected]>
2025-09-29 19:47:11 +02:00
Thore Goebel fe670b7baa Opt-in to Arm MTE
Signed-off-by: Thore Goebel <[email protected]>
2025-09-19 11:17:54 +02:00
Saeedhany b7b250bb2f Create Readme-AR.md
Signed-off-by: Saeedhany <[email protected]>
2025-09-15 17:29:29 +03:00
Philipp Niedermayer 04216c251e Fix format
Signed-off-by: Philipp Niedermayer <[email protected]>
2025-09-12 20:13:15 +02:00
Philipp Niedermayer 561d9862da Implement dense layout option
Closes https://github.com/nextcloud/android/issues/15376

Signed-off-by: Philipp Niedermayer <[email protected]>
2025-09-12 19:49:49 +02:00
alperozturk 288e961caf fix: stop uploads if quota exceeded
Signed-off-by: alperozturk <[email protected]>
2025-08-27 09:15:09 +02:00
alperozturk cbda93ee49 add: quota exceed notification
Signed-off-by: alperozturk <[email protected]>
2025-08-27 09:10:38 +02:00
tobiasKaminsky 460320c201 If quota is exceeded show notification, stop afterwards
Signed-off-by: tobiasKaminsky <[email protected]>
2025-08-27 09:01:01 +02:00
816 changed files with 27665 additions and 13321 deletions

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
FROM ubuntu:noble@sha256:353675e2a41babd526e2b837d7ec780c2a05bca0164f7ea5dbbd433d21d166fc
FROM ubuntu:noble@sha256:c35e29c9450151419d9448b0fd75374fec4fff364a27f176fb458d472dfc9e54
ARG DEBIAN_FRONTEND=noninteractive
ENV ANDROID_HOME=/usr/lib/android-sdk
+5 -5
View File
@@ -9,7 +9,7 @@ name: tests-stable
steps:
- name: gplay
image: ghcr.io/nextcloud/continuous-integration-android8:4
image: ghcr.io/nextcloud/continuous-integration-android16:latest
privileged: true
environment:
LOG_USERNAME:
@@ -74,7 +74,7 @@ name: tests-master
steps:
- name: gplay
image: ghcr.io/nextcloud/continuous-integration-android8:4
image: ghcr.io/nextcloud/continuous-integration-android16:latest
privileged: true
environment:
LOG_USERNAME:
@@ -134,7 +134,7 @@ name: allScreenshots
steps:
- name: runAllScreenshots
image: ghcr.io/nextcloud/continuous-integration-android8:4
image: ghcr.io/nextcloud/continuous-integration-android16:latest
privileged: true
environment:
GIT_USERNAME:
@@ -148,7 +148,7 @@ steps:
commands:
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
- sed -i s'#showOnlyFailingTestsInReports = ciBuild#showOnlyFailingTestsInReports = false#' build.gradle
- sed -i s'#showOnlyFailingTestsInReports = ciBuild#showOnlyFailingTestsInReports = false#' build.gradle.kts
- scripts/wait_for_emulator.sh
- scripts/runAllScreenshotCombinations noCI false
- scripts/screenshotSummary.sh
@@ -185,6 +185,6 @@ name: GIT_TOKEN
data: XIoa9IYq+xQ+N5iln8dlpWv0jV6ROr7HuE24ioUr4uQ8m8SjyH0yognWYLYLqnbTKrFWlFZiEMQTH/sZiWjRFvV1iL0=
---
kind: signature
hmac: ea9432c9317fa6ca12a282bb117c9f3268ddb29b208dbd772795ba19cf395082
hmac: d52e0df1af49c1b30e42a877655c6699914130adf3a3b881db46a70b90356c3a
...
+4 -2
View File
@@ -27,6 +27,7 @@ concurrency:
jobs:
analysis:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Disabled on forks
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
@@ -51,13 +52,13 @@ jobs:
echo "repo=${{ github.event.pull_request.head.repo.full_name }}"
} >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
repository: ${{ steps.get-vars.outputs.repo }}
ref: ${{ steps.get-vars.outputs.branch }}
- name: Set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
@@ -72,6 +73,7 @@ jobs:
{
echo "org.gradle.jvmargs=-Xmx5g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g"
echo "org.gradle.configureondemand=true"
echo "org.gradle.configuration-cache=false"
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 }}"
+3 -3
View File
@@ -22,13 +22,13 @@ jobs:
matrix:
flavor: [ Generic, Gplay, Huawei ]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
- uses: gradle/actions/wrapper-validation@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
- uses: gradle/actions/wrapper-validation@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
- name: Build ${{ matrix.flavor }}
run: |
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" >> gradle.properties
+3 -3
View File
@@ -20,11 +20,11 @@ jobs:
strategy:
fail-fast: false
matrix:
task: [ detekt, spotlessKotlinCheck ]
task: [ detekt, spotlessKotlinCheck, lint ]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
+4 -4
View File
@@ -34,7 +34,7 @@ jobs:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Set Swap Space
@@ -43,11 +43,11 @@ jobs:
with:
swap-size-gb: 10
- name: Initialize CodeQL
uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
languages: ${{ matrix.language }}
- name: Set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
@@ -57,4 +57,4 @@ jobs:
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
./gradlew assembleDebug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
+2 -2
View File
@@ -20,9 +20,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
+1 -1
View File
@@ -36,7 +36,7 @@ jobs:
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
- uses: nextcloud/pr-feedback-action@e397f3c7e655092b746e3610d121545530c6a90e # main
- uses: nextcloud/pr-feedback-action@5227c55be184087d0aef6338bee210d8620b6297 # main
with:
feedback-message: |
Hello there,
+4 -4
View File
@@ -24,13 +24,13 @@ jobs:
id: check-secrets
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
with:
persist-credentials: false
- name: set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
with:
distribution: "temurin"
@@ -48,8 +48,8 @@ jobs:
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; org.gradle.parallel=true; org.gradle.configureondemand=true; kapt.incremental.apt=true" >> "$HOME/.gradle/gradle.properties"
sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" "app/build.gradle"
sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" "app/build.gradle"
sed -i "/qa/,/\}/ s/versionCode.*/versionCode = ${{ github.event.number }}/" app/build.gradle.kts
sed -i "/qa/,/\}/ s/versionName.*/versionName = \"${{ github.event.number }}\"/" app/build.gradle.kts
./gradlew assembleQaDebug
$(find /usr/local/lib/android/sdk/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:"$KS_PASS" --key-pass pass:"$KEY_PASS" --ks-key-alias key0 --ks ".github/workflows/QA_keystore.jks" app/build/outputs/apk/qa/debug/*qa-debug*.apk
.github/workflows/uploadArtifact.sh "$LOG_USERNAME" "$LOG_PASSWORD" "${{github.event.number}}" "${{github.event.number}}" "$GITHUB_TOKEN"
+1 -1
View File
@@ -48,7 +48,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ github.head_ref }}
+2 -2
View File
@@ -19,9 +19,9 @@ jobs:
runs-on: ubuntu-latest-low
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: REUSE Compliance Check
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
+2 -2
View File
@@ -29,7 +29,7 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
@@ -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@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
sarif_file: results.sarif
+8 -8
View File
@@ -23,19 +23,19 @@ jobs:
matrix:
scheme: [ Light ]
color: [ blue ]
api-level: [ 27 ]
api-level: [ 28 ]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Gradle cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: AVD cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
id: avd-cache
with:
path: |
@@ -43,7 +43,7 @@ jobs:
~/.android/adb*
key: avd-${{ matrix.api-level }}
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
- uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
@@ -56,7 +56,7 @@ jobs:
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
@@ -87,7 +87,7 @@ jobs:
- name: Run screenshot tests
env:
SHOT_TEST: "true"
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
@@ -102,7 +102,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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ always() }}
with:
name: Report-${{ matrix.color }}-${{ matrix.scheme }}
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
days-before-stale: 28
days-before-close: 14
+42 -33
View File
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2022-2025 Nextcloud GmbH and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: Unit tests
@@ -20,36 +20,45 @@ concurrency:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Set up JDK 17
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
distribution: "temurin"
java-version: 17
- name: Delete old comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ always() }}
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
- name: Run unit tests with coverage
run: ./gradlew jacocoTestGplayDebugUnitTest
- name: Upload failing results
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}}
- name: Upload coverage to codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
fail_ci_if_error: true
- name: Upload jacoco artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results
path: app/build/reports/tests/testGplayDebugUnitTest/
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up JDK 17
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
with:
distribution: "temurin"
java-version: 17
- name: Delete old comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ always() }}
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
- name: Run unit tests with coverage
run: ./gradlew jacocoTestGplayDebugUnitTest
- name: Upload failing results
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}}
- name: Upload coverage to codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
fail_ci_if_error: true
files: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/jacoco.xml
- name: Upload jacoco artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: test-results
path: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/html/
+6
View File
@@ -6,15 +6,19 @@
</inspection_tool>
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
@@ -39,6 +43,7 @@
</inspection_tool>
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
@@ -66,6 +71,7 @@
</inspection_tool>
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
+31 -32
View File
@@ -1,40 +1,41 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
CFPropertyList (3.0.8)
abbrev (0.1.2)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1121.0)
aws-sdk-core (3.226.1)
aws-partitions (1.1201.0)
aws-sdk-core (3.241.2)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.106.0)
aws-sdk-core (~> 3, >= 3.225.0)
aws-sdk-kms (1.119.0)
aws-sdk-core (~> 3, >= 3.241.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.191.0)
aws-sdk-core (~> 3, >= 3.225.0)
aws-sdk-s3 (1.210.1)
aws-sdk-core (~> 3, >= 3.241.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.3.0)
bigdecimal (3.3.1)
cgi (0.4.2)
claide (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
csv (3.3.5)
declarative (0.0.20)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)
@@ -42,37 +43,34 @@ GEM
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.112.0)
faraday (1.10.4)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday-cookie_jar (0.0.8)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
http-cookie (>= 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.1)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.1.1)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.4.0)
fastlane (2.228.0)
fastlane (2.229.0)
CFPropertyList (>= 2.3, < 4.0.0)
abbrev (~> 0.1.2)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
@@ -80,6 +78,7 @@ GEM
bundler (>= 1.12.0, < 3.0.0)
colored (~> 1.2)
commander (~> 4.6)
csv (~> 3.3)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
@@ -99,6 +98,7 @@ GEM
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
mutex_m (~> 0.3.0)
naturally (~> 2.2)
optparse (>= 0.1.1, < 1.0.0)
plist (>= 3.1.0, < 4.0.0)
@@ -160,37 +160,36 @@ GEM
httpclient (2.9.0)
mutex_m
jmespath (1.6.2)
json (2.12.2)
jwt (2.10.1)
json (2.18.0)
jwt (2.10.2)
base64
logger (1.7.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.15.0)
multi_json (1.19.1)
multipart-post (2.4.1)
mutex_m (0.3.0)
nanaimo (0.4.0)
naturally (2.3.0)
nkf (0.2.0)
optparse (0.6.0)
optparse (0.8.1)
os (1.1.4)
plist (3.7.2)
public_suffix (6.0.2)
rake (13.3.0)
rake (13.3.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.4.1)
rexml (3.4.4)
rouge (3.28.0)
ruby2_keywords (0.0.5)
rubyzip (2.4.1)
security (0.1.5)
signet (0.20.0)
signet (0.21.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
jwt (>= 1.5, < 4.0)
multi_json (~> 1.10)
simctl (1.6.10)
CFPropertyList
+1 -1
View File
@@ -16,7 +16,7 @@ height="80">](https://f-droid.org/packages/com.nextcloud.client/)
alt="Get it with Obtainium"
height="80">](https://apps.obtainium.imranr.dev/redirect?r=obtainium://app/%7B%22id%22%3A%22com.nextcloud.client%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2Fnextcloud%2Fandroid%22%2C%22author%22%3A%22nextcloud%22%2C%22name%22%3A%22Nextcloud%22%2C%22preferredApkIndex%22%3A0%2C%22additionalSettings%22%3A%22%7B%5C%22includePrereleases%5C%22%3Afalse%2C%5C%22fallbackToOlderReleases%5C%22%3Atrue%2C%5C%22filterReleaseTitlesByRegEx%5C%22%3A%5C%22%5C%22%2C%5C%22filterReleaseNotesByRegEx%5C%22%3A%5C%22%5C%22%2C%5C%22verifyLatestTag%5C%22%3Afalse%2C%5C%22sortMethodChoice%5C%22%3A%5C%22date%5C%22%2C%5C%22useLatestAssetDateAsReleaseDate%5C%22%3Afalse%2C%5C%22releaseTitleAsVersion%5C%22%3Afalse%2C%5C%22trackOnly%5C%22%3Afalse%2C%5C%22versionExtractionRegEx%5C%22%3A%5C%22%5C%22%2C%5C%22matchGroupToUse%5C%22%3A%5C%22%5C%22%2C%5C%22versionDetection%5C%22%3Atrue%2C%5C%22releaseDateAsVersion%5C%22%3Afalse%2C%5C%22useVersionCodeAsOSVersion%5C%22%3Afalse%2C%5C%22apkFilterRegEx%5C%22%3A%5C%22%5Enextcloud.*%5C%22%2C%5C%22invertAPKFilter%5C%22%3Afalse%2C%5C%22autoApkFilterByArch%5C%22%3Atrue%2C%5C%22appName%5C%22%3A%5C%22%5C%22%2C%5C%22appAuthor%5C%22%3A%5C%22%5C%22%2C%5C%22shizukuPretendToBeGooglePlay%5C%22%3Afalse%2C%5C%22allowInsecure%5C%22%3Afalse%2C%5C%22exemptFromBackgroundUpdates%5C%22%3Afalse%2C%5C%22skipUpdateNotifications%5C%22%3Afalse%2C%5C%22about%5C%22%3A%5C%22Nextcloud%20ist%20eine%20Cloudanwendung%2C%20die%20selbst%20gehostet%20werden%20kann.%5C%22%2C%5C%22refreshBeforeDownload%5C%22%3Atrue%7D%22%2C%22overrideSource%22%3Anull%7D)
Signing certificate fingerprint to [verify](https://developer.android.com/studio/command-line/apksigner#usage-verify) the APK:
Signing certificate fingerprint to [verify](https://developer.android.com/studio/command-line/apksigner#usage-verify) the APK using the official Android documentation.
- APK with "gplay" name, found [here](https://github.com/nextcloud/android/releases) or distributed via Google Play Store
- APK with "nextcloud", found [here](https://github.com/nextcloud/android/releases)
- not suitable for Fdroid downloads, as Fdroid is signing it on their own
+4 -4
View File
@@ -30,13 +30,13 @@ SPDX-FileCopyrightText = "2015-2016 ownCloud Inc."
SPDX-License-Identifier = "GPL-2.0-only"
[[annotations]]
path = ["app/src/**/res/mipmap-**dpi/ic_launcher.png", "app/src/**/ic_launcher-web.png", "src/generic/fastlane/metadata/android/en-US/images/icon.png", "src/versionDev/fastlane/metadata/android/en-US/images/icon.png", "app/src/main/ic_launcher-web-round.png"]
path = ["app/src/**/res/mipmap-**dpi/ic_launcher.png", "app/src/**/ic_launcher-web.png", "src/**/fastlane/metadata/en-US/images/*.png", "src/generic/fastlane/metadata/android/en-US/images/icon.png", "src/versionDev/fastlane/metadata/android/en-US/images/icon.png", "app/src/main/ic_launcher-web-round.png"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2017-2024 Nextcloud GmbH <https://nextcloud.com/trademarks/>"
SPDX-FileCopyrightText = "2017-2025 Nextcloud GmbH <https://nextcloud.com/trademarks/>"
SPDX-License-Identifier = "LicenseRef-NextcloudTrademarks"
[[annotations]]
path = [".idea/**", "app/schemas/com.nextcloud.client.database.NextcloudDatabase/**.json", "app/screenshots/generic/debug/**.png", "app/src/main/res/values-**/strings.xml", "src/**/fastlane/metadata/android/**/**.txt", "src/versionDev/fastlane/metadata/android/**/changelogs/**.txt", "app/src/androidTest/assets/**", "app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker", "app/src/**/google-services.json", "app/src/main/res/drawable-**dpi/checker_16_16.png", "app/src/main/res/raw/encryption_key_words.txt", "app/src/main/resources/ical4j.properties", "app/src/main/res/drawable-**dpi/apk.png", "app/src/main/res/drawable-**dpi/fdroid.png", "app/src/main/res/drawable-**dpi/playstore.png", "app/src/main/res/drawable-**dpi/background.png", "app/src/main/res/drawable-**dpi/background_nc18.png"]
path = [".idea/**", "app/schemas/com.nextcloud.client.database.NextcloudDatabase/**.json", "app/screenshots/generic/debug/**.png", "app/src/main/res/values-**/strings.xml", "src/**/fastlane/metadata/**/*.txt", "src/versionDev/fastlane/metadata/android/**/changelogs/**.txt", "app/src/androidTest/assets/**", "app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker", "app/src/**/google-services.json", "app/src/main/res/drawable-**dpi/checker_16_16.png", "app/src/main/res/raw/encryption_key_words.txt", "app/src/main/resources/ical4j.properties", "app/src/main/res/drawable-**dpi/apk.png", "app/src/main/res/drawable-**dpi/fdroid.png", "app/src/main/res/drawable-**dpi/playstore.png", "app/src/main/res/drawable-**dpi/background.png", "app/src/main/res/drawable-**dpi/background_nc18.png"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2016-2024 Nextcloud GmbH and Nextcloud contributors"
SPDX-FileCopyrightText = "2016-2025 Nextcloud GmbH and Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"
+120
View File
@@ -0,0 +1,120 @@
<!--
~ SPDX-FileCopyrightText: 2025 Saeed <[email protected]>
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
# تطبيق [Nextcloud](https://nextcloud.com)لأجهزة أندرويد 📱
[![حالة REUSE](https://api.reuse.software/badge/github.com/nextcloud/android)](https://api.reuse.software/info/github.com/nextcloud/android)
[![حالة البناء](https://drone.nextcloud.com/api/badges/nextcloud/android/status.svg)](https://drone.nextcloud.com/nextcloud/android)
[![تقييم Codacy](https://app.codacy.com/project/badge/Grade/fb4cf26336774ee3a5c9adfe829c41aa)](https://app.codacy.com/gh/nextcloud/android/dashboard)
[![الإصدارات](https://img.shields.io/github/release/nextcloud/android.svg)](https://github.com/nextcloud/android/releases/latest)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="تحميل من Google Play" height="80">](https://play.google.com/store/apps/details?id=com.nextcloud.client)
[<img src="https://f-droid.org/badge/get-it-on.png" alt="احصل عليه من F-Droid" height="80">](https://f-droid.org/packages/com.nextcloud.client/)
## التحقق من توقيع التطبيق 🔐
للتأكد من صحة ملف APK:
- ملف APK باسم "gplay" متوفر [هنا](https://github.com/nextcloud/android/releases) أو عبر متجر Google Play
- ملف APK باسم "nextcloud" متوفر [هنا](https://github.com/nextcloud/android/releases)
- غير مناسب لتحميلات F-Droid، لأن F-Droid يقوم بتوقيعه بنفسه
```plaintext
SHA-256: fb009522f65e25802261b67b10a45fd70e610031976f40b28a649e152ded0373
SHA-1: 74aa1702e714941be481e1f7ce4a8f779c19dcea
```
**تطبيق Nextcloud لأندرويد يتيح لك إدارة بياناتك بسهولة على خادم Nextcloud الخاص بك.**
## الحصول على الدعم 🆘
إذا واجهت مشكلة أو لديك سؤال، يمكنك زيارة [منتدى الدعم](https://help.nextcloud.com/c/clients/android).
إذا اكتشفت خطأ أو لديك اقتراح لتحسين التطبيق، يمكنك [فتح قضية جديدة على GitHub](https://github.com/nextcloud/android/issues).
إذا لم تكن متأكدًا ما إذا كانت المشكلة ناتجة عن التطبيق أو الإعدادات أو الخادم، فابدأ بالسؤال في المنتدى، ثم عد إلى GitHub إذا لزم الأمر.
> ملاحظة: هذا المستودع خاص بتطبيق أندرويد فقط. إذا كانت المشكلة في الخادم، يرجى التواصل مع [فريق خادم Nextcloud](https://github.com/nextcloud/server).
## كيف تساهم في المشروع 🚀
هناك العديد من الطرق للمساهمة، سواء كنت مبرمجًا أو لا:
- مساعدة المستخدمين في المنتدى: https://help.nextcloud.com
- ترجمة التطبيق عبر [Transifex](https://app.transifex.com/nextcloud/nextcloud/android/)
- الإبلاغ عن المشاكل أو تقديم اقتراحات عبر [GitHub Issues](https://github.com/nextcloud/android/issues/new/choose)
- تنفيذ إصلاحات أو تحسينات عبر Pull Requests
- مراجعة [طلبات الدمج](https://github.com/nextcloud/android/pulls)
- اختبار النسخ التجريبية أو اليومية أو المرشحة للإصدار
- تحسين [التوثيق](https://github.com/nextcloud/documentation/)
- اختبار الميزات الأساسية في آخر إصدار مستقر
- تعلم كيفية جمع سجلات الأخطاء (logcat) لتقديم تقارير دقيقة
## إرشادات المساهمة والترخيص 📜
- الترخيص: [GPLv2](https://github.com/nextcloud/android/blob/master/LICENSE.txt)
- جميع المساهمات بعد 16 يونيو 2016 تعتبر مرخصة تحت AGPLv3 أو أي إصدار لاحق
- لا حاجة لتوقيع اتفاقية مساهم (CLA)
- يُفضل إضافة السطر التالي في رأس الملف عند إجراء تغييرات كبيرة:
```plaintext
SPDX-FileCopyrightText: <السنة> <اسمك> <بريدك الإلكتروني>
```
يرجى قراءة [مدونة السلوك](https://nextcloud.com/community/code-of-conduct/) لضمان بيئة تعاون إيجابية.
راجع أيضًا [إرشادات المساهمة](https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md).
## ابدأ بالمساهمة 🔧
- اقرأ [SETUP.md](https://github.com/nextcloud/android/blob/master/SETUP.md) و[CONTRIBUTING.md](https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md)
- قم بعمل fork للمستودع وابدأ بإرسال Pull Requests إلى فرع master
- يمكنك البدء بمراجعة [طلبات الدمج](https://github.com/nextcloud/android/pulls) أو العمل على [القضايا المبتدئة](https://github.com/nextcloud/android/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
## جمع سجلات الأخطاء (logcat) 🔍
### على لينكس:
- فعّل USB-Debugging على هاتفك
- افتح الطرفية وأدخل:
```bash
adb logcat --pid=$(adb shell pidof -s 'com.nextcloud.client') > logcatOutput.txt
```
> تأكد من تثبيت [adb](https://developer.android.com/studio/releases/platform-tools.html)
### على ويندوز:
- حمّل [Minimal ADB and Fastboot](https://forum.xda-developers.com/t/tool-minimal-adb-and-fastboot-2-9-18.2317790/#post-42407269)
- فعّل USB-Debugging
- افتح البرنامج وأدخل:
```bash
adb shell pidof -s 'com.nextcloud.client'
```
- استخدم الناتج كـ `<processID>` في الأمر التالي:
```bash
adb logcat --pid=<processID> > "%USERPROFILE%\Downloads\logcatOutput.txt"
```
### على الجهاز (مع صلاحيات root):
```bash
su
logcat -d --pid $(pidof -s com.nextcloud.client) -f /sdcard/logcatOutput.txt
```
أو استخدم تطبيقات مثل [CatLog](https://play.google.com/store/apps/details?id=com.nolanlawson.logcat) أو [aLogcat](https://play.google.com/store/apps/details?id=org.jtb.alogcat)
## النسخة التطويرية 🛠️
- [تحميل مباشر للـ APK](https://download.nextcloud.com/android/dev/latest.apk)
- [F-Droid النسخة التجريبية](https://f-droid.org/en/packages/com.nextcloud.android.beta/)
## المشاكل المعروفة والأسئلة الشائعة
### الإشعارات الفورية لا تعمل في نسخ F-Droid
بسبب اعتمادها على خدمات Google Play، لا تعمل الإشعارات الفورية في نسخ F-Droid حاليًا.
-591
View File
@@ -1,591 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2024 Tobias Kaminsky <[email protected]>
* SPDX-FileCopyrightText: 2024 Andy Scherzinger <[email protected]>
* SPDX-FileCopyrightText: 2022 Álvaro Brey Vilas <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
import com.github.spotbugs.snom.Confidence
import com.github.spotbugs.snom.Effort
import com.github.spotbugs.snom.SpotBugsTask
import org.gradle.internal.jvm.Jvm
buildscript {
dependencies {
classpath "com.android.tools.build:gradle:$androidPluginVersion"
classpath libs.spotbugs.gradle.plugin
classpath libs.kotlin.gradle.plugin
classpath libs.detekt.gradle.plugin
classpath libs.commons.httpclient.commons.httpclient // remove after entire switch to lib v2
classpath libs.shot
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jacoco:org.jacoco.report:$jacoco_version"
classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
}
}
plugins {
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.spotless)
alias(libs.plugins.kapt)
alias(libs.plugins.ksp) apply false
alias(libs.plugins.kotlin.serialization)
}
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-parcelize"
apply plugin: "checkstyle"
apply plugin: "pmd"
apply from: "$rootProject.projectDir/jacoco.gradle"
apply plugin: "com.github.spotbugs"
apply plugin: "io.gitlab.arturbosch.detekt"
// needed to make renovate run without shot, as shot requires Android SDK
// https://github.com/pedrovgs/Shot/issues/300
if (shotTest) {
apply plugin: "shot"
}
apply plugin: "com.google.devtools.ksp"
println "Gradle uses Java ${Jvm.current()}"
configurations {
configureEach {
exclude group: "org.jetbrains", module: "annotations-java5" // via prism4j, already using annotations explicitly
}
}
configurations.configureEach {
resolutionStrategy.eachDependency {
if (requested.group == "org.checkerframework" && requested.name != "checker-compat-qual") {
useVersion(checkerVersion)
because("https://github.com/google/ExoPlayer/issues/10007")
}
if (requested.group == "commons-logging" && requested.name == "commons-logging") {
useTarget("org.slf4j:jcl-over-slf4j:1.7.36")
}
}
}
// semantic versioning for version code
def versionMajor = 3
def versionMinor = 35
def versionPatch = 0
def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
def ndkEnv = new HashMap<String, String>()
file("$project.rootDir/ndk.env").readLines().each() {
def (key, value) = it.tokenize("=")
ndkEnv.put(key, value)
}
def perfAnalysis = project.hasProperty("perfAnalysis")
def getConfigProperties() {
def props = new Properties()
def file = rootProject.file(".gradle/config.properties")
if (file.exists()) {
props.load(new FileInputStream(file))
}
return props
}
def configProps = getConfigProperties()
android {
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
ndkVersion = "${ndkEnv.get("NDK_VERSION")}"
namespace = "com.owncloud.android"
testNamespace = "${namespace}.test"
androidResources {
generateLocaleConfig = true
}
defaultConfig {
applicationId = "com.nextcloud.client"
minSdk = 27
targetSdk = 35
compileSdk = 35
buildConfigField "boolean", "CI", ciBuild.toString()
buildConfigField "boolean", "RUNTIME_PERF_ANALYSIS", perfAnalysis.toString()
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
// arguments to be passed to functional tests
if (shotTest) {
testInstrumentationRunner "com.karumi.shot.ShotTestRunner"
} else {
testInstrumentationRunner "com.nextcloud.client.TestRunner"
}
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
testInstrumentationRunnerArguments disableAnalytics: "true"
versionCode versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
if (versionBuild > 89) {
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
} else if (versionBuild > 50) {
versionName "${versionMajor}.${versionMinor}.${versionPatch} RC" + (versionBuild - 50)
} else {
versionName "${versionMajor}.${versionMinor}.${versionPatch} Alpha" + (versionBuild + 1)
}
// adapt structure from Eclipse to Gradle/Android Studio expectations;
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
flavorDimensions += "default"
buildTypes {
release {
buildConfigField "String", "NC_TEST_SERVER_DATA_STRING", "\"\""
}
debug {
testCoverageEnabled = project.hasProperty("coverage")
resConfigs "xxxhdpi"
buildConfigField "String", "NC_TEST_SERVER_DATA_STRING", "\"nc://login/user:${configProps['NC_TEST_SERVER_USERNAME']}&password:${configProps['NC_TEST_SERVER_PASSWORD']}&server:${configProps['NC_TEST_SERVER_BASEURL']}\""
}
}
buildFeatures {
buildConfig = true
}
productFlavors {
// used for f-droid
generic {
applicationId "com.nextcloud.client"
dimension "default"
}
gplay {
applicationId "com.nextcloud.client"
dimension "default"
}
huawei {
applicationId "com.nextcloud.client"
dimension "default"
}
versionDev {
applicationId "com.nextcloud.android.beta"
dimension "default"
versionCode 20220322
versionName "20220322"
}
qa {
applicationId "com.nextcloud.android.qa"
dimension "default"
versionCode 1
versionName "1"
}
}
testOptions {
unitTests.returnDefaultValues = true
animationsDisabled = true
}
}
// adapt structure from Eclipse to Gradle/Android Studio expectations;
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
packagingOptions {
resources {
excludes += "META-INF/LICENSE*"
excludes += "META-INF/versions/9/OSGI-INF/MANIFEST*"
pickFirst "MANIFEST.MF" // workaround for duplicated manifest on some dependencies
}
}
tasks.register("checkstyle", Checkstyle) {
configFile = file("${rootProject.projectDir}/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
source "src"
include "**/*.java"
exclude "**/gen/**"
classpath = files()
}
tasks.register("pmd", Pmd) {
ruleSetFiles = files("${project.rootDir}/ruleset.xml")
ignoreFailures = true // should continue checking
ruleSets = []
source "src"
include "**/*.java"
exclude "**/gen/**"
reports {
xml {
destination = layout.buildDirectory.file("reports/pmd/pmd.xml").get().asFile
}
html {
destination = layout.buildDirectory.file("reports/pmd/pmd.html").get().asFile
}
}
}
check.dependsOn "checkstyle", "spotbugsGplayDebug", "pmd", "lint", "spotlessKotlinCheck", "detekt"
buildFeatures {
dataBinding = true
viewBinding = true
aidl = true
compose = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
lint {
abortOnError = false
checkGeneratedSources = true
disable "MissingTranslation", "GradleDependency", "VectorPath", "IconMissingDensityFolder", "IconDensities", "GoogleAppIndexingWarning", "MissingDefaultResource", "InvalidPeriodicWorkRequestInterval", "StringFormatInvalid", "MissingQuantity"
htmlOutput = layout.buildDirectory.file("reports/lint/lint.html").get().asFile
htmlReport = true
}
sourceSets {
// Adds exported schema location as test app assets.
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
kapt {
useBuildCache = true
}
}
dependencies {
// region Nextcloud library
implementation("com.github.nextcloud:android-library:$androidLibraryVersion") {
exclude group: "org.ogce", module: "xpp3" // unused in Android and brings wrong Junit version
}
// endregion
// region Splash Screen
implementation libs.splashscreen
// endregion
// region Jetpack Compose
implementation(platform(libs.compose.bom))
implementation(libs.compose.ui)
implementation(libs.compose.ui.graphics)
implementation(libs.compose.material3)
debugImplementation(libs.compose.ui.tooling)
implementation(libs.compose.ui.tooling.preview)
// endregion
// region Media3
implementation libs.media3.ui
implementation libs.media3.session
implementation libs.media3.exoplayer
implementation libs.media3.datasource
// endregion
// region Room
implementation libs.room.runtime
ksp "androidx.room:room-compiler:$roomVersion"
androidTestImplementation libs.room.testing
// endregion
// region Espresso
androidTestImplementation libs.espresso.core
androidTestImplementation libs.espresso.contrib
androidTestImplementation libs.espresso.web
androidTestImplementation libs.espresso.accessibility
androidTestImplementation libs.espresso.intents
androidTestImplementation libs.espresso.idling.resource
// endregion
// region Glide
implementation libs.glide
ksp libs.ksp
// endregion
// region UI
implementation libs.appcompat
implementation libs.webkit
implementation libs.cardview
implementation libs.exifinterface
implementation libs.fragment.ktx
// endregion
// region Worker
implementation libs.work.runtime
implementation libs.work.runtime.ktx
// endregion
// region Lifecycle
implementation libs.lifecycle.viewmodel.ktx
implementation libs.lifecycle.service
implementation(libs.lifecycle.runtime.ktx)
// endregion
// region JUnit
androidTestImplementation libs.junit
androidTestImplementation libs.rules
androidTestImplementation libs.runner
androidTestUtil libs.orchestrator
androidTestImplementation libs.core.ktx
androidTestImplementation libs.core.testing
// endregion
// region other libraries
compileOnly libs.org.jbundle.util.osgi.wrapped.org.apache.http.client
implementation libs.commons.httpclient.commons.httpclient // remove after entire switch to lib v2
implementation libs.jackrabbit.webdav // remove after entire switch to lib v2
implementation libs.constraintlayout
implementation libs.legacy.support.v4
implementation libs.material
implementation libs.disklrucache
implementation libs.juniversalchardet // need this version for Android <7
compileOnly libs.annotations
implementation libs.commons.io
implementation libs.eventbus
implementation libs.ez.vcard
implementation libs.nnio
implementation libs.bcpkix.jdk18on
implementation libs.gson
implementation libs.sectioned.recyclerview
implementation libs.photoview
implementation libs.android.gif.drawable
implementation libs.qrcodescanner // "com.github.blikoon:QRCodeScanner:0.1.2"
implementation libs.flexbox
implementation libs.androidsvg
implementation libs.annotation
implementation libs.emoji.google
// endregion
// region AppScan, document scanner not available on FDroid (generic) due to OpenCV binaries
gplayImplementation project(":appscan")
huaweiImplementation project(":appscan")
qaImplementation project(":appscan")
// endregion
// region SpotBugs
spotbugsPlugins libs.findsecbugs.plugin
spotbugsPlugins libs.fb.contrib
// endregion
// region Dagger
implementation libs.dagger
implementation libs.dagger.android
implementation libs.dagger.android.support
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
// endregion
// region Crypto
implementation libs.conscrypt.android
// endregion
// region Library
implementation libs.library
// endregion
// region Shimmer
implementation libs.loaderviewlibrary
// endregion
// region Markdown rendering
implementation libs.core
implementation libs.ext.strikethrough
implementation libs.ext.tables
implementation libs.ext.tasklist
implementation libs.html
implementation libs.syntax.highlight
implementation libs.prism4j
kapt "io.noties:prism4j-bundler:$prismVersion"
// endregion
// region Image cropping / rotation
implementation libs.android.image.cropper
// endregion
// region Maps
implementation libs.osmdroid.android
// endregion
// region iCal4j
implementation(libs.ical4j) {
["org.apache.commons", "commons-logging"].each {
exclude group: "$it"
}
}
// endregion
// region LeakCanary
if (perfAnalysis) {
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.14"
}
// endregion
// region Local Unit Test
testImplementation libs.junit.junit
testImplementation libs.mockito.core
testImplementation libs.test.core
testImplementation libs.json
testImplementation libs.mockito.kotlin
testImplementation libs.core.testing
testImplementation "io.mockk:mockk:$mockkVersion"
testImplementation libs.mockk.android
// endregion
// region Mocking support
androidTestImplementation libs.dexopener // required to allow mocking on API 27 and older
androidTestImplementation libs.mockito.kotlin
androidTestImplementation libs.mockito.core
androidTestImplementation(libs.mockito.android)
androidTestImplementation libs.mockk.android
androidTestImplementation libs.screenshot.core
// endregion
// region UIAutomator
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
// androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0"
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
// androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
androidTestImplementation libs.screengrab
// endregion
// region Kotlin
implementation libs.kotlin.stdlib
// endregion
// region Stateless
implementation libs.stateless4j
// endregion
// region Google Play dependencies, upon each update first test: new registration, receive push
gplayImplementation libs.firebase.messaging
gplayImplementation libs.play.services.base
gplayImplementation libs.review.ktx
// endregion
// region UI
implementation libs.ui
// endregion
// region Image loading
implementation libs.coil
// endregion
// kotlinx.serialization
implementation(libs.kotlinx.serialization.json)
}
configurations.configureEach {
resolutionStrategy {
force "org.objenesis:objenesis:3.4"
eachDependency { details ->
if ("org.jacoco" == details.requested.group) {
details.useVersion "$jacoco_version"
}
}
}
}
// Run the compiler as a separate process
tasks.withType(JavaCompile).configureEach {
options.fork = true
// Enable Incremental Compilation
options.incremental = true
}
tasks.withType(Test).configureEach {
// Run tests in parallel
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
// increased logging for tests
testLogging {
events "passed", "skipped", "failed"
}
}
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output -> outputFileName = "${output.baseName}-${variant.versionCode}.apk"
}
}
spotless {
kotlin {
target "**/*.kt"
ktlint()
}
}
detekt {
config.setFrom("detekt.yml")
}
if (shotTest) {
shot {
showOnlyFailingTestsInReports = ciBuild
// CI environment renders some shadows slightly different from local VMs
// Add a 0.5% tolerance to account for that
tolerance = ciBuild ? 0.1 : 0
}
}
jacoco {
toolVersion = "$jacoco_version"
}
spotbugs {
ignoreFailures = true // should continue checking
effort = Effort.MAX
reportLevel = Confidence.valueOf("MEDIUM")
}
tasks.withType(SpotBugsTask){task ->
String variantNameCap = task.name.replace("spotbugs", "")
String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)
dependsOn "compile${variantNameCap}Sources"
classes = fileTree(layout.buildDirectory.get().asFile.toString()+"/intermediates/javac/${variantName}/compile${variantNameCap}JavaWithJavac/classes/")
excludeFilter = file("${project.rootDir}/scripts/analysis/spotbugs-filter.xml")
reports {
xml {
required = true
}
html {
required = true
outputLocation = layout.buildDirectory.file("reports/spotbugs/spotbugs.html").get().asFile
stylesheet = "fancy.xsl"
}
}
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}
+523
View File
@@ -0,0 +1,523 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Jimly Asshiddiqy <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@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
import com.karumi.shot.ShotExtension
import org.gradle.internal.jvm.Jvm
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.io.FileInputStream
import java.util.Properties
val shotTest = System.getenv("SHOT_TEST") == "true"
val ciBuild = System.getenv("CI") == "true"
val perfAnalysis = project.hasProperty("perfAnalysis")
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
// https://github.com/pedrovgs/Shot/issues/300
if (System.getenv("SHOT_TEST") == "true") alias(libs.plugins.shot)
id("checkstyle")
id("pmd")
}
apply(from = "${rootProject.projectDir}/jacoco.gradle.kts")
println("Gradle uses Java ${Jvm.current()}")
configurations.configureEach {
// via prism4j, already using annotations explicitly
exclude(group = "org.jetbrains", module = "annotations-java5")
resolutionStrategy {
force(libs.objenesis)
eachDependency {
if (requested.group == "org.checkerframework" && requested.name != "checker-compat-qual") {
useVersion(libs.versions.checker.get())
because("https://github.com/google/ExoPlayer/issues/10007")
} else if (requested.group == "org.jacoco") {
useVersion(libs.versions.jacoco.get())
} else if (requested.group == "commons-logging" && requested.name == "commons-logging") {
useTarget(libs.slfj)
}
}
}
}
// semantic versioning for version code
val versionMajor = 3
val versionMinor = 36
val versionPatch = 0
val versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
val ndkEnv = buildMap {
file("${project.rootDir}/ndk.env").readLines().forEach {
val (key, value) = it.split("=")
put(key, value)
}
}
val configProps = Properties().apply {
val file = rootProject.file(".gradle/config.properties")
if (file.exists()) load(FileInputStream(file))
}
val ncTestServerUsername = configProps["NC_TEST_SERVER_USERNAME"]
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
ndkVersion = "${ndkEnv["NDK_VERSION"]}"
namespace = "com.owncloud.android"
testNamespace = "${namespace}.test"
androidResources.generateLocaleConfig = true
defaultConfig {
applicationId = "com.nextcloud.client"
minSdk = 28
targetSdk = 36
compileSdk = 36
buildConfigField("boolean", "CI", ciBuild.toString())
buildConfigField("boolean", "RUNTIME_PERF_ANALYSIS", perfAnalysis.toString())
javaCompileOptions.annotationProcessorOptions {
arguments += mapOf("room.schemaLocation" to "$projectDir/schemas")
}
// arguments to be passed to functional tests
testInstrumentationRunner = if (shotTest) "com.karumi.shot.ShotTestRunner"
else "com.nextcloud.client.TestRunner"
testInstrumentationRunnerArguments += mapOf(
"TEST_SERVER_URL" to ncTestServerBaseUrl.toString(),
"TEST_SERVER_USERNAME" to ncTestServerUsername.toString(),
"TEST_SERVER_PASSWORD" to ncTestServerPassword.toString()
)
testInstrumentationRunnerArguments["disableAnalytics"] = "true"
versionCode = versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
versionName = when {
versionBuild > 89 -> "${versionMajor}.${versionMinor}.${versionPatch}"
versionBuild > 50 -> "${versionMajor}.${versionMinor}.${versionPatch} RC" + (versionBuild - 50)
else -> "${versionMajor}.${versionMinor}.${versionPatch} Alpha" + (versionBuild + 1)
}
// adapt structure from Eclipse to Gradle/Android Studio expectations;
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
flavorDimensions += "default"
buildTypes {
release {
buildConfigField("String", "NC_TEST_SERVER_DATA_STRING", "\"\"")
}
debug {
enableUnitTestCoverage = project.hasProperty("coverage")
resConfigs("xxxhdpi")
buildConfigField(
"String",
"NC_TEST_SERVER_DATA_STRING",
"\"nc://login/user:${ncTestServerUsername}&password:${ncTestServerPassword}&server:${ncTestServerBaseUrl}\""
)
}
}
productFlavors {
// used for f-droid
register("generic") {
applicationId = "com.nextcloud.client"
dimension = "default"
}
register("gplay") {
applicationId = "com.nextcloud.client"
dimension = "default"
}
register("huawei") {
applicationId = "com.nextcloud.client"
dimension = "default"
}
register("versionDev") {
applicationId = "com.nextcloud.android.beta"
dimension = "default"
versionCode = 20220322
versionName = "20220322"
}
register("qa") {
applicationId = "com.nextcloud.android.qa"
dimension = "default"
versionCode = 1
versionName = "1"
}
}
}
applicationVariants.configureEach {
outputs.configureEach {
if (this is ApkVariantOutputImpl) this.outputFileName = "${this.baseName}-${this.versionCode}.apk"
}
}
testOptions {
unitTests.isReturnDefaultValues = true
animationsDisabled = true
}
// adapt structure from Eclipse to Gradle/Android Studio expectations;
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
packaging.resources {
excludes.addAll(listOf("META-INF/LICENSE*", "META-INF/versions/9/OSGI-INF/MANIFEST*"))
pickFirsts.add("MANIFEST.MF") // workaround for duplicated manifest on some dependencies
}
buildFeatures {
buildConfig = true
dataBinding = true
viewBinding = true
aidl = true
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
lint {
abortOnError = true
warningsAsErrors = true
checkGeneratedSources = true
disable.addAll(
listOf(
"MissingTranslation",
"GradleDependency",
"VectorPath",
"IconMissingDensityFolder",
"IconDensities",
"GoogleAppIndexingWarning",
"MissingDefaultResource",
"InvalidPeriodicWorkRequestInterval",
"StringFormatInvalid",
"MissingQuantity",
"IconXmlAndPng",
"SelectedPhotoAccess",
"UnsafeIntentLaunch"
)
)
htmlOutput = layout.buildDirectory.file("reports/lint/lint.html").get().asFile
htmlReport = true
}
sourceSets {
// Adds exported schema location as test app assets.
getByName("androidTest") {
assets.srcDirs(files("$projectDir/schemas"))
}
}
}
kapt.useBuildCache = true
ksp.arg("room.schemaLocation", "$projectDir/schemas")
kotlin.compilerOptions.jvmTarget.set(JvmTarget.JVM_17)
spotless.kotlin {
target("**/*.kt")
ktlint()
}
detekt.config.setFrom("detekt.yml")
if (shotTest) configure<ShotExtension> {
showOnlyFailingTestsInReports = ciBuild
// CI environment renders some shadows slightly different from local VMs
// Add a 0.5% tolerance to account for that
tolerance = if (ciBuild) 0.1 else 0.0
}
spotbugs {
ignoreFailures = true // should continue checking
effort = Effort.MAX
reportLevel = Confidence.valueOf("MEDIUM")
}
tasks.register<Checkstyle>("checkstyle") {
configFile = file("${rootProject.projectDir}/checkstyle.xml")
setConfigProperties(
"checkstyleSuppressionsPath" to file("${rootProject.rootDir}/suppressions.xml").absolutePath
)
source("src")
include("**/*.java")
exclude("**/gen/**")
classpath = files()
}
tasks.register<Pmd>("pmd") {
ruleSetFiles = files("${rootProject.rootDir}/ruleset.xml")
ignoreFailures = true // should continue checking
ruleSets = emptyList()
source("src")
include("**/*.java")
exclude("**/gen/**")
reports {
xml.outputLocation.set(layout.buildDirectory.file("reports/pmd/pmd.xml").get().asFile)
html.outputLocation.set(layout.buildDirectory.file("reports/pmd/pmd.html").get().asFile)
}
}
tasks.withType<SpotBugsTask>().configureEach {
val variantNameCap = name.replace("spotbugs", "")
val variantName = variantNameCap.substring(0, 1).lowercase() + variantNameCap.substring(1)
dependsOn("compile${variantNameCap}Sources")
classes = fileTree(
layout.buildDirectory.get().asFile.toString() +
"/intermediates/javac/${variantName}/compile${variantNameCap}JavaWithJavac/classes/"
)
excludeFilter.set(file("${project.rootDir}/scripts/analysis/spotbugs-filter.xml"))
reports.create("xml") {
required.set(true)
}
reports.create("html") {
required.set(true)
outputLocation.set(layout.buildDirectory.file("reports/spotbugs/spotbugs.html"))
setStylesheet("fancy.xsl")
}
}
// Run the compiler as a separate process
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
// Enable Incremental Compilation
options.isIncremental = true
}
tasks.withType<Test>().configureEach {
// Run tests in parallel
maxParallelForks = maxOf(1, Runtime.getRuntime().availableProcessors().div(2))
// increased logging for tests
testLogging.events("passed", "skipped", "failed")
}
tasks.named("check").configure {
dependsOn("checkstyle", "spotbugsGplayDebug", "pmd", "lint", "spotlessKotlinCheck", "detekt")
}
dependencies {
// region Nextcloud library
implementation(libs.android.library) {
exclude(group = "org.ogce", module = "xpp3") // unused in Android and brings wrong Junit version
}
// endregion
// region Splash Screen
implementation(libs.splashscreen)
// endregion
// region Jetpack Compose
implementation(platform(libs.compose.bom))
implementation(libs.material.icons.core)
implementation(libs.compose.ui)
implementation(libs.compose.ui.graphics)
implementation(libs.compose.material3)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.foundation)
debugImplementation(libs.compose.ui.tooling)
// endregion
// region Media3
implementation(libs.bundles.media3)
// endregion
// region Room
implementation(libs.room.runtime)
ksp(libs.room.compiler)
androidTestImplementation(libs.room.testing)
// endregion
// region Espresso
androidTestImplementation(libs.bundles.espresso)
// endregion
// region Glide
implementation(libs.glide)
ksp(libs.ksp)
// endregion
// region UI
implementation(libs.bundles.ui)
// endregion
// region Worker
implementation(libs.work.runtime)
implementation(libs.work.runtime.ktx)
// endregion
// region Lifecycle
implementation(libs.lifecycle.viewmodel.ktx)
implementation(libs.lifecycle.service)
implementation(libs.lifecycle.runtime.ktx)
// endregion
// region JUnit
androidTestImplementation(libs.junit)
androidTestImplementation(libs.rules)
androidTestImplementation(libs.runner)
androidTestUtil(libs.orchestrator)
androidTestImplementation(libs.core.ktx)
androidTestImplementation(libs.core.testing)
// endregion
// region other libraries
compileOnly(libs.org.jbundle.util.osgi.wrapped.org.apache.http.client)
implementation(libs.commons.httpclient.commons.httpclient) // remove after entire switch to lib v2
implementation(libs.jackrabbit.webdav) // remove after entire switch to lib v2
implementation(libs.constraintlayout)
implementation(libs.legacy.support.v4)
implementation(libs.material)
implementation(libs.disklrucache)
implementation(libs.juniversalchardet) // need this version for Android <7
compileOnly(libs.annotations)
implementation(libs.commons.io)
implementation(libs.eventbus)
implementation(libs.ez.vcard)
implementation(libs.nnio)
implementation(libs.bcpkix.jdk18on)
implementation(libs.gson)
implementation(libs.sectioned.recyclerview)
implementation(libs.photoview)
implementation(libs.android.gif.drawable)
implementation(libs.qrcodescanner) // "com.github.blikoon:QRCodeScanner:0.1.2"
implementation(libs.flexbox)
implementation(libs.androidsvg)
implementation(libs.annotation)
implementation(libs.emoji.google)
// endregion
// region AppScan, document scanner not available on FDroid (generic) due to OpenCV binaries
"gplayImplementation"(project(":appscan"))
"huaweiImplementation"(project(":appscan"))
"qaImplementation"(project(":appscan"))
// endregion
// region SpotBugs
spotbugsPlugins(libs.findsecbugs.plugin)
spotbugsPlugins(libs.fb.contrib)
// endregion
// region Dagger
implementation(libs.dagger)
implementation(libs.dagger.android)
implementation(libs.dagger.android.support)
ksp(libs.dagger.compiler)
ksp(libs.dagger.processor)
// endregion
// region Crypto
implementation(libs.conscrypt.android)
// endregion
// region Library
implementation(libs.library)
// endregion
// region Shimmer
implementation(libs.loaderviewlibrary)
// endregion
// region Markdown rendering
implementation(libs.bundles.markdown.rendering)
kapt(libs.prism4j.bundler)
// endregion
// region Image cropping / rotation
implementation(libs.android.image.cropper)
// endregion
// region Maps
implementation(libs.osmdroid.android)
// endregion
// region iCal4j
implementation(libs.ical4j) {
listOf("org.apache.commons", "commons-logging").forEach { groupName -> exclude(group = groupName) }
}
// endregion
// region LeakCanary
if (perfAnalysis) debugImplementation(libs.leakcanary)
// endregion
// region Local Unit Test
testImplementation(libs.bundles.unit.test)
// endregion
// region Mocking support
androidTestImplementation(libs.bundles.mocking)
// endregion
// region UIAutomator
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
// androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0"
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
// androidTestImplementation("com.android.support:support-annotations:${supportLibraryVersion}"
androidTestImplementation(libs.screengrab)
// endregion
// region Kotlin
implementation(libs.kotlin.stdlib)
// endregion
// region Stateless
implementation(libs.stateless4j)
// endregion
// region Google Play dependencies, upon each update first test: new registration, receive push
"gplayImplementation"(libs.bundles.gplay)
// endregion
// region UI
implementation(libs.ui)
// endregion
// region Image loading
implementation(libs.coil)
// endregion
// kotlinx.serialization
implementation(libs.kotlinx.serialization.json)
}
+4
View File
@@ -39,6 +39,10 @@
<ignore path="**/values-**/strings.xml" />
</issue>
<issue id="PluralsCandidate">
<ignore path="**/values-**/strings.xml" />
</issue>
<issue id="ExtraTranslation">
<ignore path="**/strings.xml"/>
<ignore path="**/values-b+en+001/strings.xml"/>
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+4 -2
View File
@@ -116,12 +116,14 @@ BEGIN:VEVENT
DTSTAMP:20210820T083606Z
UID:[email protected]
SUMMARY:Test event
DESCRIPTION:
DESCRIPTION:Test event
ORGANIZER:mailto:[email protected]
LOCATION:
STATUS:CONFIRMED
DTSTART;TZID=Europe/Berlin:20210806T090000
DTEND:20210806T080000Z
DTEND;TZID=Europe/Berlin:20210806T100000
BEGIN:VALARM
TRIGGER:-PT30M
ACTION:DISPLAY
+2 -18
View File
@@ -2,22 +2,6 @@ Java:
```java
private String getAppProcessName() {
String processName = "";
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
ActivityManager manager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
final int ownPid = android.os.Process.myPid();
final List<ActivityManager.RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
if (processes != null) {
for (ActivityManager.RunningAppProcessInfo info : processes) {
if (info.pid == ownPid) {
processName = info.processName;
break;
}
}
}
} else {
processName = Application.getProcessName();
}
return processName;
}
return Application.getProcessName();
}
```
@@ -8,10 +8,8 @@
package com.nextcloud.client
import android.view.View
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
@@ -25,88 +23,72 @@ import com.owncloud.android.lib.resources.activities.model.RichObject
import com.owncloud.android.lib.resources.activities.models.PreviewObject
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.ui.activities.ActivitiesActivity
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
import java.util.GregorianCalendar
class ActivitiesActivityIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.ActivitiesActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun openDrawer() {
launchActivity<ActivitiesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
sut.dismissSnackbar()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "openDrawer", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.dismissSnackbar()
}
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
scenario.onActivity { sut ->
val screenShotName = createName("${testClassName}_openDrawer", "")
screenshotViaName(sut, screenShotName)
}
onView(withId(R.id.drawer_layout)).check(matches(isDisplayed()))
}
}
@Test
@UiThread
@ScreenshotTest
fun loading() {
launchActivity<ActivitiesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.dismissSnackbar()
sut.binding.emptyList.root.visibility = View.GONE
sut.binding.swipeContainingList.visibility = View.GONE
sut.binding.loadingContent.visibility = View.VISIBLE
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "loading", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.dismissSnackbar()
sut.binding.emptyList.root.visibility = View.GONE
sut.binding.swipeContainingList.visibility = View.GONE
sut.binding.loadingContent.visibility = View.VISIBLE
}
val screenShotName = createName(testClassName + "_" + "loading", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun empty() {
launchActivity<ActivitiesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.showActivities(mutableListOf(), nextcloudClient, -1)
sut.setProgressIndicatorState(false)
sut.dismissSnackbar()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "empty", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.showActivities(mutableListOf(), nextcloudClient, -1)
sut.setProgressIndicatorState(false)
sut.dismissSnackbar()
}
val screenShotName = createName(testClassName + "_" + "empty", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
@SuppressWarnings("MagicNumber")
fun showActivities() {
@@ -186,36 +168,35 @@ class ActivitiesActivityIT : AbstractIT() {
launchActivity<ActivitiesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.showActivities(activities as List<Any>?, nextcloudClient, -1)
sut.setProgressIndicatorState(false)
sut.dismissSnackbar()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showActivities", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.showActivities(activities as List<Any>?, nextcloudClient, -1)
sut.setProgressIndicatorState(false)
sut.dismissSnackbar()
}
val screenShotName = createName(testClassName + "_" + "showActivities", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun error() {
launchActivity<ActivitiesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.showEmptyContent("Error", "Error! Please try again later!")
sut.setProgressIndicatorState(false)
sut.dismissSnackbar()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.showEmptyContent("Error", "Error! Please try again later!")
sut.setProgressIndicatorState(false)
sut.dismissSnackbar()
}
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@@ -8,20 +8,15 @@
*/
package com.nextcloud.client
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.ui.activity.CommunityActivity
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -29,30 +24,18 @@ import org.junit.rules.TestRule
class CommunityActivityIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.CommunityActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
var storagePermissionRule: TestRule = grant()
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<CommunityActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -9,10 +9,8 @@
package com.nextcloud.client
import android.Manifest
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.contrib.NavigationViewActions
@@ -25,30 +23,18 @@ import com.owncloud.android.R
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.ui.fragment.EmptyListState
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Rule
import org.junit.Test
class FileDisplayActivityScreenshotIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.FileDisplayActivityScreenshotIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
companion object {
@@ -56,31 +42,27 @@ class FileDisplayActivityScreenshotIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun open() {
try {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.run {
listOfFilesFragment?.let {
it.setFabEnabled(false)
resetScrolling(true)
it.setEmptyListMessage(EmptyListState.LOADING)
it.isLoading = false
}
sut.run {
listOfFilesFragment?.let {
it.setFabEnabled(false)
resetScrolling(true)
it.setEmptyListMessage(EmptyListState.LOADING)
it.isLoading = false
}
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
} catch (e: SecurityException) {
Log_OC.e(TAG, "Error caught at open $e")
@@ -88,41 +70,35 @@ class FileDisplayActivityScreenshotIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun showMediaThenAllFiles() {
try {
launchActivity<FileDisplayActivity>().use { scenario ->
var activity: FileDisplayActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = sut.listOfFilesFragment
Assert.assertNotNull(fragment)
fragment!!.setFabEnabled(false)
fragment.setEmptyListMessage(EmptyListState.LOADING)
fragment.isLoading = false
EspressoIdlingResource.decrement()
onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(ViewMatchers.withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_gallery))
onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(ViewMatchers.withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_all_files))
EspressoIdlingResource.increment()
fragment.setFabEnabled(false)
fragment.setEmptyListMessage(EmptyListState.LOADING)
fragment.isLoading = false
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showMediaThenAllFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
val fragment = sut.listOfFilesFragment
Assert.assertNotNull(fragment)
fragment!!.setFabEnabled(false)
fragment.setEmptyListMessage(EmptyListState.LOADING)
fragment.isLoading = false
}
onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(ViewMatchers.withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_gallery))
onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(ViewMatchers.withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_all_files))
val fragment = activity!!.listOfFilesFragment
fragment!!.setFabEnabled(false)
fragment.setEmptyListMessage(EmptyListState.LOADING)
fragment.isLoading = false
val screenShotName = createName(testClassName + "_" + "showMediaThenAllFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
} catch (e: SecurityException) {
Log_OC.e(TAG, "Error caught at open $e")
@@ -130,35 +106,31 @@ class FileDisplayActivityScreenshotIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun drawer() {
try {
launchActivity<FileDisplayActivity>().use { scenario ->
onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
scenario.onActivity { sut ->
onIdleSync {
onView(ViewMatchers.withId(R.id.drawer_layout)).perform(DrawerActions.open())
sut.run {
hideInfoBox()
resetScrolling(true)
EspressoIdlingResource.increment()
sut.run {
hideInfoBox()
resetScrolling(true)
listOfFilesFragment?.let {
it.setFabEnabled(false)
it.setEmptyListMessage(EmptyListState.LOADING)
it.isLoading = false
}
listOfFilesFragment?.let {
it.setFabEnabled(false)
it.setEmptyListMessage(EmptyListState.LOADING)
it.isLoading = false
}
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "drawer", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
val screenShotName = createName(testClassName + "_" + "drawer", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
} catch (e: SecurityException) {
Log_OC.e(TAG, "Error caught at open $e")
@@ -8,45 +8,28 @@
*/
package com.nextcloud.client
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.nextcloud.client.onboarding.FirstRunActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class FirstRunActivityIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.FirstRunActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<FirstRunActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -10,10 +10,8 @@ package com.nextcloud.client
import android.content.Intent
import android.os.Looper
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -23,11 +21,8 @@ import com.owncloud.android.datamodel.ArbitraryDataProviderImpl
import com.owncloud.android.ui.activity.RequestCredentialsActivity
import com.owncloud.android.ui.activity.SettingsActivity
import com.owncloud.android.utils.EncryptionUtils
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -36,53 +31,38 @@ import org.junit.rules.TestRule
class SettingsActivityIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.SettingsActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
var storagePermissionRule: TestRule = grant()
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<SettingsActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun showMnemonic_Error() {
launchActivity<SettingsActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "showMnemonic_Error", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
sut.handleMnemonicRequest(null)
val screenShotName = createName(testClassName + "_" + "showMnemonic_Error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.handleMnemonicRequest(null)
screenshotViaName(sut, screenShotName)
}
}
}
@Suppress("DEPRECATION")
@Test
@UiThread
fun showMnemonic() {
if (Looper.myLooper() == null) {
Looper.prepare()
@@ -96,14 +76,14 @@ class SettingsActivityIT : AbstractIT() {
}
launchActivity<SettingsActivity>().use { scenario ->
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
sut.handleMnemonicRequest(intent)
onView(isRoot()).check(matches(isDisplayed()))
Looper.myLooper()?.quitSafely()
Assert.assertTrue(true)
}
sut.handleMnemonicRequest(intent)
}
Looper.myLooper()?.quitSafely()
Assert.assertTrue(true)
}
}
}
@@ -10,10 +10,9 @@ package com.nextcloud.client
import android.content.Intent
import android.os.Looper
import androidx.annotation.UiThread
import androidx.appcompat.app.AlertDialog
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -24,46 +23,27 @@ import com.owncloud.android.datamodel.SyncedFolder
import com.owncloud.android.datamodel.SyncedFolderDisplayItem
import com.owncloud.android.ui.activity.SyncedFoldersActivity
import com.owncloud.android.ui.dialog.SyncedFolderPreferencesDialogFragment.Companion.newInstance
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class SyncedFoldersActivityIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.SyncedFoldersActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<SyncedFoldersActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.adapter.clear()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.binding.emptyList.emptyListView, screenShotName)
}
scenario.onActivity { sut ->
sut.adapter.clear()
screenshotViaName(sut.binding.emptyList.emptyListView, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun testSyncedFolderDialog() {
val item = SyncedFolderDisplayItem(
@@ -86,26 +66,21 @@ class SyncedFoldersActivityIT : AbstractIT() {
false,
SyncedFolder.NOT_SCANNED_YET
)
val fragment = newInstance(item, 0)
val intent = Intent(targetContext, SyncedFoldersActivity::class.java)
launchActivity<SyncedFoldersActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
fragment?.show(sut.supportFragmentManager, "")
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "testSyncedFolderDialog", "")
onView(isRoot()).check(matches(isDisplayed()))
val screenShotName = createName(testClassName + "_" + "testSyncedFolderDialog", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshot(fragment?.requireDialog()?.window?.decorView, screenShotName)
}
scenario.onActivity { sut ->
val fragment = newInstance(item, 0)
fragment!!.show(sut.supportFragmentManager, "")
screenshot(fragment.requireDialog().window?.decorView, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun showPowerCheckDialog() {
if (Looper.myLooper() == null) {
@@ -115,18 +90,15 @@ class SyncedFoldersActivityIT : AbstractIT() {
val intent = Intent(targetContext, SyncedFoldersActivity::class.java)
launchActivity<SyncedFoldersActivity>(intent).use { scenario ->
var dialog: AlertDialog? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val dialog = sut.buildPowerCheckDialog()
dialog.show()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showPowerCheckDialog", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshot(dialog.window?.decorView, screenShotName)
}
dialog = sut.buildPowerCheckDialog()
sut.showPowerCheckDialog()
}
val screenShotName = createName(testClassName + "_" + "showPowerCheckDialog", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshot(dialog!!.window?.decorView, screenShotName)
}
}
}
@@ -1,6 +1,7 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2023 Álvaro Brey <[email protected]>
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH
* SPDX-FileCopyrightText: 2019 Tobias Kaminsky <[email protected]>
@@ -9,23 +10,12 @@
package com.nextcloud.client
import android.app.Application
import android.app.Instrumentation
import android.content.Context
import android.os.Build
import androidx.test.runner.AndroidJUnitRunner
import com.github.tmurakami.dexopener.DexOpener
import com.nextcloud.test.TestMainApp
class TestRunner : AndroidJUnitRunner() {
@Throws(ClassNotFoundException::class, IllegalAccessException::class, InstantiationException::class)
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application {
/*
* Initialize DexOpener only on API below 28 to enable mocking of Kotlin classes.
* On API 28+ the platform supports mocking natively.
*/
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
DexOpener.install(this)
}
return Instrumentation.newApplication(TestMainApp::class.java, context)
}
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application =
newApplication(TestMainApp::class.java, context)
}
@@ -8,10 +8,8 @@
*/
package com.nextcloud.client
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
@@ -20,38 +18,23 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.ui.activity.UploadListActivity
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class UploadListActivityActivityIT : AbstractIT() {
private val testClassName = "com.nextcloud.client.UploadListActivityActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun openDrawer() {
launchActivity<UploadListActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
onView(isRoot()).check(matches(isDisplayed()))
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(isRoot()).check(matches(isDisplayed()))
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
val screenShotName = createName(testClassName + "_" + "openDrawer", "")
screenshotViaName(sut, screenShotName)
}
val screenShotName = createName(testClassName + "_" + "openDrawer", "")
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@@ -7,10 +7,11 @@
*/
package com.nextcloud.client.assistant
import com.nextcloud.client.assistant.repository.AssistantRepository
import com.nextcloud.client.assistant.repository.remote.AssistantRemoteRepositoryImpl
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData
import com.owncloud.android.lib.resources.status.NextcloudVersion
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
@@ -18,11 +19,11 @@ import org.junit.Test
@Suppress("MagicNumber")
class AssistantRepositoryTests : AbstractOnServerIT() {
private var sut: AssistantRepository? = null
private var sut: AssistantRemoteRepositoryImpl? = null
@Before
fun setup() {
sut = AssistantRepository(nextcloudClient, capability)
sut = AssistantRemoteRepositoryImpl(nextcloudClient, capability)
}
@Test
@@ -33,8 +34,10 @@ class AssistantRepositoryTests : AbstractOnServerIT() {
return
}
val result = sut?.getTaskTypes()
assertTrue(result?.isNotEmpty() == true)
runBlocking {
val result = sut?.getTaskTypes()
assertTrue(result?.isNotEmpty() == true)
}
}
@Test
@@ -45,8 +48,10 @@ class AssistantRepositoryTests : AbstractOnServerIT() {
return
}
val result = sut?.getTaskList("assistant")
assertTrue(result?.isEmpty() == true || (result?.size ?: 0) > 0)
runBlocking {
val result = sut?.getTaskList("assistant")
assertTrue(result?.isEmpty() == true || (result?.size ?: 0) > 0)
}
}
@Test
@@ -65,8 +70,11 @@ class AssistantRepositoryTests : AbstractOnServerIT() {
emptyMap(),
emptyMap()
)
val result = sut?.createTask(input, taskType)
assertTrue(result?.isSuccess == true)
runBlocking {
val result = sut?.createTask(input, taskType)
assertTrue(result?.isSuccess == true)
}
}
@Test
@@ -81,14 +89,16 @@ class AssistantRepositoryTests : AbstractOnServerIT() {
sleep(120)
val taskList = sut?.getTaskList("assistant")
assertTrue(taskList != null)
runBlocking {
val taskList = sut?.getTaskList("assistant")
assertTrue(taskList != null)
sleep(120)
sleep(120)
assert((taskList?.size ?: 0) > 0)
assert((taskList?.size ?: 0) > 0)
val result = sut?.deleteTask(taskList!!.first().id)
assertTrue(result?.isSuccess == true)
val result = sut?.deleteTask(taskList!!.first().id)
assertTrue(result?.isSuccess == true)
}
}
}
@@ -7,63 +7,41 @@
*/
package com.nextcloud.client.etm
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class EtmActivityTest : AbstractIT() {
private val testClassName = "com.nextcloud.client.etm.EtmActivityTest"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun overview() {
launchActivity<EtmActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "overview", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "overview", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun accounts() {
launchActivity<EtmActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.vm.onPageSelected(1)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "accounts", "")
onView(isRoot()).check(matches(isDisplayed()))
val screenShotName = createName(testClassName + "_" + "accounts", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
scenario.onActivity { sut ->
sut.vm.onPageSelected(1)
screenshotViaName(sut, screenShotName)
}
}
}
@@ -202,7 +202,7 @@ class TransferManagerConnectionTest {
connection.onServiceConnected(componentName, binder)
// WHEN
// is runnign flag accessed
// is running flag accessed
val isRunning = connection.isRunning
// THEN
@@ -0,0 +1,111 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.extensions
import android.graphics.Bitmap
import com.nextcloud.utils.decodeSampledBitmapFromFile
import com.nextcloud.utils.extensions.toFile
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import java.io.OutputStream
import java.nio.file.Files
import java.nio.file.Path
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.absolutePathString
import kotlin.io.path.deleteRecursively
import kotlin.io.path.exists
@Suppress("MagicNumber")
class BitmapDecodeTests {
private lateinit var tempDir: Path
@Before
fun setup() {
tempDir = Files.createTempDirectory("auto_upload_test_")
assertTrue("Temp directory should exist", tempDir.exists())
}
@OptIn(ExperimentalPathApi::class)
@After
fun cleanup() {
if (tempDir.exists()) {
tempDir.deleteRecursively()
}
}
private fun createTempImageFile(width: Int = 100, height: Int = 100): Path {
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
val imagePath = tempDir.resolve("test_${System.currentTimeMillis()}.jpg")
Files.newOutputStream(imagePath).use { out: OutputStream ->
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out)
}
assertTrue(imagePath.exists())
return imagePath
}
@Test
fun testToFileWhenPathIsValidShouldReturnExistingFile() {
val path = createTempImageFile()
val result = path.absolutePathString().toFile()
assertNotNull(result)
assertTrue(result!!.exists())
}
@Test
fun testToFileWhenPathIsEmptyShouldReturnNull() {
val result = "".toFile()
assertNull(result)
}
@Test
fun testToFileWhenFileDoesNotExistShouldReturnNull() {
val nonExistentPath = tempDir.resolve("does_not_exist.jpg")
val result = nonExistentPath.absolutePathString().toFile()
assertNull(result)
}
@Test
fun testDecodeSampledBitmapFromFileWhenValidPathShouldReturnBitmap() {
val path = createTempImageFile(400, 400)
val bitmap = decodeSampledBitmapFromFile(path.absolutePathString(), 100, 100)
assertNotNull(bitmap)
assertTrue(bitmap!!.width <= 400)
assertTrue(bitmap.height <= 400)
}
@Test
fun testDecodeSampledBitmapFromFileWhenInvalidPathShouldReturnNull() {
val invalidPath = tempDir.resolve("invalid_path.jpg").absolutePathString()
val bitmap = decodeSampledBitmapFromFile(invalidPath, 100, 100)
assertNull(bitmap)
}
@Test
fun testDecodeSampledBitmapFromFileWhenImageIsLargeShouldDownsampleBitmap() {
val path = createTempImageFile(2000, 2000)
val bitmap = decodeSampledBitmapFromFile(path.absolutePathString(), 100, 100)
assertNotNull(bitmap)
assertTrue("Bitmap should be smaller than original", bitmap!!.width < 2000 && bitmap.height < 2000)
}
@Test
fun testDecodeSampledBitmapFromFileWhenImageIsSmallerThanRequestedShouldKeepOriginalSize() {
val path = createTempImageFile(100, 100)
val bitmap = decodeSampledBitmapFromFile(path.absolutePathString(), 200, 200)
assertNotNull(bitmap)
assertEquals(100, bitmap!!.width)
assertEquals(100, bitmap.height)
}
}
@@ -0,0 +1,90 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.extensions
import android.graphics.Bitmap
import android.graphics.Color
import androidx.exifinterface.media.ExifInterface
import com.nextcloud.utils.rotateBitmapViaExif
import junit.framework.TestCase.assertEquals
import org.junit.Test
class BitmapRotationTests {
private fun createTestBitmap(): Bitmap = Bitmap.createBitmap(2, 2, Bitmap.Config.ARGB_8888).apply {
setPixel(0, 0, Color.RED)
setPixel(1, 0, Color.GREEN)
setPixel(0, 1, Color.BLUE)
setPixel(1, 1, Color.YELLOW)
}
@Test
fun testRotateBitmapViaExifWhenGivenNullBitmapShouldReturnNull() {
val rotated = null.rotateBitmapViaExif(ExifInterface.ORIENTATION_ROTATE_90)
assertEquals(null, rotated)
}
@Test
fun testRotateBitmapViaExifWhenGivenNormalOrientationShouldReturnSameBitmap() {
val bmp = createTestBitmap()
val rotated = bmp.rotateBitmapViaExif(ExifInterface.ORIENTATION_NORMAL)
assertEquals(bmp, rotated)
}
@Test
fun testRotateBitmapViaExifWhenGivenRotate90ShouldReturnRotatedBitmap() {
val bmp = createTestBitmap()
val rotated = bmp.rotateBitmapViaExif(ExifInterface.ORIENTATION_ROTATE_90)!!
assertEquals(bmp.width, rotated.height)
assertEquals(bmp.height, rotated.width)
assertEquals(Color.BLUE, rotated.getPixel(0, 0))
assertEquals(Color.RED, rotated.getPixel(1, 0))
assertEquals(Color.YELLOW, rotated.getPixel(0, 1))
assertEquals(Color.GREEN, rotated.getPixel(1, 1))
}
@Test
fun testRotateBitmapViaExifWhenGivenRotate180ShouldReturnRotatedBitmap() {
val bmp = createTestBitmap()
val rotated = bmp.rotateBitmapViaExif(ExifInterface.ORIENTATION_ROTATE_180)!!
assertEquals(bmp.width, rotated.width)
assertEquals(bmp.height, rotated.height)
assertEquals(Color.YELLOW, rotated.getPixel(0, 0))
assertEquals(Color.BLUE, rotated.getPixel(1, 0))
assertEquals(Color.GREEN, rotated.getPixel(0, 1))
assertEquals(Color.RED, rotated.getPixel(1, 1))
}
@Test
fun testRotateBitmapViaExifWhenGivenFlipHorizontalShouldReturnFlippedBitmap() {
val bmp = createTestBitmap()
val rotated = bmp.rotateBitmapViaExif(ExifInterface.ORIENTATION_FLIP_HORIZONTAL)!!
assertEquals(bmp.width, rotated.width)
assertEquals(bmp.height, rotated.height)
assertEquals(Color.GREEN, rotated.getPixel(0, 0))
assertEquals(Color.RED, rotated.getPixel(1, 0))
assertEquals(Color.YELLOW, rotated.getPixel(0, 1))
assertEquals(Color.BLUE, rotated.getPixel(1, 1))
}
@Test
fun testRotateBitmapViaExifWhenGivenFlipVerticalShouldReturnFlippedBitmap() {
val bmp = createTestBitmap()
val rotated = bmp.rotateBitmapViaExif(ExifInterface.ORIENTATION_FLIP_VERTICAL)!!
assertEquals(bmp.width, rotated.width)
assertEquals(bmp.height, rotated.height)
assertEquals(Color.BLUE, rotated.getPixel(0, 0))
assertEquals(Color.YELLOW, rotated.getPixel(1, 0))
assertEquals(Color.RED, rotated.getPixel(0, 1))
assertEquals(Color.GREEN, rotated.getPixel(1, 1))
}
}
@@ -0,0 +1,78 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.extensions
import android.graphics.Bitmap
import android.graphics.Color
import androidx.exifinterface.media.ExifInterface
import com.nextcloud.utils.extensions.getExifOrientation
import junit.framework.TestCase.assertEquals
import org.junit.After
import org.junit.Test
import java.io.File
class GetExifOrientationTests {
private val tempFiles = mutableListOf<File>()
@Suppress("MagicNumber")
private fun createTempImageFile(): File {
val file = File.createTempFile("test_image", ".jpg")
tempFiles.add(file)
val bmp = Bitmap.createBitmap(2, 2, Bitmap.Config.ARGB_8888).apply {
setPixel(0, 0, Color.RED)
setPixel(1, 0, Color.GREEN)
setPixel(0, 1, Color.BLUE)
setPixel(1, 1, Color.YELLOW)
}
file.outputStream().use { out ->
bmp.compress(Bitmap.CompressFormat.JPEG, 100, out)
}
return file
}
@After
fun cleanup() {
tempFiles.forEach { it.delete() }
}
@Test
fun testGetExifOrientationWhenExifIsRotate90ShouldReturnRotate90() {
val file = createTempImageFile()
val exif = ExifInterface(file.absolutePath)
exif.setAttribute(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_ROTATE_90.toString())
exif.saveAttributes()
val orientation = getExifOrientation(file.absolutePath)
assertEquals(ExifInterface.ORIENTATION_ROTATE_90, orientation)
}
@Test
fun testGetExifOrientationWhenExifIsRotate180ShouldReturnRotate180() {
val file = createTempImageFile()
val exif = ExifInterface(file.absolutePath)
exif.setAttribute(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_ROTATE_180.toString())
exif.saveAttributes()
val orientation = getExifOrientation(file.absolutePath)
assertEquals(ExifInterface.ORIENTATION_ROTATE_180, orientation)
}
@Test
fun testGetExifOrientationWhenExifIsUndefinedShouldReturnUndefined() {
val file = createTempImageFile()
val orientation = getExifOrientation(file.absolutePath)
assertEquals(ExifInterface.ORIENTATION_UNDEFINED, orientation)
}
}
@@ -6,7 +6,7 @@
*/
package com.nextcloud.extensions
import com.nextcloud.utils.extensions.isNotBlankAndEquals
import com.nextcloud.utils.extensions.eTagChanged
import junit.framework.TestCase.assertFalse
import junit.framework.TestCase.assertTrue
import org.junit.Test
@@ -17,160 +17,160 @@ class StringExtensionTests {
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreNull() {
val str1: String? = null
val str2: String? = null
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenFirstStringIsNull() {
val str1: String? = null
val str2 = "hello"
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenSecondStringIsNull() {
val str1 = "hello"
val str2: String? = null
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreEmpty() {
val str1 = ""
val str2 = ""
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenFirstStringIsEmpty() {
val str1 = ""
val str2 = "hello"
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenSecondStringIsEmpty() {
val str1 = "hello"
val str2 = ""
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreWhitespaceOnly() {
val str1 = " "
val str2 = " \t "
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenFirstStringIsWhitespaceOnly() {
val str1 = " "
val str2 = "hello"
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenSecondStringIsWhitespaceOnly() {
val str1 = "hello"
val str2 = " "
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenStringsAreDifferentButBothValid() {
val str1 = "hello"
val str2 = "world"
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenStringsHaveDifferentCase() {
val str1 = "Hello"
val str2 = "hello"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenMixedCaseStrings() {
val str1 = "HeLLo WoRLd"
val str2 = "hello world"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenUppercaseStrings() {
val str1 = "HELLO"
val str2 = "hello"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreIdenticalAndValid() {
val str1 = "hello"
val str2 = "hello"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreIdenticalWithSpaces() {
val str1 = "hello world"
val str2 = "hello world"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreIdenticalSingleCharacter() {
val str1 = "a"
val str2 = "A"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreIdenticalWithSpecialCharacters() {
val str1 = "hello@world!123"
val str2 = "HELLO@WORLD!123"
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenOneHasLeadingWhitespaceAndOtherDoesNot() {
val str1 = " hello"
val str2 = "HELLO"
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenOneHasTrailingWhitespaceAndOtherDoesNot() {
val str1 = "hello"
val str2 = "HELLO "
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenBothHaveIdenticalWhitespacePaddingDifferentCase() {
val str1 = " hello "
val str2 = " HELLO "
assertTrue(str1.isNotBlankAndEquals(str2))
assertFalse(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenMixedWhitespaceCharacters() {
val str1 = "\t"
val str2 = "\n"
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenOneIsNullAndOtherIsEmpty() {
val str1: String? = null
val str2 = ""
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
@Test
fun testIsNotBlankAndEqualsWhenGivenOneIsNullAndOtherIsWhitespace() {
val str1: String? = null
val str2 = " "
assertFalse(str1.isNotBlankAndEquals(str2))
assertTrue(str1.eTagChanged(str2))
}
}
@@ -11,10 +11,8 @@ package com.nextcloud.ui
import android.graphics.BitmapFactory
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -22,58 +20,43 @@ import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.utils.BitmapUtils
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class BitmapIT : AbstractIT() {
private val testClassName = "com.nextcloud.ui.BitmapIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun roundBitmap() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val file = getFile("christine.jpg")
val bitmap = BitmapFactory.decodeFile(file.absolutePath)
val file = getFile("christine.jpg")
val bitmap = BitmapFactory.decodeFile(file.absolutePath)
val imageView = ImageView(activity).apply {
setImageBitmap(bitmap)
}
val bitmap2 = BitmapFactory.decodeFile(file.absolutePath)
val imageView2 = ImageView(activity).apply {
setImageBitmap(BitmapUtils.roundBitmap(bitmap2))
}
val linearLayout = LinearLayout(activity).apply {
orientation = LinearLayout.VERTICAL
setBackgroundColor(context.getColor(R.color.grey_200))
}
linearLayout.addView(imageView, 200, 200)
linearLayout.addView(imageView2, 200, 200)
activity.addView(linearLayout)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "roundBitmap", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
val imageView = ImageView(activity).apply {
setImageBitmap(bitmap)
}
val bitmap2 = BitmapFactory.decodeFile(file.absolutePath)
val imageView2 = ImageView(activity).apply {
setImageBitmap(BitmapUtils.roundBitmap(bitmap2))
}
val linearLayout = LinearLayout(activity).apply {
orientation = LinearLayout.VERTICAL
setBackgroundColor(context.getColor(R.color.grey_200))
}
linearLayout.addView(imageView, 200, 200)
linearLayout.addView(imageView2, 200, 200)
activity.addView(linearLayout)
}
val screenShotName = createName(testClassName + "_" + "roundBitmap", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { activity ->
screenshotViaName(activity, screenShotName)
}
}
}
@@ -8,48 +8,43 @@
*/
package com.nextcloud.ui
import androidx.annotation.UiThread
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.rule.GrantPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.lib.resources.users.Status
import com.owncloud.android.lib.resources.users.StatusType
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.utils.EspressoIdlingResource
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
class SetOnlineStatusBottomSheetIT : AbstractIT() {
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@Test
@UiThread
fun open() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = SetOnlineStatusBottomSheet(
Status(StatusType.DND, "Working hard…", "🤖", -1)
)
sut.show(activity.supportFragmentManager, "")
EspressoIdlingResource.decrement()
onView(isRoot()).check(matches(isDisplayed()))
onView(isRoot()).check(matches(isDisplayed()))
}
onView(withId(R.id.clearStatusAfterSpinner))
.check(matches(isDisplayed()))
scenario.onActivity { activity ->
val sut = SetOnlineStatusBottomSheet(
Status(StatusType.DND, "Working hard…", "🤖", -1)
)
sut.show(activity.supportFragmentManager, "")
}
}
}
@@ -8,60 +8,49 @@
*/
package com.nextcloud.ui
import androidx.annotation.UiThread
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.rule.GrantPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.users.ClearAt
import com.owncloud.android.lib.resources.users.PredefinedStatus
import com.owncloud.android.lib.resources.users.Status
import com.owncloud.android.lib.resources.users.StatusType
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.utils.EspressoIdlingResource
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
class SetStatusMessageBottomSheetIT : AbstractIT() {
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@Test
@UiThread
fun open() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = SetStatusMessageBottomSheet(
user,
Status(StatusType.DND, "Working hard…", "🤖", -1)
)
sut.show(activity.supportFragmentManager, "")
val predefinedStatus: ArrayList<PredefinedStatus> = arrayListOf(
PredefinedStatus("meeting", "📅", "In a meeting", ClearAt("period", "3600")),
PredefinedStatus("commuting", "🚌", "Commuting", ClearAt("period", "1800")),
PredefinedStatus("be-right-back", "⏳", "Be right back", ClearAt("period", "900")),
PredefinedStatus("remote-work", "🏡", "Working remotely", ClearAt("end-of", "day")),
PredefinedStatus("sick-leave", "🤒", "Out sick", ClearAt("end-of", "day")),
PredefinedStatus("vacationing", "🌴", "Vacationing", null)
)
sut.setPredefinedStatus(predefinedStatus)
EspressoIdlingResource.decrement()
onView(isRoot()).check(matches(isDisplayed()))
onView(isRoot()).check(matches(isDisplayed()))
}
scenario.onActivity { activity ->
val sut = SetStatusMessageBottomSheet(
user,
Status(StatusType.DND, "Working hard…", "🤖", -1)
)
sut.show(activity.supportFragmentManager, "")
val predefinedStatus: ArrayList<PredefinedStatus> = arrayListOf(
PredefinedStatus("meeting", "📅", "In a meeting", ClearAt("period", "3600")),
PredefinedStatus("commuting", "🚌", "Commuting", ClearAt("period", "1800")),
PredefinedStatus("be-right-back", "⏳", "Be right back", ClearAt("period", "900")),
PredefinedStatus("remote-work", "🏡", "Working remotely", ClearAt("end-of", "day")),
PredefinedStatus("sick-leave", "🤒", "Out sick", ClearAt("end-of", "day")),
PredefinedStatus("vacationing", "🌴", "Vacationing", null)
)
sut.setPredefinedStatus(predefinedStatus)
}
}
}
@@ -10,6 +10,7 @@ package com.nextcloud.utils
import com.nextcloud.utils.autoRename.AutoRename
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.datamodel.e2e.v2.decrypted.DecryptedFile
import com.owncloud.android.lib.resources.status.CapabilityBooleanType
import com.owncloud.android.lib.resources.status.NextcloudVersion
import com.owncloud.android.lib.resources.status.OCCapability
import org.junit.Before
@@ -27,6 +28,7 @@ class AutoRenameTests : AbstractOnServerIT() {
testOnlyOnServer(NextcloudVersion.nextcloud_30)
capability = capability.apply {
isWCFEnabled = CapabilityBooleanType.TRUE
forbiddenFilenameExtensionJson = listOf(
"""[" ",".",".part",".part"]""",
"""[".",".part",".part"," "]""",
@@ -238,4 +240,14 @@ class AutoRenameTests : AbstractOnServerIT() {
val expectedFilename = "Foo.Bar.Baz"
assert(result == expectedFilename) { "Expected $expectedFilename but got $result" }
}
@Test
fun skipAutoRenameWhenWCFDisabled() {
capability = capability.apply {
isWCFEnabled = CapabilityBooleanType.FALSE
}
val filename = " readme.txt "
val result = AutoRename.rename(filename, capability, isFolderPath = true)
assert(result == filename) { "Expected $filename but got $result" }
}
}
@@ -0,0 +1,63 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.utils
import com.nextcloud.utils.extensions.checkWCFRestrictions
import com.owncloud.android.lib.resources.status.CapabilityBooleanType
import com.owncloud.android.lib.resources.status.NextcloudVersion
import com.owncloud.android.lib.resources.status.OCCapability
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
@Suppress("MagicNumber")
class CheckWCFRestrictionsTests {
private fun createCapability(
version: NextcloudVersion,
isWCFEnabled: CapabilityBooleanType = CapabilityBooleanType.UNKNOWN
): OCCapability = OCCapability().apply {
this.versionMayor = version.majorVersionNumber
this.isWCFEnabled = isWCFEnabled
}
@Test
fun testReturnsFalseForVersionsOlderThan30() {
val capability = createCapability(NextcloudVersion.nextcloud_29)
assertFalse(capability.checkWCFRestrictions())
}
@Test
fun testReturnsTrueForVersion30WhenWCFAlwaysEnabled() {
val capability = createCapability(NextcloudVersion.nextcloud_30)
assertTrue(capability.checkWCFRestrictions())
}
@Test
fun testReturnsTrueForVersion31WhenWCFAlwaysEnabled() {
val capability = createCapability(NextcloudVersion.nextcloud_31)
assertTrue(capability.checkWCFRestrictions())
}
@Test
fun testReturnsTrueForVersion32WhenWCFEnabled() {
val capability = createCapability(NextcloudVersion.nextcloud_32, CapabilityBooleanType.TRUE)
assertTrue(capability.checkWCFRestrictions())
}
@Test
fun testReturnsFalseForVersion32WhenWCFDisabled() {
val capability = createCapability(NextcloudVersion.nextcloud_32, CapabilityBooleanType.FALSE)
assertFalse(capability.checkWCFRestrictions())
}
@Test
fun testReturnsFalseForVersion32WhenWCFIsUnknown() {
val capability = createCapability(NextcloudVersion.nextcloud_32)
assertFalse(capability.checkWCFRestrictions())
}
}
@@ -0,0 +1,204 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.utils
import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertTrue
import org.junit.After
import org.junit.Before
import org.junit.Test
import java.io.File
import java.nio.file.Files
@Suppress("TooManyFunctions")
class FileHelperTest {
private lateinit var testDirectory: File
@Before
fun setup() {
testDirectory = Files.createTempDirectory("test").toFile()
}
@After
fun tearDown() {
testDirectory.deleteRecursively()
}
@Test
fun testListDirectoryEntriesWhenGivenNullDirectoryShouldReturnEmptyList() {
val result = FileHelper.listDirectoryEntries(null, 0, 10, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenNonExistentDirectoryShouldReturnEmptyList() {
val nonExistent = File(testDirectory, "does_not_exist")
val result = FileHelper.listDirectoryEntries(nonExistent, 0, 10, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenFileInsteadOfDirectoryShouldReturnEmptyList() {
val file = File(testDirectory, "test.txt")
file.createNewFile()
val result = FileHelper.listDirectoryEntries(file, 0, 10, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenEmptyDirectoryShouldReturnEmptyList() {
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenFetchingFoldersShouldReturnOnlyFolders() {
File(testDirectory, "folder1").mkdir()
File(testDirectory, "folder2").mkdir()
File(testDirectory, "file1.txt").createNewFile()
File(testDirectory, "file2.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, true)
assertEquals(2, result.size)
assertTrue(result.all { it.isDirectory })
}
@Test
fun testListDirectoryEntriesWhenFetchingFilesShouldReturnOnlyFiles() {
File(testDirectory, "folder1").mkdir()
File(testDirectory, "folder2").mkdir()
File(testDirectory, "file1.txt").createNewFile()
File(testDirectory, "file2.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
assertEquals(2, result.size)
assertTrue(result.all { it.isFile })
}
@Test
fun testListDirectoryEntriesWhenStartIndexProvidedShouldSkipCorrectNumberOfItems() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 2, 10, false)
assertEquals(3, result.size)
}
@Test
fun testListDirectoryEntriesWhenMaxItemsProvidedShouldLimitResults() {
for (i in 1..10) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 5, false)
assertEquals(5, result.size)
}
@Test
fun testListDirectoryEntriesWhenGivenStartIndexAndMaxItemsShouldReturnCorrectSubset() {
for (i in 1..10) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 3, 4, false)
assertEquals(4, result.size)
}
@Test
fun testListDirectoryEntriesWhenStartIndexBeyondAvailableShouldReturnEmptyList() {
for (i in 1..3) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 10, 5, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenMaxItemsBeyondAvailableShouldReturnAllItems() {
for (i in 1..3) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 100, false)
assertEquals(3, result.size)
}
@Test
fun testListDirectoryEntriesWhenFetchingFoldersWithOffsetShouldSkipCorrectly() {
for (i in 1..5) File(testDirectory, "folder$i").mkdir()
for (i in 1..3) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 2, 10, true)
assertEquals(3, result.size)
assertTrue(result.all { it.isDirectory })
}
@Test
fun testListDirectoryEntriesWhenFetchingFilesWithOffsetShouldSkipCorrectly() {
for (i in 1..3) File(testDirectory, "folder$i").mkdir()
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 2, 10, false)
assertEquals(3, result.size)
assertTrue(result.all { it.isFile })
}
@Test
fun testListDirectoryEntriesWhenGivenOnlyFoldersAndFetchingFilesShouldReturnEmptyList() {
for (i in 1..5) File(testDirectory, "folder$i").mkdir()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenOnlyFilesAndFetchingFoldersShouldReturnEmptyList() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 10, true)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenMaxItemsIsZeroShouldReturnEmptyList() {
for (i in 1..5) File(testDirectory, "file$i.txt").createNewFile()
val result = FileHelper.listDirectoryEntries(testDirectory, 0, 0, false)
assertTrue(result.isEmpty())
}
@Test
fun testListDirectoryEntriesWhenGivenMixedContentShouldFilterCorrectly() {
for (i in 1..3) File(testDirectory, "folder$i").mkdir()
for (i in 1..7) File(testDirectory, "file$i.txt").createNewFile()
val folders = FileHelper.listDirectoryEntries(testDirectory, 0, 10, true)
val files = FileHelper.listDirectoryEntries(testDirectory, 0, 10, false)
assertEquals(3, folders.size)
assertEquals(7, files.size)
assertTrue(folders.all { it.isDirectory })
assertTrue(files.all { it.isFile })
}
@Test
fun testListDirectoryEntriesWhenPaginatingFoldersShouldWorkCorrectly() {
for (i in 1..10) File(testDirectory, "folder$i").mkdir()
val page1 = FileHelper.listDirectoryEntries(testDirectory, 0, 3, true)
val page2 = FileHelper.listDirectoryEntries(testDirectory, 3, 3, true)
val page3 = FileHelper.listDirectoryEntries(testDirectory, 6, 3, true)
val page4 = FileHelper.listDirectoryEntries(testDirectory, 9, 3, true)
assertEquals(3, page1.size)
assertEquals(3, page2.size)
assertEquals(3, page3.size)
assertEquals(1, page4.size)
}
@Test
fun testListDirectoryEntriesWhenPaginatingFilesShouldWorkCorrectly() {
for (i in 1..10) File(testDirectory, "file$i.txt").createNewFile()
val page1 = FileHelper.listDirectoryEntries(testDirectory, 0, 4, false)
val page2 = FileHelper.listDirectoryEntries(testDirectory, 4, 4, false)
val page3 = FileHelper.listDirectoryEntries(testDirectory, 8, 4, false)
assertEquals(4, page1.size)
assertEquals(4, page2.size)
assertEquals(2, page3.size)
}
}
@@ -10,6 +10,7 @@ package com.nextcloud.utils
import com.nextcloud.utils.fileNameValidator.FileNameValidator
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.R
import com.owncloud.android.lib.resources.status.CapabilityBooleanType
import com.owncloud.android.lib.resources.status.NextcloudVersion
import com.owncloud.android.lib.resources.status.OCCapability
import org.junit.Assert.assertEquals
@@ -27,6 +28,7 @@ class FileNameValidatorTests : AbstractOnServerIT() {
@Before
fun setup() {
capability = capability.apply {
isWCFEnabled = CapabilityBooleanType.TRUE
forbiddenFilenamesJson = """[".htaccess",".htaccess"]"""
forbiddenFilenameBaseNamesJson = """
["con", "prn", "aux", "nul", "com0", "com1", "com2", "com3", "com4",
@@ -228,4 +230,14 @@ class FileNameValidatorTests : AbstractOnServerIT() {
val result = FileNameValidator.checkFolderAndFilePaths(folderPath, listOf(), capability, targetContext)
assertFalse(result)
}
@Test
fun skipValidationWhenWCFDisabled() {
capability = capability.apply {
isWCFEnabled = CapabilityBooleanType.FALSE
}
val filename = "abc.txt"
val result = FileNameValidator.checkFileName(filename, capability, targetContext)
assertNull(result)
}
}
@@ -6,10 +6,8 @@
*/
package com.nmc.android.ui
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
@@ -18,60 +16,37 @@ import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.utils.EspressoIdlingResource
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class LauncherActivityIT : AbstractIT() {
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
fun testSplashScreenWithEmptyTitlesShouldHideTitles() {
launchActivity<LauncherActivity>().use { scenario ->
scenario.onActivity { _ ->
onIdleSync {
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
onView(
withId(R.id.splashScreenBold)
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
onView(
withId(R.id.splashScreenNormal)
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
}
}
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
onView(
withId(R.id.splashScreenBold)
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
onView(
withId(R.id.splashScreenNormal)
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
}
}
@Test
@UiThread
fun testSplashScreenWithTitlesShouldShowTitles() {
launchActivity<LauncherActivity>().use { scenario ->
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
scenario.onActivity {
onIdleSync {
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
EspressoIdlingResource.increment()
it.setSplashTitles("Example", "Cloud")
EspressoIdlingResource.decrement()
val onePercentArea = ViewMatchers.isDisplayingAtLeast(1)
onView(withId(R.id.splashScreenBold)).check(matches(onePercentArea))
onView(withId(R.id.splashScreenNormal)).check(matches(onePercentArea))
}
it.setSplashTitles("Example", "Cloud")
}
val onePercentArea = ViewMatchers.isDisplayingAtLeast(1)
onView(withId(R.id.splashScreenBold)).check(matches(onePercentArea))
onView(withId(R.id.splashScreenNormal)).check(matches(onePercentArea))
}
}
}
@@ -13,6 +13,7 @@ import android.accounts.OperationCanceledException;
import android.content.ActivityNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;
@@ -6,11 +6,10 @@
*/
package com.owncloud.android
import androidx.annotation.UiThread
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.assertion.ViewAssertions.matches
@@ -19,17 +18,16 @@ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.rule.GrantPermissionRule
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.ui.activity.SettingsActivity
import com.owncloud.android.ui.activity.SyncedFoldersActivity
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.BeforeClass
import org.junit.ClassRule
import org.junit.Rule
import org.junit.Test
import tools.fastlane.screengrab.Screengrab
import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy
@@ -37,135 +35,91 @@ import tools.fastlane.screengrab.locale.LocaleTestRule
class ScreenshotsIT : AbstractIT() {
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@Test
@UiThread
@ScreenshotTest
fun gridViewScreenshot() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
onView(withId(R.id.switch_grid_view_button)).perform(click())
EspressoIdlingResource.decrement()
launchActivity<FileDisplayActivity>().use {
onView(withId(R.id.switch_grid_view_button)).perform(click())
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("01_gridView")
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("01_gridView")
// Switch back
onView(withId(R.id.switch_grid_view_button)).perform(click())
// Switch back
onView(withId(R.id.switch_grid_view_button)).perform(click())
assertTrue(true)
}
}
assertTrue(true)
}
}
@Test
@UiThread
@ScreenshotTest
fun listViewScreenshot() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val path = "/Camera/"
OCFile(path).apply {
storageManager.saveFile(this)
}
onView(withId(R.id.list_root)).perform(click())
EspressoIdlingResource.decrement()
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("02_listView")
assertTrue(true)
}
launchActivity<FileDisplayActivity>().use {
val path = "/Camera/"
OCFile(path).apply {
storageManager.saveFile(this)
}
onView(withId(R.id.list_root)).perform(click())
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("02_listView")
assertTrue(true)
}
}
@Test
@UiThread
@ScreenshotTest
fun drawerScreenshot() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
EspressoIdlingResource.decrement()
launchActivity<FileDisplayActivity>().use {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("03_drawer")
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("03_drawer")
onView(withId(R.id.drawer_layout)).perform(DrawerActions.close())
assertTrue(true)
}
}
onView(withId(R.id.drawer_layout)).perform(DrawerActions.close())
assertTrue(true)
}
}
@Test
@UiThread
@ScreenshotTest
fun multipleAccountsScreenshot() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
onView(withId(R.id.switch_account_button)).perform(click())
EspressoIdlingResource.decrement()
launchActivity<FileDisplayActivity>().use {
onView(withId(R.id.switch_account_button)).perform(click())
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("04_accounts")
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("04_accounts")
Espresso.pressBack()
assertTrue(true)
}
}
Espresso.pressBack()
assertTrue(true)
}
}
@Test
@UiThread
@ScreenshotTest
fun autoUploadScreenshot() {
launchActivity<SyncedFoldersActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("05_autoUpload")
assertTrue(true)
}
}
launchActivity<SyncedFoldersActivity>().use {
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("05_autoUpload")
assertTrue(true)
}
}
@Test
@UiThread
@ScreenshotTest
fun davdroidScreenshot() {
launchActivity<SettingsActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
onView(withText(R.string.prefs_category_more)).perform(scrollTo())
EspressoIdlingResource.decrement()
launchActivity<SettingsActivity>().use {
onView(withText(R.string.prefs_category_more)).perform(scrollTo())
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("06_davdroid")
assertTrue(true)
}
}
onView(isRoot()).check(matches(isDisplayed()))
Screengrab.screenshot("06_davdroid")
assertTrue(true)
}
}
@@ -9,9 +9,7 @@ package com.owncloud.android.datamodel
import android.content.ContentResolver
import android.net.Uri
import android.os.Build
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -60,20 +58,4 @@ class ContentResolverHelperIT {
null
)
}
@Test
@SdkSuppress(maxSdkVersion = Build.VERSION_CODES.N_MR1)
fun contentResolver_onAndroidBelow26_usesOldAPI() {
ContentResolverHelper
.queryResolver(resolver, URI, PROJECTION, SELECTION, null, SORT_COLUMN, SORT_DIRECTION, LIMIT)
verify(resolver).query(
eq(URI),
eq(PROJECTION),
eq(SELECTION),
eq(null),
eq("$SORT_COLUMN $SORT_DIRECTION LIMIT $LIMIT"),
eq(null)
)
}
}
@@ -18,6 +18,7 @@ import com.nextcloud.client.account.CurrentAccountProvider;
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;
import com.nextcloud.client.database.entity.UploadEntityKt;
import com.nextcloud.test.RandomStringGenerator;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.MainApp;
@@ -108,7 +109,7 @@ public class UploadStorageManagerTest extends AbstractIT {
OCUpload upload = createUpload(account);
uploads.add(upload);
uploadsStorageManager.storeUpload(upload);
uploadsStorageManager.uploadDao.insertOrReplace(UploadEntityKt.toUploadEntity(upload));
}
OCUpload[] storedUploads = uploadsStorageManager.getAllStoredUploads();
@@ -151,17 +152,14 @@ public class UploadStorageManagerTest extends AbstractIT {
account.name);
corruptUpload.setLocalPath(null);
uploadsStorageManager.storeUpload(corruptUpload);
uploadsStorageManager.uploadDao.insertOrReplace(UploadEntityKt.toUploadEntity(corruptUpload));
uploadsStorageManager.getAllStoredUploads();
}
@Test
public void getById() {
OCUpload upload = createUpload(account);
long id = uploadsStorageManager.storeUpload(upload);
long id = uploadsStorageManager.uploadDao.insertOrReplace(UploadEntityKt.toUploadEntity(upload));
OCUpload newUpload = uploadsStorageManager.getUploadById(id);
assertNotNull(newUpload);
@@ -178,7 +176,7 @@ public class UploadStorageManagerTest extends AbstractIT {
private void insertUploads(Account account, int rowsToInsert) {
for (int i = 0; i < rowsToInsert; i++) {
uploadsStorageManager.storeUpload(createUpload(account));
uploadsStorageManager.uploadDao.insertOrReplace(UploadEntityKt.toUploadEntity(createUpload(account)));
}
}
@@ -1,39 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.extensions
import android.app.Activity
import android.content.Intent
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.owncloud.android.AbstractIT
import com.owncloud.android.utils.EspressoIdlingResource
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
inline fun <reified T : Activity> AbstractIT.launchAndCapture(
testClassName: String,
actionName: String,
intent: Intent? = null,
crossinline before: (T) -> Unit
) {
launchActivity<T>(intent).use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
before(activity)
EspressoIdlingResource.decrement()
val screenshotName = createName(testClassName + "_" + actionName, "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenshotName)
}
}
}
}
@@ -324,7 +324,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
user,
null,
ocUpload2,
NameCollisionPolicy.CANCEL,
NameCollisionPolicy.SKIP,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
@@ -373,7 +373,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
user,
arrayOf(ocFile2),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
NameCollisionPolicy.CANCEL
NameCollisionPolicy.SKIP
)
shortSleep()
@@ -400,7 +400,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
user,
null,
ocUpload,
NameCollisionPolicy.CANCEL,
NameCollisionPolicy.SKIP,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
@@ -426,7 +426,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
user,
null,
ocUpload2,
NameCollisionPolicy.CANCEL,
NameCollisionPolicy.SKIP,
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
@@ -477,7 +477,7 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
user,
arrayOf(ocFile2),
FileUploadWorker.LOCAL_BEHAVIOUR_COPY,
NameCollisionPolicy.CANCEL
NameCollisionPolicy.SKIP
)
shortSleep()
@@ -0,0 +1,158 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.providers
import android.content.ContentValues
import android.content.ContentUris
import android.net.Uri
import androidx.sqlite.db.SimpleSQLiteQuery
import androidx.sqlite.db.SupportSQLiteDatabase
import com.owncloud.android.db.ProviderMeta
import io.mockk.Runs
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
@Suppress("MagicNumber")
class FileContentProviderTests {
private lateinit var provider: FileContentProvider
private lateinit var db: SupportSQLiteDatabase
@Before
fun setup() {
provider = FileContentProvider()
db = mockk()
}
@Test
fun insertNewFileShouldReturnNewId() {
val values = ContentValues().apply {
put(ProviderMeta.ProviderTableMeta.FILE_PATH, "/path/to/file.txt")
put(ProviderMeta.ProviderTableMeta.FILE_ACCOUNT_OWNER, "[email protected]")
}
// Mock insert to return new ID
every { db.insert(any(), any(), any()) } returns 42L
val result: Uri = provider.upsertSingleFile(
db,
ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE,
values
)
assertEquals(
ContentUris.withAppendedId(ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE, 42),
result
)
}
@Test
fun updateExistingFileShouldReturnSameId() {
val values = ContentValues().apply {
put(ProviderMeta.ProviderTableMeta.FILE_PATH, "/path/to/file.txt")
put(ProviderMeta.ProviderTableMeta.FILE_ACCOUNT_OWNER, "[email protected]")
}
// Simulate insert conflict
every { db.insert(ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME, any(), values) } returns -1L
// Simulate update returning 1 row affected
every {
db.update(
ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME,
any(),
values,
any(),
any()
)
} returns 1
// Mock cursor to return ID 99
val cursor = mockk<android.database.Cursor>()
every { cursor.moveToFirst() } returns true
every { cursor.getLong(0) } returns 99L
every { cursor.close() } just Runs
every { db.query(any<SimpleSQLiteQuery>()) } returns cursor
val result: Uri = provider.upsertSingleFile(
db,
ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE,
values
)
assertEquals(ContentUris.withAppendedId(ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE, 99), result)
cursor.close()
}
@Test
fun testConcurrentUpserts() = runBlocking {
val values = ContentValues().apply {
put(ProviderMeta.ProviderTableMeta.FILE_PATH, "/path/to/file.txt")
put(ProviderMeta.ProviderTableMeta.FILE_ACCOUNT_OWNER, "[email protected]")
}
// shared state to simulate race
val inserted = mutableListOf<Long>()
// mock insert: fail first call, succeed second
every { db.insert(any(), any(), any()) } answers {
synchronized(inserted) {
if (inserted.isEmpty()) {
// first thread "fails" insert which means already existing file id will be returned
inserted.add(-1L)
-1L
} else {
// second thread "succeeds" it will update existing one
inserted.add(42L)
42L
}
}
}
// mock update only one row should be affected
every { db.update(any(), any(), any(), any(), any()) } returns 1
// mock query existing file id will return 99
val cursor = mockk<android.database.Cursor>()
every { cursor.moveToFirst() } returns true
every { cursor.getLong(0) } returns 99L
every { cursor.close() } just Runs
every { db.query(any<SimpleSQLiteQuery>()) } returns cursor
// launch two coroutines simulating concurrent threads
val results = mutableListOf<Uri>()
coroutineScope {
val job1 =
async {
results.add(provider.upsertSingleFile(db, ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE, values))
}
val job2 =
async {
results.add(provider.upsertSingleFile(db, ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE, values))
}
awaitAll(job1, job2)
}
// both URIs should be correct (one updated, one inserted)
assertTrue(results.contains(ContentUris.withAppendedId(ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE, 99)))
assertTrue(results.contains(ContentUris.withAppendedId(ProviderMeta.ProviderTableMeta.CONTENT_URI_FILE, 42)))
cursor.close()
}
}
@@ -7,26 +7,19 @@
*/
package com.owncloud.android.providers
import androidx.annotation.UiThread
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.nextcloud.test.TestActivity
import com.owncloud.android.AbstractOnServerIT
import org.junit.Test
class UsersAndGroupsSearchProviderIT : AbstractOnServerIT() {
class UsersAndGroupsSearchProviderIT {
@Test
@UiThread
fun searchUser() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
onView(isRoot()).check(matches(isDisplayed()))
}
}
launchActivity<TestActivity>().use {
onView(isRoot()).check(matches(isDisplayed()))
}
}
}
@@ -9,7 +9,6 @@
package com.owncloud.android.ui.activity
import android.content.Intent
import androidx.annotation.UiThread
import androidx.fragment.app.DialogFragment
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
@@ -18,6 +17,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import com.nextcloud.client.account.UserAccountManagerImpl
import com.nextcloud.utils.extensions.getDecryptedPath
import com.owncloud.android.AbstractIT
@@ -25,6 +25,7 @@ import com.owncloud.android.R
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.db.OCUpload
import com.owncloud.android.ui.dialog.ConflictsResolveDialog
import com.owncloud.android.ui.dialog.ConflictsResolveDialog.Companion.newInstance
import com.owncloud.android.ui.dialog.ConflictsResolveDialog.Decision
import com.owncloud.android.ui.dialog.ConflictsResolveDialog.OnConflictDecisionMadeListener
@@ -42,7 +43,6 @@ class ConflictsResolveActivityIT : AbstractIT() {
private var returnCode = false
@Test
@UiThread
@ScreenshotTest
fun screenshotTextFiles() {
val newFile = OCFile("/newFile.txt").apply {
@@ -67,33 +67,33 @@ class ConflictsResolveActivityIT : AbstractIT() {
}
launchActivity<ConflictsResolveActivity>(intent).use { scenario ->
var dialog: ConflictsResolveDialog? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
dialog = newInstance(
storageManager.getDecryptedPath(existingFile),
targetContext,
newFile,
existingFile,
UserAccountManagerImpl
.fromContext(targetContext)
.getUser()
)
dialog.showDialog(sut)
}
val dialog = newInstance(
storageManager.getDecryptedPath(existingFile),
targetContext,
newFile,
existingFile,
UserAccountManagerImpl
.fromContext(targetContext)
.getUser()
)
dialog.showDialog(sut)
onView(withId(R.id.headline))
.check(matches(isDisplayed()))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "screenshotTextFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
val screenShotName = createName(testClassName + "_" + "screenshotTextFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(dialog.requireDialog().window?.decorView, screenShotName)
}
scenario.onActivity { sut ->
screenshotViaName(dialog!!.requireDialog().window?.decorView, screenShotName)
}
}
}
@Test
@UiThread
fun cancel() {
val newUpload = OCUpload(
FileStorageUtils.getSavePath(user.accountName) + "/nonEmpty.txt",
@@ -126,24 +126,19 @@ class ConflictsResolveActivityIT : AbstractIT() {
launchActivity<ConflictsResolveActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
returnCode = false
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.CANCEL)
returnCode = true
}
EspressoIdlingResource.decrement()
onView(ViewMatchers.withText("Cancel")).perform(ViewActions.click())
TestCase.assertTrue(returnCode)
returnCode = false
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.CANCEL)
returnCode = true
}
}
onView(ViewMatchers.withText("Cancel")).perform(ViewActions.click())
TestCase.assertTrue(returnCode)
}
}
@Test
@UiThread
@ScreenshotTest
fun keepExisting() {
returnCode = false
@@ -180,30 +175,29 @@ class ConflictsResolveActivityIT : AbstractIT() {
}
launchActivity<ConflictsResolveActivity>(intent).use { scenario ->
var activity: ConflictsResolveActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.KEEP_SERVER)
returnCode = true
}
EspressoIdlingResource.decrement()
onView(ViewMatchers.withId(R.id.right_checkbox)).perform(ViewActions.click())
val dialog = sut.supportFragmentManager.findFragmentByTag("conflictDialog") as DialogFragment?
val screenShotName = createName(testClassName + "_" + "keepExisting", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(dialog?.requireDialog()?.window?.decorView, screenShotName)
onView(ViewMatchers.withText("OK")).perform(ViewActions.click())
assertTrue(returnCode)
activity = sut
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.KEEP_SERVER)
returnCode = true
}
}
onView(withId(R.id.right_checkbox)).perform(ViewActions.click())
val dialog = activity!!.supportFragmentManager.findFragmentByTag("conflictDialog") as DialogFragment?
val screenShotName = createName(testClassName + "_" + "keepExisting", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(dialog?.requireDialog()?.window?.decorView, screenShotName)
onView(ViewMatchers.withText("OK")).perform(ViewActions.click())
assertTrue(returnCode)
}
}
@Test
@UiThread
@ScreenshotTest
fun keepNew() {
returnCode = false
@@ -235,31 +229,26 @@ class ConflictsResolveActivityIT : AbstractIT() {
intent.putExtra(ConflictsResolveActivity.EXTRA_CONFLICT_UPLOAD_ID, newUpload.uploadId)
launchActivity<ConflictsResolveActivity>(intent).use { scenario ->
var activity: ConflictsResolveActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.KEEP_LOCAL)
returnCode = true
}
EspressoIdlingResource.decrement()
onView(ViewMatchers.withId(R.id.left_checkbox)).perform(ViewActions.click())
val dialog = sut.supportFragmentManager.findFragmentByTag("conflictDialog") as DialogFragment?
val screenShotName = createName(testClassName + "_" + "keepNew", "")
screenshotViaName(dialog?.requireDialog()?.window?.decorView, screenShotName)
onView(ViewMatchers.withText("OK")).perform(ViewActions.click())
assertTrue(returnCode)
activity = sut
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.KEEP_LOCAL)
returnCode = true
}
}
onView(withId(R.id.left_checkbox)).perform(ViewActions.click())
val dialog = activity!!.supportFragmentManager.findFragmentByTag("conflictDialog") as DialogFragment?
val screenShotName = createName(testClassName + "_" + "keepNew", "")
screenshotViaName(dialog?.requireDialog()?.window?.decorView, screenShotName)
onView(ViewMatchers.withText("OK")).perform(ViewActions.click())
assertTrue(returnCode)
}
}
@Test
@UiThread
@ScreenshotTest
fun keepBoth() {
returnCode = false
@@ -293,29 +282,24 @@ class ConflictsResolveActivityIT : AbstractIT() {
}
launchActivity<ConflictsResolveActivity>(intent).use { scenario ->
var activity: ConflictsResolveActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.KEEP_BOTH)
returnCode = true
}
EspressoIdlingResource.decrement()
onView(ViewMatchers.withId(R.id.right_checkbox)).perform(ViewActions.click())
onView(ViewMatchers.withId(R.id.left_checkbox)).perform(ViewActions.click())
onView(ViewMatchers.withId(R.id.left_checkbox)).perform(ViewActions.click())
val dialog = sut.supportFragmentManager.findFragmentByTag("conflictDialog") as DialogFragment?
val screenShotName = createName(testClassName + "_" + "keepBoth", "")
screenshotViaName(dialog?.requireDialog()?.window?.decorView, screenShotName)
onView(ViewMatchers.withText("OK")).perform(ViewActions.click())
assertTrue(returnCode)
activity = sut
sut.listener = OnConflictDecisionMadeListener { decision: Decision? ->
assertEquals(decision, Decision.KEEP_BOTH)
returnCode = true
}
}
onView(withId(R.id.right_checkbox)).perform(ViewActions.click())
onView(withId(R.id.left_checkbox)).perform(ViewActions.click())
val dialog = activity!!.supportFragmentManager.findFragmentByTag("conflictDialog") as DialogFragment?
val screenShotName = createName(testClassName + "_" + "keepBoth", "")
screenshotViaName(dialog?.requireDialog()?.window?.decorView, screenShotName)
onView(ViewMatchers.withText("OK")).perform(ViewActions.click())
assertTrue(returnCode)
}
}
@@ -8,37 +8,21 @@
package com.owncloud.android.ui.activity
import android.content.Intent
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.datamodel.OCFile
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
class ContactsPreferenceActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.ContactsPreferenceActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun openVCF() {
val file = getFile("vcard.vcf")
@@ -53,27 +37,24 @@ class ContactsPreferenceActivityIT : AbstractIT() {
}
launchActivity<ContactsPreferenceActivity>(intent).use { scenario ->
val screenShotName = createName(testClassName + "_" + "openVCF", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "openVCF", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun openContactsPreference() {
launchActivity<ContactsPreferenceActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "openContactsPreference", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "openContactsPreference", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -8,16 +8,16 @@
*/
package com.owncloud.android.ui.activity
import android.Manifest
import android.accounts.Account
import android.accounts.AccountManager
import android.net.Uri
import android.view.View
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import com.nextcloud.client.account.User
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.account.UserAccountManagerImpl
@@ -26,7 +26,6 @@ import com.owncloud.android.AbstractIT
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.utils.EspressoIdlingResource
import org.hamcrest.Matchers
import org.junit.Assert
import org.junit.BeforeClass
@@ -39,32 +38,36 @@ class DrawerActivityIT : AbstractIT() {
@JvmField
val retryTestRule = RetryTestRule()
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@Test
@UiThread
fun switchAccountViaAccountList() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.setUser(user1)
Assert.assertEquals(account1, sut.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(
Matchers.anyOf<View?>(
ViewMatchers.withText(account2Name),
ViewMatchers.withText(
account2DisplayName
)
)
).perform(ViewActions.click())
Assert.assertEquals(account2, sut.user.get().toPlatformAccount())
EspressoIdlingResource.decrement()
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(ViewMatchers.withText(account1?.name)).perform(ViewActions.click())
}
var sut: FileDisplayActivity? = null
scenario.onActivity { activity ->
sut = activity
}
Assert.assertEquals(account1, sut!!.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(
Matchers.anyOf(
ViewMatchers.withText(account2Name),
ViewMatchers.withText(
account2DisplayName
)
)
).perform(ViewActions.click())
Assert.assertEquals(account2, sut.user.get().toPlatformAccount())
onView(ViewMatchers.withId(R.id.switch_account_button)).perform(ViewActions.click())
onView(ViewMatchers.withText(account1?.name)).perform(ViewActions.click())
}
}
@@ -27,8 +27,8 @@ public class FileDisplayActivityTest extends AbstractIT {
InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
Activity activity =
ActivityLifecycleMonitorRegistry.getInstance().getActivitiesInStage(RESUMED).iterator().next();
if (activity instanceof WhatsNewActivity) {
activity.onBackPressed();
if (activity instanceof WhatsNewActivity whatsNewActivity) {
whatsNewActivity.getOnBackPressedDispatcher().onBackPressed();
}
});
scenario.recreate();
@@ -10,10 +10,8 @@ package com.owncloud.android.ui.activity
import android.content.Intent
import android.view.View
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -21,11 +19,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -33,167 +28,133 @@ import org.junit.runner.RunWith
class FolderPickerActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.FolderPickerActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
fun getActivityFile() {
launchActivity<FolderPickerActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
val origin = OCFile("/test/file.test").apply {
remotePath = "/remotePath/test"
}
// Act
sut.file = origin
val target = sut.file
// Assert
assertEquals(origin, target)
}
val origin = OCFile("/test/file.test").apply {
remotePath = "/remotePath/test"
}
var target: OCFile? = null
scenario.onActivity { sut ->
sut.file = origin
target = sut.file
}
assertEquals(origin, target)
}
}
@Test
@UiThread
fun getParentFolder_isNotRootFolder() {
launchActivity<FolderPickerActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
// Arrange
val origin = OCFile("/test/").apply {
fileId = 1
remotePath = "/test/"
setStoragePath("/test/")
setFolder()
}
// Act
sut.file = origin
val target = sut.currentFolder
// Assert
assertEquals(origin, target)
}
val origin = OCFile("/test/").apply {
fileId = 1
remotePath = "/test/"
setStoragePath("/test/")
setFolder()
}
var target: OCFile? = null
scenario.onActivity { sut ->
sut.file = origin
target = sut.currentFolder
}
assertEquals(origin, target)
}
}
@Test
@UiThread
fun getParentFolder_isRootFolder() {
launchActivity<FolderPickerActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
// Arrange
val origin = OCFile("/").apply {
fileId = 1
remotePath = "/"
setStoragePath("/")
setFolder()
}
// Act
sut.file = origin
val target = sut.currentFolder
// Assert
assertEquals(origin, target)
}
val origin = OCFile("/").apply {
fileId = 1
remotePath = "/"
setStoragePath("/")
setFolder()
}
var target: OCFile? = null
scenario.onActivity { sut ->
sut.file = origin
target = sut.currentFolder
}
assertEquals(origin, target)
}
}
@Suppress("DEPRECATION")
@Test
@UiThread
fun nullFile() {
launchActivity<FolderPickerActivity>().use { scenario ->
var rootFolder: OCFile? = null
var target: OCFile? = null
scenario.onActivity { sut ->
onIdleSync {
// Arrange
val rootFolder = sut.storageManager.getFileByPath(OCFile.ROOT_PATH)
// Act
sut.file = null
val target = sut.currentFolder
// Assert
assertEquals(rootFolder, target)
}
rootFolder = sut.storageManager.getFileByPath(OCFile.ROOT_PATH)
sut.file = null
target = sut.currentFolder
}
assertEquals(rootFolder, target)
}
}
@Test
@UiThread
fun getParentFolder() {
launchActivity<FolderPickerActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
// Arrange
val origin = OCFile("/test/file.test").apply {
remotePath = "/test/file.test"
}
val target = OCFile("/test/")
// Act
sut.file = origin
// Assert
assertEquals(origin, target)
}
val origin = OCFile("/test/file.test").apply {
remotePath = "/test/file.test"
}
val target = OCFile("/test/")
scenario.onActivity { sut ->
sut.file = origin
}
assertEquals(origin, target)
}
}
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<FolderPickerActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
val origin = OCFile("/test/file.txt")
sut.file = origin
sut.findViewById<View>(R.id.folder_picker_btn_copy).requestFocus()
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
val origin = OCFile("/test/file.txt")
sut.file = origin
sut.findViewById<View>(R.id.folder_picker_btn_copy).requestFocus()
}
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun testMoveOrCopy() {
val intent = Intent(targetContext, FolderPickerActivity::class.java)
launchActivity<FolderPickerActivity>(intent).use { scenario ->
val screenShotName = createName(testClassName + "_" + "testMoveOrCopy", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "testMoveOrCopy", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun testChooseLocationAction() {
val intent = Intent(targetContext, FolderPickerActivity::class.java).apply {
@@ -201,12 +162,11 @@ class FolderPickerActivityIT : AbstractIT() {
}
launchActivity<FolderPickerActivity>(intent).use { scenario ->
val screenShotName = createName(testClassName + "_" + "testChooseLocationAction", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "testChooseLocationAction", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -8,81 +8,59 @@
*/
package com.owncloud.android.ui.activity
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.common.Quota
import com.owncloud.android.lib.common.UserInfo
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class ManageAccountsActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.ManageAccountsActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<ManageAccountsActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun userInfoDetail() {
launchActivity<ManageAccountsActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val user = sut.accountManager.user
val userInfo = UserInfo(
"test",
true,
"Test User",
"[email protected]",
"+49 123 456",
"Address 123, Berlin",
"https://www.nextcloud.com",
"https://twitter.com/Nextclouders",
Quota(),
ArrayList()
)
sut.showUser(user, userInfo)
}
val user = sut.accountManager.user
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
val userInfo = UserInfo(
"test",
true,
"Test User",
"[email protected]",
"+49 123 456",
"Address 123, Berlin",
"https://www.nextcloud.com",
"https://twitter.com/Nextclouders",
Quota(),
ArrayList()
)
EspressoIdlingResource.decrement()
sut.showUser(user, userInfo)
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(getCurrentActivity(), screenShotName)
}
scenario.onActivity {
screenshotViaName(getCurrentActivity(), screenShotName)
}
}
}
@@ -7,57 +7,40 @@
*/
package com.owncloud.android.ui.activity
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
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.After
import org.junit.Before
import org.junit.Test
import java.util.GregorianCalendar
class NotificationsActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.NotificationsActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun empty() {
launchActivity<NotificationsActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.populateList(ArrayList())
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "empty", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.populateList(ArrayList())
}
val screenShotName = createName(testClassName + "_" + "empty", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
@SuppressWarnings("MagicNumber")
fun showNotifications() {
@@ -141,32 +124,31 @@ class NotificationsActivityIT : AbstractIT() {
launchActivity<NotificationsActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.populateList(notifications)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showNotifications", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.populateList(notifications)
}
val screenShotName = createName(testClassName + "_" + "showNotifications", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun error() {
launchActivity<NotificationsActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.setEmptyContent("Error", "Error! Please try again later!")
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.setEmptyContent("Error", "Error! Please try again later!")
}
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@@ -9,36 +9,20 @@
package com.owncloud.android.ui.activity
import android.content.Intent
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class PassCodeActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.PassCodeActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun check() {
val intent = Intent(targetContext, PassCodeActivity::class.java).apply {
@@ -47,22 +31,21 @@ class PassCodeActivityIT : AbstractIT() {
launchActivity<PassCodeActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.binding.txt0.clearFocus()
Espresso.closeSoftKeyboard()
EspressoIdlingResource.decrement()
sut.binding.txt0.clearFocus()
}
val screenShotName = createName(testClassName + "_" + "check", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
Espresso.closeSoftKeyboard()
val screenShotName = createName(testClassName + "_" + "check", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun request() {
val intent = Intent(targetContext, PassCodeActivity::class.java).apply {
@@ -71,22 +54,21 @@ class PassCodeActivityIT : AbstractIT() {
launchActivity<PassCodeActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.binding.txt0.clearFocus()
Espresso.closeSoftKeyboard()
EspressoIdlingResource.decrement()
sut.binding.txt0.clearFocus()
}
val screenShotName = createName(testClassName + "_" + "request", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
Espresso.closeSoftKeyboard()
val screenShotName = createName(testClassName + "_" + "request", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun delete() {
val intent = Intent(targetContext, PassCodeActivity::class.java).apply {
@@ -95,16 +77,16 @@ class PassCodeActivityIT : AbstractIT() {
launchActivity<PassCodeActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.binding.txt0.clearFocus()
Espresso.closeSoftKeyboard()
EspressoIdlingResource.decrement()
sut.binding.txt0.clearFocus()
}
val screenShotName = createName(testClassName + "_" + "delete", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
Espresso.closeSoftKeyboard()
val screenShotName = createName(testClassName + "_" + "delete", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@@ -8,44 +8,27 @@
*/
package com.owncloud.android.ui.activity
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class ReceiveExternalFilesActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.ReceiveExternalFilesActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun open() {
launchActivity<ReceiveExternalFilesActivity>().use { scenario ->
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "open", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -9,16 +9,13 @@
package com.owncloud.android.ui.activity
import android.content.Intent
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
import com.owncloud.android.utils.FileStorageUtils
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
@@ -47,46 +44,31 @@ class UploadFilesActivityIT : AbstractIT() {
directories.forEach { it.deleteRecursively() }
}
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun noneSelected() {
launchActivity<UploadFilesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.fileListFragment.setFiles(
directories +
listOf(
File("1.txt"),
File("2.pdf"),
File("3.mp3")
)
)
}
sut.fileListFragment.setFiles(
directories +
listOf(
File("1.txt"),
File("2.pdf"),
File("3.mp3")
)
)
val screenShotName = createName(testClassName + "_" + "noneSelected", "")
onView(isRoot()).check(matches(isDisplayed()))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "noneSelected", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.fileListFragment.binding?.listRoot, screenShotName)
}
scenario.onActivity { sut ->
screenshotViaName(sut.fileListFragment.binding?.listRoot, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun localFolderPickerMode() {
val intent = Intent(targetContext, UploadFilesActivity::class.java).apply {
@@ -102,77 +84,65 @@ class UploadFilesActivityIT : AbstractIT() {
launchActivity<UploadFilesActivity>(intent).use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.fileListFragment.setFiles(
directories
)
}
sut.fileListFragment.setFiles(
directories
)
val screenShotName = createName(testClassName + "_" + "localFolderPickerMode", "")
onView(isRoot()).check(matches(isDisplayed()))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "localFolderPickerMode", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun search() {
launchActivity<UploadFilesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.fileListFragment.performSearch("1.txt", arrayListOf(), false)
sut.fileListFragment.setFiles(
directories +
listOf(
File("1.txt"),
File("2.pdf"),
File("3.mp3")
)
)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "search", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
}
}
@Test
@UiThread
@ScreenshotTest
fun selectAll() {
launchActivity<UploadFilesActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.fileListFragment.setFiles(
sut.fileListFragment.performSearch("1.txt", arrayListOf(), false)
sut.fileListFragment.setFiles(
directories +
listOf(
File("1.txt"),
File("2.pdf"),
File("3.mp3")
)
)
}
val screenShotName = createName(testClassName + "_" + "search", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@ScreenshotTest
fun selectAll() {
launchActivity<UploadFilesActivity>().use { scenario ->
scenario.onActivity { sut ->
sut.fileListFragment.setFiles(
listOf(
File("1.txt"),
File("2.pdf"),
File("3.mp3")
)
)
sut.fileListFragment.selectAllFiles(true)
}
sut.fileListFragment.selectAllFiles(true)
val screenShotName = createName(testClassName + "_" + "selectAll", "")
onView(isRoot()).check(matches(isDisplayed()))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "selectAll", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.fileListFragment.binding?.listRoot, screenShotName)
}
scenario.onActivity { sut ->
screenshotViaName(sut.fileListFragment.binding?.listRoot, screenShotName)
}
}
}
@@ -8,36 +8,20 @@
package com.owncloud.android.ui.activity
import android.content.Intent
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.common.UserInfo
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class UserInfoActivityIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.activity.UserInfoActivityIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun fullUserInfoDetail() {
val intent = Intent(targetContext, UserInfoActivity::class.java).apply {
@@ -59,12 +43,11 @@ class UserInfoActivityIT : AbstractIT() {
}
launchActivity<UserInfoActivity>(intent).use { scenario ->
val screenShotName = createName(testClassName + "_" + "fullUserInfoDetail", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "fullUserInfoDetail", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -8,6 +8,7 @@
*/
package com.owncloud.android.ui.dialog
import android.Manifest
import android.accounts.Account
import android.accounts.AccountManager
import android.app.Dialog
@@ -19,15 +20,14 @@ import android.view.ViewGroup
import android.webkit.SslErrorHandler
import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContract
import androidx.annotation.UiThread
import androidx.fragment.app.DialogFragment
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.rule.GrantPermissionRule
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
@@ -38,6 +38,7 @@ import com.nextcloud.client.account.RegisteredUser
import com.nextcloud.client.account.Server
import com.nextcloud.client.device.DeviceInfo
import com.nextcloud.client.documentscan.AppScanOptionalFeature
import com.nextcloud.ui.ChooseAccountDialogFragment
import com.nextcloud.ui.ChooseAccountDialogFragment.Companion.newInstance
import com.nextcloud.ui.SetOnlineStatusBottomSheet
import com.nextcloud.ui.fileactions.FileActionsBottomSheet.Companion.newInstance
@@ -66,18 +67,16 @@ import com.owncloud.android.ui.dialog.LoadingDialog.Companion.newInstance
import com.owncloud.android.ui.dialog.RenameFileDialogFragment.Companion.newInstance
import com.owncloud.android.ui.dialog.SharePasswordDialogFragment.Companion.newInstance
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.Companion.newInstanceForEmptySslError
import com.owncloud.android.ui.dialog.StoragePermissionDialogFragment.Companion.newInstance
import com.owncloud.android.ui.fragment.OCFileListBottomSheetActions
import com.owncloud.android.ui.fragment.OCFileListBottomSheetDialog
import com.owncloud.android.ui.fragment.ProfileBottomSheetDialog
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.MimeTypeUtil
import com.owncloud.android.utils.ScreenshotTest
import com.owncloud.android.utils.theme.CapabilityUtils
import com.owncloud.android.utils.theme.ViewThemeUtils
import io.mockk.mockk
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import java.net.URI
import java.util.function.Supplier
@@ -87,15 +86,11 @@ class DialogFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.dialog.DialogFragmentIT"
private val serverUrl = "https://nextcloud.localhost"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@After
fun quitLooperIfNeeded() {
@@ -103,7 +98,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testRenameFileDialog() {
if (Looper.myLooper() == null) {
@@ -119,7 +113,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testLoadingDialog() {
newInstance("Wait…").run {
@@ -128,14 +121,13 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testConfirmationDialogWithOneAction() {
ConfirmationDialogFragment.newInstance(
R.string.upload_list_empty_text_auto_upload,
arrayOf(),
R.string.filedetails_sync_file,
R.string.common_ok,
R.drawable.ic_warning,
-1,
-1,
-1
@@ -145,14 +137,13 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testConfirmationDialogWithTwoAction() {
ConfirmationDialogFragment.newInstance(
R.string.upload_list_empty_text_auto_upload,
arrayOf(),
R.string.filedetails_sync_file,
R.string.common_ok,
R.drawable.ic_warning,
R.string.common_cancel,
-1,
-1
@@ -162,14 +153,13 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testConfirmationDialogWithThreeAction() {
ConfirmationDialogFragment.newInstance(
R.string.upload_list_empty_text_auto_upload,
arrayOf(),
R.string.filedetails_sync_file,
R.string.common_ok,
R.drawable.ic_warning,
R.string.common_cancel,
R.string.common_confirm,
-1
@@ -179,7 +169,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testConfirmationDialogWithThreeActionRTL() {
enableRTL()
@@ -187,7 +176,7 @@ class DialogFragmentIT : AbstractIT() {
R.string.upload_list_empty_text_auto_upload,
arrayOf(),
-1,
R.string.common_ok,
R.drawable.ic_warning,
R.string.common_cancel,
R.string.common_confirm,
-1
@@ -198,7 +187,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testRemoveFileDialog() {
RemoveFilesDialogFragment.newInstance(OCFile("/Test.md")).run {
@@ -207,7 +195,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testRemoveFilesDialog() {
val toDelete = ArrayList<OCFile>().apply {
@@ -220,7 +207,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testRemoveFolderDialog() {
val dialog = RemoveFilesDialogFragment.newInstance(OCFile("/Folder/"))
@@ -228,7 +214,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testRemoveFoldersDialog() {
val toDelete = ArrayList<OCFile>()
@@ -240,7 +225,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testNewFolderDialog() {
if (Looper.myLooper() == null) {
@@ -251,7 +235,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testEnforcedPasswordDialog() {
if (Looper.myLooper() == null) {
@@ -262,7 +245,6 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testOptionalPasswordDialog() {
if (Looper.myLooper() == null) {
@@ -273,13 +255,13 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testAccountChooserDialog() {
val intent = Intent(targetContext, FileDisplayActivity::class.java)
ActivityScenario.launch<FileDisplayActivity>(intent).use { scenario ->
var sut: ChooseAccountDialogFragment? = null
scenario.onActivity { activity: FileDisplayActivity ->
EspressoIdlingResource.increment()
val userAccountManager = activity.userAccountManager
val accountManager = AccountManager.get(targetContext)
@@ -322,73 +304,74 @@ class DialogFragmentIT : AbstractIT() {
}
fileDataStorageManager.saveCapabilities(capability)
EspressoIdlingResource.decrement()
sut = newInstance(
RegisteredUser(
newAccount,
OwnCloudAccount(newAccount, targetContext),
Server(URI.create(serverUrl), OwnCloudVersion.nextcloud_20)
)
)
try {
onIdleSync {
val sut = newInstance(
RegisteredUser(
newAccount,
OwnCloudAccount(newAccount, targetContext),
Server(URI.create(serverUrl), OwnCloudVersion.nextcloud_20)
)
)
showDialog(activity, sut)
sut.show(activity.supportFragmentManager, null)
}
sut.setStatus(
Status(
StatusType.DND,
"Busy fixing 🐛…",
"",
-1
),
targetContext
)
screenshot(sut, "dnd")
val dialogInstance = waitForDialog(sut!!) ?: throw IllegalStateException("Dialog was not created")
sut.setStatus(
Status(
StatusType.ONLINE,
"",
"",
-1
),
targetContext
)
screenshot(sut, "online")
sut.setStatus(
Status(
StatusType.ONLINE,
"Let's have some fun",
"🎉",
-1
),
targetContext
)
screenshot(sut, "fun")
sut.setStatus(
Status(StatusType.OFFLINE, "", "", -1),
targetContext
)
screenshot(sut, "offline")
sut.setStatus(
Status(StatusType.AWAY, "Vacation", "🌴", -1),
targetContext
)
screenshot(sut, "away")
}
} catch (e: AccountUtils.AccountNotFoundException) {
throw java.lang.RuntimeException(e)
scenario.onActivity {
val viewGroup = dialogInstance.window?.findViewById<ViewGroup>(android.R.id.content)
if (viewGroup != null) {
hideCursors(viewGroup)
}
sut.setStatus(
Status(
StatusType.DND,
"Busy fixing 🐛…",
"",
-1
),
targetContext
)
screenshot(sut, "dnd")
sut.setStatus(
Status(
StatusType.ONLINE,
"",
"",
-1
),
targetContext
)
screenshot(sut, "online")
sut.setStatus(
Status(
StatusType.ONLINE,
"Let's have some fun",
"🎉",
-1
),
targetContext
)
screenshot(sut, "fun")
sut.setStatus(
Status(StatusType.OFFLINE, "", "", -1),
targetContext
)
screenshot(sut, "offline")
sut.setStatus(
Status(StatusType.AWAY, "Vacation", "🌴", -1),
targetContext
)
screenshot(sut, "away")
}
}
}
@Test
@UiThread
@ScreenshotTest
@Throws(AccountUtils.AccountNotFoundException::class)
fun testAccountChooserDialogWithStatusDisabled() {
@@ -404,44 +387,42 @@ class DialogFragmentIT : AbstractIT() {
accountManager.setAuthToken(newAccount, AccountTypeUtils.getAuthTokenTypePass(newAccount.type), "password")
launchActivity<FileDisplayActivity>().use { scenario ->
var sut: ChooseAccountDialogFragment? = null
scenario.onActivity { fda ->
onIdleSync {
EspressoIdlingResource.increment()
val userAccountManager = fda.userAccountManager
val newUser = userAccountManager.getUser(newAccount.name).get()
val fileDataStorageManager = FileDataStorageManager(
newUser,
targetContext.contentResolver
)
val userAccountManager = fda.userAccountManager
val newUser = userAccountManager.getUser(newAccount.name).get()
val fileDataStorageManager = FileDataStorageManager(
newUser,
targetContext.contentResolver
)
val capability = OCCapability().apply {
userStatus = CapabilityBooleanType.FALSE
}
fileDataStorageManager.saveCapabilities(capability)
EspressoIdlingResource.decrement()
val sut =
newInstance(
RegisteredUser(
newAccount,
OwnCloudAccount(newAccount, targetContext),
Server(
URI.create(serverUrl),
OwnCloudVersion.nextcloud_20
)
)
)
onView(isRoot()).check(matches(isDisplayed()))
showDialog(fda, sut)
val capability = OCCapability().apply {
userStatus = CapabilityBooleanType.FALSE
}
fileDataStorageManager.saveCapabilities(capability)
sut = newInstance(
RegisteredUser(
newAccount,
OwnCloudAccount(newAccount, targetContext),
Server(
URI.create(serverUrl),
OwnCloudVersion.nextcloud_20
)
)
)
sut.show(fda.supportFragmentManager, null)
}
waitForDialog(sut!!) ?: throw IllegalStateException("Dialog was not created")
onView(isRoot()).check(matches(isDisplayed()))
}
}
@Test
@UiThread
@ScreenshotTest
fun testBottomSheet() {
if (Looper.myLooper() == null) {
@@ -469,142 +450,128 @@ class DialogFragmentIT : AbstractIT() {
val intent = Intent(targetContext, FileDisplayActivity::class.java)
launchActivity<FileDisplayActivity>(intent).use { scenario ->
var sut: OCFileListBottomSheetDialog? = null
scenario.onActivity { fda ->
onIdleSync {
EspressoIdlingResource.increment()
var directEditing = DirectEditing()
val creators = directEditing.creators.toMutableMap()
val editors = directEditing.editors.toMutableMap()
// add direct editing info
var directEditing = DirectEditing()
val creators = directEditing.creators.toMutableMap()
val editors = directEditing.editors.toMutableMap()
creators["1"] = Creator(
"1",
"text",
"text file",
".md",
"application/octet-stream",
false
)
creators.put(
"1",
Creator(
"1",
"text",
"text file",
".md",
"application/octet-stream",
false
)
)
creators.put(
"2",
Creator(
"2",
"md",
"markdown file",
".md",
"application/octet-stream",
false
)
)
editors.put(
"text",
Editor(
"1",
"Text",
ArrayList(mutableListOf(MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN)),
ArrayList(),
false
)
)
creators["2"] = Creator(
"2",
"md",
"markdown file",
".md",
"application/octet-stream",
false
)
directEditing = DirectEditing(editors, creators)
val json = Gson().toJson(directEditing)
editors["text"] = Editor(
"1",
"Text",
ArrayList(mutableListOf(MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN)),
ArrayList(),
false
)
ArbitraryDataProviderImpl(targetContext).storeOrUpdateKeyValue(
user.accountName,
ArbitraryDataProvider.DIRECT_EDITING,
json
)
directEditing = DirectEditing(editors, creators)
val json = Gson().toJson(directEditing)
// activate templates
val capability = fda.capabilities.apply {
richDocuments = CapabilityBooleanType.TRUE
richDocumentsDirectEditing = CapabilityBooleanType.TRUE
richDocumentsTemplatesAvailable = CapabilityBooleanType.TRUE
accountName = user.accountName
}
CapabilityUtils.updateCapability(capability)
ArbitraryDataProviderImpl(targetContext).storeOrUpdateKeyValue(
user.accountName,
ArbitraryDataProvider.DIRECT_EDITING,
json
)
val appScanOptionalFeature: AppScanOptionalFeature = object : AppScanOptionalFeature() {
override fun getScanContract(): ActivityResultContract<Unit, String?> =
throw UnsupportedOperationException("Document scan is not available")
}
val materialSchemesProvider = getMaterialSchemesProvider()
val viewThemeUtils = ViewThemeUtils(
materialSchemesProvider.getMaterialSchemesForCurrentUser(),
ColorUtil(targetContext)
)
val editorUtils = EditorUtils(ArbitraryDataProviderImpl(targetContext))
val sut = OCFileListBottomSheetDialog(
fda,
action,
info,
user,
ocFile,
fda.themeUtils,
viewThemeUtils,
editorUtils,
appScanOptionalFeature
)
EspressoIdlingResource.decrement()
sut.show()
sut.behavior.setState(BottomSheetBehavior.STATE_EXPANDED)
val viewGroup = sut.window?.findViewById<ViewGroup>(android.R.id.content) ?: return@onIdleSync
hideCursors(viewGroup)
val screenShotName = createName(testClassName + "_" + "testBottomSheet", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.window?.decorView, screenShotName)
val capability = fda.capabilities.apply {
richDocuments = CapabilityBooleanType.TRUE
richDocumentsDirectEditing = CapabilityBooleanType.TRUE
richDocumentsTemplatesAvailable = CapabilityBooleanType.TRUE
accountName = user.accountName
}
CapabilityUtils.updateCapability(capability)
val appScanOptionalFeature: AppScanOptionalFeature = object : AppScanOptionalFeature() {
override fun getScanContract(): ActivityResultContract<Unit, String?> =
throw UnsupportedOperationException("Document scan is not available")
}
val materialSchemesProvider = getMaterialSchemesProvider()
val viewThemeUtils = ViewThemeUtils(
materialSchemesProvider.getMaterialSchemesForCurrentUser(),
ColorUtil(targetContext)
)
val editorUtils = EditorUtils(ArbitraryDataProviderImpl(targetContext))
sut = OCFileListBottomSheetDialog(
fda,
action,
info,
user,
ocFile,
fda.themeUtils,
viewThemeUtils,
editorUtils,
appScanOptionalFeature
)
sut.show()
}
sut!!.behavior.setState(BottomSheetBehavior.STATE_EXPANDED)
val viewGroup = sut.window?.findViewById<ViewGroup>(android.R.id.content) ?: return
hideCursors(viewGroup)
val screenShotName = createName(testClassName + "_" + "testBottomSheet", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.window?.decorView, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun testOnlineStatusBottomSheet() {
if (Looper.myLooper() == null) {
Looper.prepare()
}
// show dialog
val intent = Intent(targetContext, FileDisplayActivity::class.java)
launchActivity<FileDisplayActivity>(intent).use { scenario ->
var sut: SetOnlineStatusBottomSheet? = null
scenario.onActivity { fda ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = SetOnlineStatusBottomSheet(
Status(StatusType.DND, "Focus time", "\uD83E\uDD13", -1)
)
EspressoIdlingResource.decrement()
sut.show(fda.supportFragmentManager, "set_online_status")
sut = SetOnlineStatusBottomSheet(
Status(StatusType.DND, "Focus time", "\uD83E\uDD13", -1)
)
sut.show(fda.supportFragmentManager, "set_online_status")
}
val screenShotName = createName(testClassName + "_" + "testOnlineStatusBottomSheet", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.view, screenShotName)
}
val screenShotName = createName(testClassName + "_" + "testOnlineStatusBottomSheet", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity {
screenshotViaName(sut!!.view, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun testProfileBottomSheet() {
if (Looper.myLooper() == null) {
Looper.prepare()
}
// Fixed values for HoverCard
val actions: MutableList<Action> = ArrayList()
actions.add(
Action(
@@ -633,33 +600,30 @@ class DialogFragmentIT : AbstractIT() {
)
val hoverCard = HoverCard("christine", "Christine Scott", actions)
// show dialog
val intent = Intent(targetContext, FileDisplayActivity::class.java)
launchActivity<FileDisplayActivity>(intent).use { scenario ->
var sut: ProfileBottomSheetDialog? = null
scenario.onActivity { fda ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = ProfileBottomSheetDialog(
fda,
user,
hoverCard,
fda.viewThemeUtils
)
EspressoIdlingResource.decrement()
sut.show()
sut = ProfileBottomSheetDialog(
fda,
user,
hoverCard,
fda.viewThemeUtils
)
sut.show()
}
val screenShotName = createName(testClassName + "_" + "testProfileBottomSheet", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.window?.decorView, screenShotName)
}
val screenShotName = createName(testClassName + "_" + "testProfileBottomSheet", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity {
screenshotViaName(sut!!.window?.decorView, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun testSslUntrustedCertDialog() {
if (Looper.myLooper() == null) {
@@ -677,20 +641,17 @@ class DialogFragmentIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun testStoragePermissionDialog() {
if (Looper.myLooper() == null) {
Looper.prepare()
}
newInstance(false).run {
showDialog(this)
}
val dialog = StoragePermissionDialogFragment()
showDialog(dialog)
}
@Test
@UiThread
@ScreenshotTest
fun testFileActionsBottomSheet() {
if (Looper.myLooper() == null) {
@@ -709,34 +670,30 @@ class DialogFragmentIT : AbstractIT() {
private fun showDialog(dialog: DialogFragment) {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
onView(isRoot()).check(matches(isDisplayed()))
showDialog(sut, dialog)
}
dialog.show(sut.supportFragmentManager, null)
}
}
}
private fun showDialog(sut: FileDisplayActivity, dialog: DialogFragment) {
dialog.show(sut.supportFragmentManager, null)
onIdleSync {
val dialogInstance = waitForDialog(dialog)
?: throw IllegalStateException("Dialog was not created")
val dialogInstance = waitForDialog(dialog) ?: throw IllegalStateException("Dialog was not created")
val viewGroup = dialogInstance.window?.findViewById<ViewGroup>(android.R.id.content) ?: return@onIdleSync
hideCursors(viewGroup)
scenario.onActivity {
val viewGroup = dialogInstance.window?.findViewById<ViewGroup>(android.R.id.content)
if (viewGroup != null) {
hideCursors(viewGroup)
}
screenshot(dialogInstance.window?.decorView)
}
onView(isRoot()).check(matches(isDisplayed()))
screenshot(dialogInstance.window?.decorView)
}
}
private fun waitForDialog(dialogFragment: DialogFragment, timeoutMs: Long = 5000): Dialog? {
val start = System.currentTimeMillis()
while (System.currentTimeMillis() - start < timeoutMs) {
val dialog = dialogFragment.dialog
if (dialog != null) return dialog
Thread.sleep(100)
if (dialogFragment.isAdded && dialogFragment.dialog != null) {
return dialogFragment.dialog
}
Thread.sleep(50)
}
return null
}
@@ -8,12 +8,10 @@
*/
package com.owncloud.android.ui.dialog
import androidx.annotation.UiThread
import androidx.fragment.app.FragmentManager
import androidx.recyclerview.widget.RecyclerView
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -21,11 +19,8 @@ import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Test
class SendFilesDialogTest : AbstractIT() {
@@ -53,38 +48,25 @@ class SendFilesDialogTest : AbstractIT() {
)
}
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
private fun showDialog(files: Set<OCFile>, onComplete: (SendFilesDialog) -> Unit) {
launchActivity<TestActivity>().use { scenario ->
onView(isRoot()).check(matches(isDisplayed()))
var dialog: SendFilesDialog? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fm: FragmentManager = sut.supportFragmentManager
val ft = fm.beginTransaction()
ft.addToBackStack(null)
val dialog = SendFilesDialog.newInstance(files)
dialog.show(ft, "TAG_SEND_SHARE_DIALOG")
onComplete(dialog)
EspressoIdlingResource.decrement()
}
val fm: FragmentManager = sut.supportFragmentManager
val ft = fm.beginTransaction()
ft.addToBackStack(null)
dialog = SendFilesDialog.newInstance(files)
dialog.show(ft, "TAG_SEND_SHARE_DIALOG")
fm.executePendingTransactions()
}
onComplete(dialog!!)
}
}
@Test
@UiThread
@ScreenshotTest
fun showDialog() {
showDialog(FILES_SAME_TYPE) { sut ->
@@ -95,18 +77,15 @@ class SendFilesDialogTest : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun showDialog_Screenshot() {
showDialog(FILES_SAME_TYPE) { sut ->
val screenShotName = createName(testClassName + "_" + "showDialog_Screenshot", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.requireDialog().window?.decorView, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showDialogDifferentTypes() {
showDialog(FILES_MIXED_TYPE) { sut ->
@@ -117,7 +96,6 @@ class SendFilesDialogTest : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun showDialogDifferentTypes_Screenshot() {
showDialog(FILES_MIXED_TYPE) { sut ->
@@ -8,7 +8,6 @@
*/
package com.owncloud.android.ui.dialog
import androidx.annotation.UiThread
import androidx.fragment.app.FragmentManager
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
@@ -19,7 +18,6 @@ import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Test
@@ -27,29 +25,26 @@ class SendShareDialogTest : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.dialog.SendShareDialogTest"
@Test
@UiThread
@ScreenshotTest
fun showDialog() {
launchActivity<TestActivity>().use { scenario ->
var sut: SendShareDialog? = null
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val fm: FragmentManager = activity.supportFragmentManager
val ft = fm.beginTransaction()
ft.addToBackStack(null)
val file = OCFile("/1.jpg").apply {
mimeType = "image/jpg"
}
EspressoIdlingResource.decrement()
val sut = SendShareDialog.newInstance(file, false, OCCapability())
sut.show(ft, "TAG_SEND_SHARE_DIALOG")
val screenShotName = createName(testClassName + "_" + "showDialog", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.requireDialog().window?.decorView, screenShotName)
val fm: FragmentManager = activity.supportFragmentManager
val ft = fm.beginTransaction()
ft.addToBackStack(null)
fm.executePendingTransactions()
val file = OCFile("/1.jpg").apply {
mimeType = "image/jpg"
}
sut = SendShareDialog.newInstance(file, false, OCCapability())
sut.show(ft, "TAG_SEND_SHARE_DIALOG")
}
val screenShotName = createName(testClassName + "_" + "showDialog", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut!!.requireDialog().window?.decorView, screenShotName)
}
}
}
@@ -8,93 +8,72 @@
*/
package com.owncloud.android.ui.dialog
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.ui.dialog.setupEncryption.SetupEncryptionDialogFragment
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class SetupEncryptionDialogFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.dialog.SetupEncryptionDialogFragmentIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun showMnemonic() {
launchActivity<TestActivity>().use { scenario ->
var sut: SetupEncryptionDialogFragment? = null
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = SetupEncryptionDialogFragment.newInstance(user, 0)
sut = SetupEncryptionDialogFragment.newInstance(user, 0)
sut.show(activity.supportFragmentManager, "1")
val keyWords = arrayListOf(
"ability",
"able",
"about",
"above",
"absent",
"absorb",
"abstract",
"absurd",
"abuse",
"access",
"accident",
"account",
"accuse"
)
sut.setMnemonic(keyWords)
sut.showMnemonicInfo()
}
sut.show(activity.supportFragmentManager, "1")
val screenShotName = createName(testClassName + "_" + "showMnemonic", "")
onView(isRoot()).check(matches(isDisplayed()))
val keyWords = arrayListOf(
"ability",
"able",
"about",
"above",
"absent",
"absorb",
"abstract",
"absurd",
"abuse",
"access",
"accident",
"account",
"accuse"
)
sut.setMnemonic(keyWords)
sut.showMnemonicInfo()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showMnemonic", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.requireDialog().window?.decorView, screenShotName)
}
scenario.onActivity {
screenshotViaName(sut!!.requireDialog().window?.decorView, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun error() {
launchActivity<TestActivity>().use { scenario ->
var sut: SetupEncryptionDialogFragment? = null
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
sut = SetupEncryptionDialogFragment.newInstance(user, 0)
sut.show(activity.supportFragmentManager, "1")
sut.errorSavingKeys()
}
val sut = SetupEncryptionDialogFragment.newInstance(user, 0)
sut.show(activity.supportFragmentManager, "1")
sut.errorSavingKeys()
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut.requireDialog().window?.decorView, screenShotName)
}
scenario.onActivity {
screenshotViaName(sut!!.requireDialog().window?.decorView, screenShotName)
}
}
}
@@ -6,84 +6,73 @@
*/
package com.owncloud.android.ui.dialog
import androidx.annotation.UiThread
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.rule.GrantPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragment.Companion.newInstance
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
class SyncFileNotEnoughSpaceDialogFragmentTest : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.dialog.SyncFileNotEnoughSpaceDialogFragmentTest"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@Test
@ScreenshotTest
@UiThread
fun showNotEnoughSpaceDialogForFolder() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
var sut: FileDisplayActivity? = null
scenario.onActivity { activity ->
val ocFile = OCFile("/Document/").apply {
fileLength = 5000000
setFolder()
}
onIdleSync {
EspressoIdlingResource.increment()
newInstance(ocFile, 1000).apply {
show(sut.supportFragmentManager, "1")
}
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showNotEnoughSpaceDialogForFolder", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
newInstance(ocFile, 1000).apply {
show(activity.supportFragmentManager, "1")
}
sut = activity
}
val screenShotName = createName(testClassName + "_" + "showNotEnoughSpaceDialogForFolder", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
@UiThread
fun showNotEnoughSpaceDialogForFile() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
var sut: FileDisplayActivity? = null
scenario.onActivity { activity ->
val ocFile = OCFile("/Video.mp4").apply {
fileLength = 1000000
}
onIdleSync {
EspressoIdlingResource.increment()
newInstance(ocFile, 2000).apply {
show(sut.supportFragmentManager, "2")
}
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showNotEnoughSpaceDialogForFile", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
newInstance(ocFile, 2000).apply {
show(activity.supportFragmentManager, "2")
}
sut = activity
}
val screenShotName = createName(testClassName + "_" + "showNotEnoughSpaceDialogForFile", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
}
@@ -9,13 +9,12 @@
package com.owncloud.android.ui.fragment
import android.graphics.BitmapFactory
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.R
@@ -23,171 +22,164 @@ import com.owncloud.android.lib.resources.users.StatusType
import com.owncloud.android.ui.TextDrawable
import com.owncloud.android.utils.BitmapUtils
import com.owncloud.android.utils.DisplayUtils
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class AvatarIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.fragment.AvatarIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun showAvatars() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = AvatarTestFragment()
sut.addFragment(fragment)
}
val avatarRadius = targetContext.resources.getDimension(R.dimen.list_item_avatar_icon_radius)
val width = DisplayUtils.convertDpToPixel(2 * avatarRadius, targetContext)
val fragment = AvatarTestFragment()
onView(withId(R.id.avatar_list1))
.check(matches(isDisplayed()))
sut.addFragment(fragment)
fragment.run {
addAvatar("Admin", avatarRadius, width, targetContext)
addAvatar("Test Server Admin", avatarRadius, width, targetContext)
addAvatar("Cormier Paulette", avatarRadius, width, targetContext)
addAvatar("winston brent", avatarRadius, width, targetContext)
addAvatar("Baker James Lorena", avatarRadius, width, targetContext)
addAvatar("Baker James Lorena", avatarRadius, width, targetContext)
addAvatar("[email protected]", avatarRadius, width, targetContext)
}
scenario.onActivity { sut ->
val avatarRadius = targetContext.resources.getDimension(R.dimen.list_item_avatar_icon_radius)
val width = DisplayUtils.convertDpToPixel(2 * avatarRadius, targetContext)
val fragment = sut.supportFragmentManager.fragments.last() as AvatarTestFragment
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showAvatars", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
fragment.run {
addAvatar("Admin", avatarRadius, width, targetContext)
addAvatar("Test Server Admin", avatarRadius, width, targetContext)
addAvatar("Cormier Paulette", avatarRadius, width, targetContext)
addAvatar("winston brent", avatarRadius, width, targetContext)
addAvatar("Baker James Lorena", avatarRadius, width, targetContext)
addAvatar("Baker James Lorena", avatarRadius, width, targetContext)
addAvatar("[email protected]", avatarRadius, width, targetContext)
}
}
val screenShotName = createName(testClassName + "_" + "showAvatars", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
@Test
@UiThread
@ScreenshotTest
fun showAvatarsWithStatus() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = AvatarTestFragment()
sut.addFragment(fragment)
}
val avatarRadius = targetContext.resources.getDimension(R.dimen.list_item_avatar_icon_radius)
val width = DisplayUtils.convertDpToPixel(2 * avatarRadius, targetContext)
val fragment = AvatarTestFragment()
onView(withId(R.id.avatar_list1))
.check(matches(isDisplayed()))
val paulette = BitmapFactory.decodeFile(getFile("paulette.jpg").absolutePath)
val christine = BitmapFactory.decodeFile(getFile("christine.jpg").absolutePath)
val textBitmap = BitmapUtils.drawableToBitmap(TextDrawable.createNamedAvatar("Admin", avatarRadius))
scenario.onActivity { sut ->
val avatarRadius = targetContext.resources.getDimension(R.dimen.list_item_avatar_icon_radius)
val width = DisplayUtils.convertDpToPixel(2 * avatarRadius, targetContext)
sut.addFragment(fragment)
val paulette = BitmapFactory.decodeFile(getFile("paulette.jpg").absolutePath)
val christine = BitmapFactory.decodeFile(getFile("christine.jpg").absolutePath)
val textBitmap = BitmapUtils.drawableToBitmap(TextDrawable.createNamedAvatar("Admin", avatarRadius))
val fragment = sut.supportFragmentManager.fragments.last() as AvatarTestFragment
fragment.run {
addBitmap(
BitmapUtils.createAvatarWithStatus(paulette, StatusType.ONLINE, "😘", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.ONLINE, "☁️", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.ONLINE, "🌴️", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.ONLINE, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(paulette, StatusType.DND, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.AWAY, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(paulette, StatusType.OFFLINE, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "😘", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "☁️", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "🌴️", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.DND, "", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.AWAY, "", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.OFFLINE, "", targetContext),
width,
2,
targetContext
)
}
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showAvatarsWithStatus", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
fragment.run {
addBitmap(
BitmapUtils.createAvatarWithStatus(paulette, StatusType.ONLINE, "😘", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.ONLINE, "☁️", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.ONLINE, "🌴️", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.ONLINE, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(paulette, StatusType.DND, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(christine, StatusType.AWAY, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(paulette, StatusType.OFFLINE, "", targetContext),
width * 2,
1,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "😘", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "☁️", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "🌴️", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.ONLINE, "", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.DND, "", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.AWAY, "", targetContext),
width,
2,
targetContext
)
addBitmap(
BitmapUtils.createAvatarWithStatus(textBitmap, StatusType.OFFLINE, "", targetContext),
width,
2,
targetContext
)
}
}
val screenShotName = createName(testClassName + "_" + "showAvatarsWithStatus", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
screenshotViaName(sut, screenShotName)
}
}
}
}
@@ -9,10 +9,8 @@
*/
package com.owncloud.android.ui.fragment
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -25,10 +23,7 @@ import com.owncloud.android.lib.resources.activities.model.Activity
import com.owncloud.android.lib.resources.activities.model.RichElement
import com.owncloud.android.lib.resources.activities.model.RichObject
import com.owncloud.android.lib.resources.activities.models.PreviewObject
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
import java.io.File
import java.util.GregorianCalendar
@@ -36,16 +31,6 @@ import java.util.GregorianCalendar
class FileDetailFragmentStaticServerIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.fragment.FileDetailFragmentStaticServerIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
private var file: File = getFile("gps.jpg")
private val oCFile: OCFile = OCFile("/").apply {
storagePath = file.absolutePath
@@ -54,67 +39,60 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
}
@Test
@UiThread
@ScreenshotTest
fun showFileDetailActivitiesFragment() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.addFragment(FileDetailActivitiesFragment.newInstance(oCFile, user))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showFileDetailActivitiesFragment", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
sut.addFragment(FileDetailActivitiesFragment.newInstance(oCFile, user))
sut.supportFragmentManager.executePendingTransactions()
}
val screenShotName = createName(testClassName + "_" + "showFileDetailActivitiesFragment", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showFileDetailSharingFragment() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
sut.addFragment(FileDetailSharingFragment.newInstance(oCFile, user))
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showFileDetailSharingFragment", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
sut.addFragment(FileDetailSharingFragment.newInstance(oCFile, user))
sut.supportFragmentManager.executePendingTransactions()
}
val screenShotName = createName(testClassName + "_" + "showFileDetailSharingFragment", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showFileDetailDetailsFragment() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = ImageDetailFragment.newInstance(oCFile, user).apply {
hideMap()
}
sut.addFragment(fragment)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showFileDetailDetailsFragment", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
activity = sut
val fragment = ImageDetailFragment.newInstance(oCFile, user).apply {
hideMap()
}
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
}
val screenShotName = createName(testClassName + "_" + "showFileDetailDetailsFragment", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
@Suppress("MagicNumber")
fun showDetailsActivities() {
@@ -171,84 +149,77 @@ class FileDetailFragmentStaticServerIT : AbstractIT() {
)
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
sut.addFragment(fragment)
fragment.fileDetailActivitiesFragment.populateList(activities as List<Any>?, true)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showDetailsActivities", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
fragment.fileDetailActivitiesFragment.populateList(activities as List<Any>?, true)
}
val screenShotName = createName(testClassName + "_" + "showDetailsActivities", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showDetailsActivitiesNone() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
sut.addFragment(fragment)
fragment.fileDetailActivitiesFragment.populateList(emptyList(), true)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showDetailsActivitiesNone", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
sut.addFragment(fragment)
activity.supportFragmentManager.executePendingTransactions()
fragment.fileDetailActivitiesFragment.populateList(emptyList(), true)
}
val screenShotName = createName(testClassName + "_" + "showDetailsActivitiesNone", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showDetailsActivitiesError() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
sut.addFragment(fragment)
fragment.fileDetailActivitiesFragment.disableLoadingActivities()
fragment.fileDetailActivitiesFragment.setErrorContent(
targetContext.resources.getString(R.string.file_detail_activity_error)
)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showDetailsActivitiesError", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 0)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
fragment.fileDetailActivitiesFragment.disableLoadingActivities()
fragment.fileDetailActivitiesFragment.setErrorContent(
targetContext.resources.getString(R.string.file_detail_activity_error)
)
}
val screenShotName = createName(testClassName + "_" + "showDetailsActivitiesError", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showDetailsSharing() {
launchActivity<TestActivity>().use { scenario ->
var activity: TestActivity? = null
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
val fragment = FileDetailFragment.newInstance(oCFile, user, 1)
sut.addFragment(fragment)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showDetailsSharing", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
activity = sut
val fragment = FileDetailFragment.newInstance(oCFile, user, 1)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
}
val screenShotName = createName(testClassName + "_" + "showDetailsSharing", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
}
File diff suppressed because it is too large. Load diff
@@ -12,10 +12,8 @@ import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -26,7 +24,6 @@ import com.owncloud.android.datamodel.ThumbnailsCacheManager
import com.owncloud.android.datamodel.ThumbnailsCacheManager.PREFIX_RESIZED_IMAGE
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.files.model.ImageDimension
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert.assertNotNull
@@ -40,8 +37,6 @@ class GalleryFragmentIT : AbstractIT() {
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
// initialise thumbnails cache on background thread
@Suppress("DEPRECATION")
ThumbnailsCacheManager.initDiskCacheAsync()
@@ -49,51 +44,44 @@ class GalleryFragmentIT : AbstractIT() {
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
ThumbnailsCacheManager.clearCache()
}
@Test
@UiThread
@ScreenshotTest
fun showEmpty() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = GalleryFragment()
activity.addFragment(sut)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showEmpty", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
val sut = GalleryFragment()
activity.addFragment(sut)
}
val screenShotName = createName(testClassName + "_" + "showEmpty", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showGallery() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
createImage(10000001, 700, 300)
createImage(10000002, 500, 300)
createImage(10000007, 300, 400)
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
createImage(10000001, 700, 300)
createImage(10000002, 500, 300)
createImage(10000007, 300, 400)
val sut = GalleryFragment()
activity.addFragment(sut)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showGallery", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
val sut = GalleryFragment()
activity.addFragment(sut)
}
val screenShotName = createName(testClassName + "_" + "showGallery", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@@ -8,91 +8,67 @@
*/
package com.owncloud.android.ui.fragment
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import com.nextcloud.android.lib.resources.groupfolders.Groupfolder
import com.nextcloud.test.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class GroupfolderListFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.fragment.GroupfolderListFragmentIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun showGroupfolder() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
val sut = GroupfolderListFragment()
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
val sut = GroupfolderListFragment()
activity.addFragment(sut)
sut.setAdapter(null)
sut.setData(
mapOf(
Pair("2", Groupfolder(2, "/subfolder/group"))
)
sut.setAdapter(null)
sut.setData(
mapOf(
Pair("2", Groupfolder(2, "/subfolder/group"))
)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showGroupfolder", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
)
}
val screenShotName = createName(testClassName + "_" + "showGroupfolder", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun showGroupfolders() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = GroupfolderListFragment()
activity.addFragment(sut)
sut.setAdapter(null)
sut.setData(
mapOf(
Pair("1", Groupfolder(1, "/test/")),
Pair("2", Groupfolder(2, "/subfolder/group"))
)
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
val sut = GroupfolderListFragment()
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
sut.setAdapter(null)
sut.setData(
mapOf(
Pair("1", Groupfolder(1, "/test/")),
Pair("2", Groupfolder(2, "/subfolder/group"))
)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showGroupfolders", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
)
}
val screenShotName = createName(testClassName + "_" + "showGroupfolders", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
}
@@ -9,10 +9,8 @@
*/
package com.owncloud.android.ui.fragment
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -26,9 +24,7 @@ import com.owncloud.android.lib.resources.tags.Tag
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.MimeType
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Assert
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@@ -36,84 +32,69 @@ import org.junit.rules.TestRule
class OCFileListFragmentStaticServerIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.fragment.OCFileListFragmentStaticServerIT"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
var storagePermissionRule: TestRule = grant()
@Test
@UiThread
@ScreenshotTest
@Suppress("MagicNumber")
fun showFiles() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
OCFile("/1.png").apply {
remoteId = "00000001"
mimeType = "image/png"
fileLength = 1024000
modificationTimestamp = 1188206955000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/image.png").apply {
remoteId = "00000002"
mimeType = "image/png"
isPreviewAvailable = false
fileLength = 3072000
modificationTimestamp = 746443755000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
tags = listOf(Tag("", "Top secret", null))
sut.storageManager.saveFile(this)
}
OCFile("/live photo.png").apply {
remoteId = "00000003"
mimeType = "image/png"
isPreviewAvailable = false
fileLength = 3072000
modificationTimestamp = 746443755000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
setLivePhoto("/video.mov")
sut.storageManager.saveFile(this)
}
OCFile("/video.mp4").apply {
remoteId = "00000004"
mimeType = "video/mp4"
isPreviewAvailable = false
fileLength = 12092000
modificationTimestamp = 746143952000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
tags = listOf(Tag("", "Confidential", null), Tag("", "+5", null))
sut.storageManager.saveFile(this)
}
sut.addFragment(OCFileListFragment())
val fragment = (sut.fragment as OCFileListFragment)
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false, false)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
var sut: TestActivity? = null
scenario.onActivity { testActivity ->
sut = testActivity
OCFile("/1.png").apply {
remoteId = "00000001"
mimeType = "image/png"
fileLength = 1024000
modificationTimestamp = 1188206955000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/image.png").apply {
remoteId = "00000002"
mimeType = "image/png"
isPreviewAvailable = false
fileLength = 3072000
modificationTimestamp = 746443755000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
tags = listOf(Tag("", "Top secret", null))
sut.storageManager.saveFile(this)
}
OCFile("/live photo.png").apply {
remoteId = "00000003"
mimeType = "image/png"
isPreviewAvailable = false
fileLength = 3072000
modificationTimestamp = 746443755000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
setLivePhoto("/video.mov")
sut.storageManager.saveFile(this)
}
OCFile("/video.mp4").apply {
remoteId = "00000004"
mimeType = "video/mp4"
isPreviewAvailable = false
fileLength = 12092000
modificationTimestamp = 746143952000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
tags = listOf(Tag("", "Confidential", null), Tag("", "+5", null))
sut.storageManager.saveFile(this)
}
sut.addFragment(OCFileListFragment())
sut.supportFragmentManager.executePendingTransactions()
val fragment = (sut.fragment as OCFileListFragment)
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false)
}
val screenShotName = createName(testClassName + "_" + "showFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@@ -121,135 +102,131 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
* Use same values as {@link FileDetailSharingFragmentIT listSharesFileAllShareTypes }
*/
@Test
@UiThread
@ScreenshotTest
fun showSharedFiles() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
var sut: TestActivity? = null
scenario.onActivity { testActivity ->
sut = testActivity
val fragment = OCFileListFragment()
val fragment = OCFileListFragment()
OCFile("/sharedToUser.jpg").apply {
remoteId = "00000001"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("Admin", "Server Admin", ShareType.USER))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToGroup.jpg").apply {
remoteId = "00000002"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("group", "Group", ShareType.GROUP))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToEmail.jpg").apply {
remoteId = "00000003"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees =
listOf(
ShareeUser("[email protected]", "[email protected]", ShareType.EMAIL)
)
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/publicLink.jpg").apply {
remoteId = "00000004"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedViaLink = true
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToFederatedUser.jpg").apply {
remoteId = "00000005"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(
ShareeUser(
"[email protected]",
"[email protected] (remote)",
ShareType.FEDERATED
)
)
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToPersonalCircle.jpg").apply {
remoteId = "00000006"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("circle", "Circle (Personal circle)", ShareType.CIRCLE))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToUserRoom.jpg").apply {
remoteId = "00000007"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("Conversation", "Admin", ShareType.ROOM))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToGroupRoom.jpg").apply {
remoteId = "00000008"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("Conversation", "Meeting", ShareType.ROOM))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToUsers.jpg").apply {
remoteId = "00000009"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(
ShareeUser("Admin", "Server Admin", ShareType.USER),
ShareeUser("User", "User", ShareType.USER),
ShareeUser("Christine", "Christine Scott", ShareType.USER)
)
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/notShared.jpg").apply {
remoteId = "000000010"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/Foo%e2%80%aedm.exe").apply {
remoteId = "000000011"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
sut.addFragment(fragment)
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false, false)
fragment.adapter.setShowShareAvatar(true)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showSharedFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
OCFile("/sharedToUser.jpg").apply {
remoteId = "00000001"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("Admin", "Server Admin", ShareType.USER))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToGroup.jpg").apply {
remoteId = "00000002"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("group", "Group", ShareType.GROUP))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToEmail.jpg").apply {
remoteId = "00000003"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees =
listOf(
ShareeUser("[email protected]", "[email protected]", ShareType.EMAIL)
)
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/publicLink.jpg").apply {
remoteId = "00000004"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedViaLink = true
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToFederatedUser.jpg").apply {
remoteId = "00000005"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(
ShareeUser(
"[email protected]",
"[email protected] (remote)",
ShareType.FEDERATED
)
)
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToPersonalCircle.jpg").apply {
remoteId = "00000006"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("circle", "Circle (Personal circle)", ShareType.CIRCLE))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToUserRoom.jpg").apply {
remoteId = "00000007"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("Conversation", "Admin", ShareType.ROOM))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToGroupRoom.jpg").apply {
remoteId = "00000008"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("Conversation", "Meeting", ShareType.ROOM))
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/sharedToUsers.jpg").apply {
remoteId = "00000009"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(
ShareeUser("Admin", "Server Admin", ShareType.USER),
ShareeUser("User", "User", ShareType.USER),
ShareeUser("Christine", "Christine Scott", ShareType.USER)
)
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/notShared.jpg").apply {
remoteId = "000000010"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
OCFile("/Foo%e2%80%aedm.exe").apply {
remoteId = "000000011"
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
modificationTimestamp = 1000
sut.storageManager.saveFile(this)
}
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false)
fragment.adapter.setShowShareAvatar(true)
}
val screenShotName = createName(testClassName + "_" + "showSharedFiles", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@@ -257,181 +234,167 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
* Use same values as {@link FileDetailSharingFragmentIT listSharesFileAllShareTypes }
*/
@Test
@UiThread
@ScreenshotTest
fun showFolderTypes() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
var sut: TestActivity? = null
scenario.onActivity { testActivity ->
sut = testActivity
val fragment = OCFileListFragment()
val fragment = OCFileListFragment()
OCFile("/normal/").apply {
remoteId = "00000001"
mimeType = MimeType.DIRECTORY
modificationTimestamp = 1624003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/sharedViaLink/").apply {
remoteId = "00000002"
mimeType = MimeType.DIRECTORY
isSharedViaLink = true
modificationTimestamp = 1619003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/share/").apply {
remoteId = "00000003"
mimeType = MimeType.DIRECTORY
isSharedWithSharee = true
modificationTimestamp = 1619303571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/groupFolder/").apply {
remoteId = "00000004"
mimeType = MimeType.DIRECTORY
modificationTimestamp = 1615003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
permissions += "M"
sut.storageManager.saveFile(this)
}
OCFile("/encrypted/").apply {
remoteId = "00000005"
mimeType = MimeType.DIRECTORY
isEncrypted = true
decryptedRemotePath = "/encrypted/"
modificationTimestamp = 1614003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/locked/").apply {
remoteId = "00000006"
mimeType = MimeType.DIRECTORY
isLocked = true
decryptedRemotePath = "/locked/"
modificationTimestamp = 1613003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/offlineOperation/").apply {
mimeType = MimeType.DIRECTORY
decryptedRemotePath = "/offlineOperation/"
modificationTimestamp = System.currentTimeMillis()
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
sut.addFragment(fragment)
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false, false)
fragment.adapter.setShowShareAvatar(true)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showFolderTypes", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
OCFile("/normal/").apply {
remoteId = "00000001"
mimeType = MimeType.DIRECTORY
modificationTimestamp = 1624003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/sharedViaLink/").apply {
remoteId = "00000002"
mimeType = MimeType.DIRECTORY
isSharedViaLink = true
modificationTimestamp = 1619003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/share/").apply {
remoteId = "00000003"
mimeType = MimeType.DIRECTORY
isSharedWithSharee = true
modificationTimestamp = 1619303571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/groupFolder/").apply {
remoteId = "00000004"
mimeType = MimeType.DIRECTORY
modificationTimestamp = 1615003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
permissions += "M"
sut.storageManager.saveFile(this)
}
OCFile("/encrypted/").apply {
remoteId = "00000005"
mimeType = MimeType.DIRECTORY
isEncrypted = true
decryptedRemotePath = "/encrypted/"
modificationTimestamp = 1614003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/locked/").apply {
remoteId = "00000006"
mimeType = MimeType.DIRECTORY
isLocked = true
decryptedRemotePath = "/locked/"
modificationTimestamp = 1613003571000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
OCFile("/offlineOperation/").apply {
mimeType = MimeType.DIRECTORY
decryptedRemotePath = "/offlineOperation/"
modificationTimestamp = System.currentTimeMillis()
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
sut.storageManager.saveFile(this)
}
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false)
fragment.adapter.setShowShareAvatar(true)
}
val screenShotName = createName(testClassName + "_" + "showFolderTypes", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
@Suppress("MagicNumber")
fun showRichWorkspace() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { sut ->
onIdleSync {
EspressoIdlingResource.increment()
var sut: TestActivity? = null
scenario.onActivity { testActivity ->
sut = testActivity
val fragment = OCFileListFragment()
val fragment = OCFileListFragment()
val folder = OCFile("/test/")
folder.setFolder()
sut.storageManager.saveFile(folder)
val folder = OCFile("/test/")
folder.setFolder()
sut.storageManager.saveFile(folder)
val imageFile = OCFile("/test/image.png").apply {
remoteId = "00000001"
mimeType = "image/png"
fileLength = 1024000
modificationTimestamp = 1188206955000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/test/").fileId
storagePath = getFile("java.md").absolutePath
}
sut.storageManager.saveFile(imageFile)
sut.addFragment(fragment)
val testFolder: OCFile = sut.storageManager.getFileByEncryptedRemotePath("/test/")
testFolder.richWorkspace = getFile("java.md").readText()
fragment.listDirectory(testFolder, false, false)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showRichWorkspace", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
val imageFile = OCFile("/test/image.png").apply {
remoteId = "00000001"
mimeType = "image/png"
fileLength = 1024000
modificationTimestamp = 1188206955000
parentId = sut.storageManager.getFileByEncryptedRemotePath("/test/").fileId
storagePath = getFile("java.md").absolutePath
}
sut.storageManager.saveFile(imageFile)
sut.addFragment(fragment)
sut.supportFragmentManager.executePendingTransactions()
val testFolder: OCFile = sut.storageManager.getFileByEncryptedRemotePath("/test/")
testFolder.richWorkspace = getFile("java.md").readText()
fragment.listDirectory(testFolder, false)
}
val screenShotName = createName(testClassName + "_" + "showRichWorkspace", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@UiThread
fun shouldShowHeader() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = OCFileListFragment()
val folder = OCFile("/test/").apply {
remoteId = "000001"
setFolder()
}
activity.storageManager.saveFile(folder)
activity.addFragment(sut)
val testFolder: OCFile = activity.storageManager.getFileByEncryptedRemotePath("/test/")
EspressoIdlingResource.decrement()
var activity: TestActivity? = null
val sut = OCFileListFragment()
// richWorkspace is not set
Assert.assertFalse(sut.adapter.shouldShowHeader())
EspressoIdlingResource.increment()
testFolder.richWorkspace = " "
activity.storageManager.saveFile(testFolder)
sut.adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
EspressoIdlingResource.decrement()
Assert.assertFalse(sut.adapter.shouldShowHeader())
EspressoIdlingResource.increment()
testFolder.richWorkspace = null
activity.storageManager.saveFile(testFolder)
sut.adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
EspressoIdlingResource.decrement()
Assert.assertFalse(sut.adapter.shouldShowHeader())
EspressoIdlingResource.increment()
testFolder.richWorkspace = "1"
activity.storageManager.saveFile(testFolder)
sut.adapter.setCurrentDirectory(testFolder)
EspressoIdlingResource.decrement()
Assert.assertTrue(sut.adapter.shouldShowHeader())
scenario.onActivity { testActivity ->
activity = testActivity
val folder = OCFile("/test/").apply {
remoteId = "000001"
setFolder()
}
activity.storageManager.saveFile(folder)
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
}
val testFolder: OCFile = activity!!.storageManager.getFileByEncryptedRemotePath("/test/")
// richWorkspace is not set
Assert.assertFalse(sut.adapter.shouldShowHeader())
testFolder.richWorkspace = " "
activity.storageManager.saveFile(testFolder)
sut.adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
Assert.assertFalse(sut.adapter.shouldShowHeader())
testFolder.richWorkspace = null
activity.storageManager.saveFile(testFolder)
sut.adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
Assert.assertFalse(sut.adapter.shouldShowHeader())
EspressoIdlingResource.increment()
testFolder.richWorkspace = "1"
activity.storageManager.saveFile(testFolder)
sut.adapter.setCurrentDirectory(testFolder)
Assert.assertTrue(sut.adapter.shouldShowHeader())
}
}
}
@@ -8,7 +8,6 @@
package com.owncloud.android.ui.fragment
import android.view.View
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
@@ -21,8 +20,10 @@ import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.resources.shares.OCShare
import com.owncloud.android.lib.resources.shares.ShareType
import com.owncloud.android.ui.adapter.OCShareToOCFileConverter
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import kotlinx.coroutines.runBlocking
import org.junit.After
import org.junit.Before
import org.junit.Rule
@@ -46,7 +47,6 @@ internal class SharedListFragmentIT : AbstractIT() {
var storagePermissionRule: TestRule = grant()
@Test
@UiThread
@ScreenshotTest
fun showSharedFiles() {
launchActivity<TestActivity>().use { scenario ->
@@ -165,14 +165,15 @@ internal class SharedListFragmentIT : AbstractIT() {
fragment.isLoading = false
fragment.mEmptyListContainer?.visibility = View.GONE
fragment.adapter.setData(
shares,
SearchType.SHARED_FILTER,
storageManager,
null,
true
)
val newList = runBlocking {
OCShareToOCFileConverter
.parseAndSaveShares(listOf(), shares, storageManager, user.accountName)
}
fragment.adapter.run {
prepareForSearchData(storageManager, SearchType.SHARED_FILTER)
updateAdapter(newList, null)
}
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showSharedFiles", "")
@@ -8,10 +8,8 @@
*/
package com.owncloud.android.ui.fragment
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
@@ -21,89 +19,67 @@ import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.SearchResultEntry
import com.owncloud.android.ui.unifiedsearch.UnifiedSearchSection
import com.owncloud.android.ui.unifiedsearch.UnifiedSearchViewModel
import com.owncloud.android.utils.EspressoIdlingResource
import org.junit.After
import org.junit.Before
import org.junit.Test
import java.io.File
class UnifiedSearchFragmentIT : AbstractIT() {
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
fun showSearchResult() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = UnifiedSearchFragment.newInstance(null, null, "/")
activity.addFragment(sut)
sut.onSearchResultChanged(
listOf(
UnifiedSearchSection(
providerID = "files",
name = "Files",
entries = listOf(
SearchResultEntry(
"thumbnailUrl",
"Test",
"in Files",
"http://localhost/nc/index.php/apps/files/?dir=/Files&scrollto=Test",
"icon",
false
)
),
hasMoreResults = false
)
scenario.onActivity { activity ->
val sut = UnifiedSearchFragment.newInstance(null, null, "/")
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
sut.onSearchResultChanged(
listOf(
UnifiedSearchSection(
providerID = "files",
name = "Files",
entries = listOf(
SearchResultEntry(
"thumbnailUrl",
"Test",
"in Files",
"http://localhost/nc/index.php/apps/files/?dir=/Files&scrollto=Test",
"icon",
false
)
),
hasMoreResults = false
)
)
EspressoIdlingResource.decrement()
onView(isRoot()).check(matches(isDisplayed()))
}
)
}
onView(isRoot()).check(matches(isDisplayed()))
}
}
@Test
@UiThread
fun search() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val sut = UnifiedSearchFragment.newInstance(null, null, "/")
val testViewModel = UnifiedSearchViewModel(activity.application)
testViewModel.setConnectivityService(activity.connectivityServiceMock)
val localRepository = UnifiedSearchFakeRepository()
testViewModel.setRepository(localRepository)
val ocFile = OCFile("/folder/test1.txt").apply {
storagePath = "/sdcard/1.txt"
storageManager.saveFile(this)
}
File(ocFile.storagePath).createNewFile()
activity.addFragment(sut)
sut.setViewModel(testViewModel)
sut.vm.setQuery("test")
sut.vm.initialQuery()
EspressoIdlingResource.decrement()
onView(isRoot()).check(matches(isDisplayed()))
val sut = UnifiedSearchFragment.newInstance(null, null, "/")
val testViewModel = UnifiedSearchViewModel(activity.application)
testViewModel.setConnectivityService(activity.connectivityServiceMock)
val localRepository = UnifiedSearchFakeRepository()
testViewModel.setRepository(localRepository)
val ocFile = OCFile("/folder/test1.txt").apply {
storagePath = "/sdcard/1.txt"
storageManager.saveFile(this)
}
File(ocFile.storagePath).createNewFile()
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
sut.setViewModel(testViewModel)
sut.vm.setQuery("test")
sut.vm.initialQuery()
}
onView(isRoot()).check(matches(isDisplayed()))
}
}
}
@@ -9,18 +9,13 @@
package com.owncloud.android.ui.preview
import android.content.Intent
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class PreviewBitmapScreenshotIT : AbstractIT() {
@@ -30,18 +25,7 @@ class PreviewBitmapScreenshotIT : AbstractIT() {
private const val PNG_FILE_ASSET = "imageFile.png"
}
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun showBitmap() {
val pngFile = getFile(PNG_FILE_ASSET)
@@ -51,12 +35,10 @@ class PreviewBitmapScreenshotIT : AbstractIT() {
)
launchActivity<PreviewBitmapActivity>(intent).use { scenario ->
val screenShotName = createName(testClassName + "_" + "showBitmap", "")
onView(isRoot()).check(matches(isDisplayed()))
scenario.onActivity { sut ->
onIdleSync {
val screenShotName = createName(testClassName + "_" + "showBitmap", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
screenshotViaName(sut, screenShotName)
}
}
}
@@ -6,84 +6,70 @@
*/
package com.owncloud.android.ui.preview
import androidx.annotation.UiThread
import android.Manifest
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.rule.GrantPermissionRule
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.MimeTypeUtil
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import java.io.IOException
class PreviewTextFileFragmentTest : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.preview.PreviewTextFileFragmentTest"
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.POST_NOTIFICATIONS
)
@Test
@ScreenshotTest
@UiThread
@Throws(IOException::class)
fun displaySimpleTextFile() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
var sut: FileDisplayActivity? = null
scenario.onActivity { activity ->
sut = activity
val test = OCFile("/text.md").apply {
mimeType = MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN
storagePath = getDummyFile("nonEmpty.txt").absolutePath
}
onIdleSync {
EspressoIdlingResource.increment()
sut.startTextPreview(test, true)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "displaySimpleTextFile", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.startTextPreview(test, true)
}
val screenShotName = createName(testClassName + "_" + "displaySimpleTextFile", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@ScreenshotTest
@UiThread
@Throws(IOException::class)
fun displayJavaSnippetFile() {
launchActivity<FileDisplayActivity>().use { scenario ->
scenario.onActivity { sut ->
var sut: FileDisplayActivity? = null
scenario.onActivity { activity ->
sut = activity
val test = OCFile("/java.md").apply {
mimeType = MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN
storagePath = getFile("java.md").absolutePath
}
onIdleSync {
EspressoIdlingResource.increment()
sut.startTextPreview(test, true)
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "displayJavaSnippetFile", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.startTextPreview(test, true)
}
val screenShotName = createName(testClassName + "_" + "displayJavaSnippetFile", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
}
@@ -8,20 +8,15 @@
*/
package com.owncloud.android.ui.preview.pdf
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.TestActivity
import com.owncloud.android.AbstractIT
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.utils.EspressoIdlingResource
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class PreviewPdfFragmentScreenshotIT : AbstractIT() {
@@ -31,40 +26,27 @@ class PreviewPdfFragmentScreenshotIT : AbstractIT() {
private const val PDF_FILE_ASSET = "test.pdf"
}
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun showPdf() {
launchActivity<TestActivity>().use { scenario ->
scenario.onActivity { activity ->
onIdleSync {
EspressoIdlingResource.increment()
val pdfFile = getFile(PDF_FILE_ASSET)
val ocFile = OCFile("/test.pdf").apply {
storagePath = pdfFile.absolutePath
}
val sut = PreviewPdfFragment.newInstance(ocFile)
activity.addFragment(sut)
sut.dismissSnack()
EspressoIdlingResource.decrement()
val screenShotName = createName(testClassName + "_" + "showPdf", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
var activity: TestActivity? = null
scenario.onActivity { testActivity ->
activity = testActivity
val pdfFile = getFile(PDF_FILE_ASSET)
val ocFile = OCFile("/test.pdf").apply {
storagePath = pdfFile.absolutePath
}
val sut = PreviewPdfFragment.newInstance(ocFile)
activity.addFragment(sut)
activity.supportFragmentManager.executePendingTransactions()
sut.dismissSnack()
}
val screenShotName = createName(testClassName + "_" + "showPdf", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(activity, screenShotName)
}
}
}
@@ -10,21 +10,15 @@ package com.owncloud.android.ui.trashbin
import android.accounts.Account
import android.accounts.AccountManager
import android.content.Intent
import androidx.annotation.UiThread
import androidx.test.core.app.launchActivity
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.IdlingRegistry
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.utils.EspressoIdlingResource
import com.owncloud.android.AbstractIT
import com.owncloud.android.MainApp
import com.owncloud.android.extensions.launchAndCapture
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.utils.ScreenshotTest
import org.junit.After
import org.junit.Before
import org.junit.Test
class TrashbinActivityIT : AbstractIT() {
@@ -36,90 +30,106 @@ class TrashbinActivityIT : AbstractIT() {
FILES
}
@Before
fun registerIdlingResource() {
IdlingRegistry.getInstance().register(EspressoIdlingResource.countingIdlingResource)
}
@After
fun unregisterIdlingResource() {
IdlingRegistry.getInstance().unregister(EspressoIdlingResource.countingIdlingResource)
}
@Test
@UiThread
@ScreenshotTest
fun error() {
launchActivity<TrashbinActivity>().use { scenario ->
scenario.onActivity { sut ->
var sut: TrashbinActivity? = null
scenario.onActivity { activity ->
sut = activity
val trashbinRepository = TrashbinLocalRepository(TestCase.ERROR)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
onIdleSync {
EspressoIdlingResource.increment()
sut.loadFolder(
onComplete = { EspressoIdlingResource.decrement() },
onError = { EspressoIdlingResource.decrement() }
)
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
sut.loadFolder(
onComplete = { },
onError = { }
)
}
val screenShotName = createName(testClassName + "_" + "error", "")
onView(isRoot()).check(matches(isDisplayed()))
screenshotViaName(sut, screenShotName)
}
}
@Test
@UiThread
@ScreenshotTest
fun files() {
launchAndCapture<TrashbinActivity>(testClassName, "files", before = { sut ->
val trashbinRepository = TrashbinLocalRepository(TestCase.FILES)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.loadFolder(
onComplete = { EspressoIdlingResource.decrement() },
onError = { EspressoIdlingResource.decrement() }
)
})
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
@UiThread
@ScreenshotTest
fun empty() {
launchAndCapture<TrashbinActivity>(testClassName, "empty", before = { sut ->
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.loadFolder(
onComplete = { EspressoIdlingResource.decrement() },
onError = { EspressoIdlingResource.decrement() }
)
})
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
@UiThread
@ScreenshotTest
fun loading() {
launchAndCapture<TrashbinActivity>(testClassName, "loading", before = { sut ->
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.showInitialLoading()
})
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
@UiThread
@ScreenshotTest
fun normalUser() {
launchAndCapture<TrashbinActivity>(testClassName, "normalUser", before = { sut ->
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.showUser()
})
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
@UiThread
@ScreenshotTest
fun differentUser() {
val temp = Account("differentUser@https://nextcloud.localhost", MainApp.getAccountType(targetContext))
@@ -134,10 +144,18 @@ class TrashbinActivityIT : AbstractIT() {
putExtra(Intent.EXTRA_USER, "differentUser@https://nextcloud.localhost")
}
launchAndCapture<TrashbinActivity>(testClassName, "differentUser", intent = intent, before = { sut ->
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
sut.showUser()
})
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)
}
}
}
@@ -25,8 +25,8 @@ import com.owncloud.android.datamodel.e2e.v1.decrypted.Encrypted;
import com.owncloud.android.datamodel.e2e.v1.encrypted.EncryptedFolderMetadataFileV1;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.e2ee.CsrHelper;
import com.owncloud.android.utils.crypto.CryptoHelper;
import com.owncloud.android.utils.EncryptionUtils;
import com.owncloud.android.utils.crypto.CryptoHelper;
import org.junit.Assert;
import org.junit.Rule;
@@ -75,10 +75,10 @@ import static com.owncloud.android.utils.EncryptionUtils.serializeJSON;
import static com.owncloud.android.utils.EncryptionUtils.verifySHA512;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertArrayEquals;
public class EncryptionTestIT extends AbstractIT {
@Rule public RetryTestRule retryTestRule = new RetryTestRule();
@@ -32,6 +32,14 @@ class CapabilityUtilsIT : AbstractIT() {
assertTrue(test(OwnCloudVersion.nextcloud_20))
}
private fun test(version: OwnCloudVersion): Boolean =
CapabilityUtils.checkOutdatedWarning(targetContext.resources, version, false)
@Test
fun checkOutdatedWarningWithSubscription() {
assertFalse(test(NextcloudVersion.nextcloud_31))
assertFalse(test(NextcloudVersion.nextcloud_30))
assertFalse(test(OwnCloudVersion.nextcloud_20, true))
}
private fun test(version: OwnCloudVersion, hasValidSubscription: Boolean = false): Boolean =
CapabilityUtils.checkOutdatedWarning(targetContext.resources, version, false, hasValidSubscription)
}
+40 -19
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2024 TSI-mc <surinder.kumar@t-systems.com>
@@ -53,8 +52,10 @@
must request the FOREGROUND_SERVICE permission
-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- Runtime permissions introduced in Android 13 (API level 33) -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <!-- Needed for Android 14 (API level 34) -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"
tools:ignore="PhotoAndVideoPolicy,SelectedPhotoAccess" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"
tools:ignore="PhotoAndVideoPolicy,SelectedPhotoAccess" /> <!-- Needed for Android 14 (API level 34) -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<!--
@@ -112,22 +113,24 @@
android:name=".MainApp"
android:allowBackup="false"
android:dataExtractionRules="@xml/backup_rules"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="@xml/backup_config"
android:icon="@mipmap/ic_launcher"
android:installLocation="internalOnly"
android:label="@string/app_name"
android:manageSpaceActivity="com.owncloud.android.ui.activity.ManageSpaceActivity"
android:memtagMode="async"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:enableOnBackInvokedCallback="false"
android:theme="@style/Theme.ownCloud.Toolbar"
android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute"
tools:replace="android:allowBackup">
<meta-data android:name="android.content.APP_RESTRICTIONS"
<meta-data
android:name="android.content.APP_RESTRICTIONS"
android:resource="@xml/app_config" />
<activity
@@ -159,7 +162,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -169,7 +174,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -179,7 +186,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/..*/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -189,7 +198,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/..*/..*/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -199,7 +210,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -209,7 +222,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -219,7 +234,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/..*/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
@@ -229,7 +246,9 @@
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data
android:host="*"
tools:ignore="AppLinkUrlError" />
<data android:pathPattern="/..*/..*/..*/f/..*" />
<!-- path pattern to handle deep link -->
<data android:pathPattern="/app/..*" />
@@ -284,9 +303,6 @@
<receiver
android:name="com.nextcloud.client.jobs.NotificationWork$NotificationReceiver"
android:exported="false" />
<receiver
android:name="com.nextcloud.client.jobs.upload.FileUploadHelper$UploadNotificationActionReceiver"
android:exported="false" />
<receiver
android:name="com.nextcloud.client.widget.DashboardWidgetProvider"
android:exported="false">
@@ -352,6 +368,7 @@
</activity>
<activity
android:name=".ui.activity.SettingsActivity"
android:enableOnBackInvokedCallback="false"
android:exported="false"
android:theme="@style/PreferenceTheme" />
<activity
@@ -366,11 +383,11 @@
<service
android:name="com.nextcloud.client.media.BackgroundPlayerService"
android:foregroundServiceType="mediaPlayback"
android:exported="true"
android:foregroundServiceType="mediaPlayback"
tools:ignore="ExportedService">
<intent-filter>
<action android:name="androidx.media3.session.MediaSessionService"/>
<action android:name="androidx.media3.session.MediaSessionService" />
</intent-filter>
</service>
@@ -584,6 +601,10 @@
</intent-filter>
</receiver>
<receiver
android:name="com.nextcloud.client.jobs.folderDownload.FolderDownloadWorkerReceiver"
android:exported="false" />
<activity
android:name=".ui.activity.CopyToClipboardActivity"
android:exported="false"
@@ -95,7 +95,7 @@ public interface UserAccountManager extends CurrentAccountProvider {
boolean setCurrentOwnCloudAccount(String accountName);
boolean setCurrentOwnCloudAccount(int hashCode);
boolean setCurrentOwnCloudAccount(User user);
/**
* Access the version of the OC server corresponding to an account SAVED IN THE ACCOUNTMANAGER
@@ -346,11 +346,11 @@ public class UserAccountManagerImpl implements UserAccountManager {
}
@Override
public boolean setCurrentOwnCloudAccount(int hashCode) {
public boolean setCurrentOwnCloudAccount(User chosenUser) {
boolean result = false;
if (hashCode != 0) {
if (chosenUser != null) {
for (final User user : getAllUsers()) {
if (hashCode == user.hashCode()) {
if (chosenUser.nameEquals(user)) {
SharedPreferences.Editor appPrefs = PreferenceManager.getDefaultSharedPreferences(context).edit();
appPrefs.putString(PREF_SELECT_OC_ACCOUNT, user.getAccountName());
appPrefs.apply();
@@ -0,0 +1,461 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.assistant
import android.app.Activity
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.pulltorefresh.pullToRefresh
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.nextcloud.client.assistant.chat.ChatContent
import com.nextcloud.client.assistant.conversation.ConversationScreen
import com.nextcloud.client.assistant.conversation.ConversationViewModel
import com.nextcloud.client.assistant.conversation.repository.MockConversationRemoteRepository
import com.nextcloud.client.assistant.extensions.getInputTitle
import com.nextcloud.client.assistant.model.AssistantScreenState
import com.nextcloud.client.assistant.model.ScreenOverlayState
import com.nextcloud.client.assistant.repository.local.MockAssistantLocalRepository
import com.nextcloud.client.assistant.repository.remote.MockAssistantRemoteRepository
import com.nextcloud.client.assistant.task.TaskView
import com.nextcloud.client.assistant.taskTypes.TaskTypesRow
import com.nextcloud.ui.composeActivity.ComposeActivity
import com.nextcloud.ui.composeComponents.alertDialog.SimpleAlertDialog
import com.nextcloud.ui.composeComponents.bottomSheet.MoreActionsBottomSheet
import com.nextcloud.utils.extensions.getChat
import com.owncloud.android.R
import com.owncloud.android.lib.resources.assistant.v2.model.Task
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData
import com.owncloud.android.lib.resources.status.OCCapability
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
private const val CHAT_INPUT_DELAY = 100L
private const val PULL_TO_REFRESH_DELAY = 1500L
@Suppress("LongMethod")
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun AssistantScreen(
viewModel: AssistantViewModel,
conversationViewModel: ConversationViewModel,
capability: OCCapability,
activity: Activity
) {
val sessionId by viewModel.sessionId.collectAsState()
val messageId by viewModel.snackbarMessageId.collectAsState()
val screenOverlayState by viewModel.screenOverlayState.collectAsState()
val selectedTaskType by viewModel.selectedTaskType.collectAsState()
val filteredTaskList by viewModel.filteredTaskList.collectAsState()
val screenState by viewModel.screenState.collectAsState()
val taskTypes by viewModel.taskTypes.collectAsState()
val scope = rememberCoroutineScope()
val pullRefreshState = rememberPullToRefreshState()
val snackbarHostState = remember { SnackbarHostState() }
val pagerState = rememberPagerState(initialPage = 1, pageCount = { 2 })
LaunchedEffect(messageId) {
messageId?.let {
snackbarHostState.showSnackbar(activity.getString(it))
viewModel.updateSnackbarMessage(null)
}
}
LaunchedEffect(sessionId) {
viewModel.startPolling(sessionId)
sessionId?.let {
viewModel.fetchChatMessages(it)
}
}
DisposableEffect(Unit) {
onDispose {
viewModel.stopPolling()
}
}
HorizontalPager(
state = pagerState,
userScrollEnabled = taskTypes.getChat() != null
) { page ->
when (page) {
0 -> {
ConversationScreen(viewModel = conversationViewModel, close = {
scope.launch {
pagerState.scrollToPage(1)
}
}, openChat = { newSessionId ->
viewModel.initSessionId(newSessionId)
taskTypes.getChat()?.let { chatTaskType ->
viewModel.selectTaskType(chatTaskType)
}
scope.launch {
pagerState.scrollToPage(1)
}
})
}
1 -> {
Scaffold(
modifier = Modifier.pullToRefresh(
false,
pullRefreshState,
onRefresh = {
scope.launch {
delay(PULL_TO_REFRESH_DELAY)
val newSessionId = sessionId
if (newSessionId != null) {
viewModel.fetchChatMessages(newSessionId)
} else {
viewModel.fetchTaskList()
}
}
}
),
topBar = {
taskTypes?.let {
TaskTypesRow(selectedTaskType, data = it, selectTaskType = { task ->
viewModel.selectTaskType(task)
}, navigateToConversationList = {
scope.launch {
pagerState.scrollToPage(0)
}
})
}
},
bottomBar = {
if (!taskTypes.isNullOrEmpty()) {
ChatInputBar(
sessionId,
selectedTaskType,
viewModel
)
}
},
snackbarHost = {
SnackbarHost(snackbarHostState)
}
) { paddingValues ->
when (screenState) {
is AssistantScreenState.EmptyContent -> {
val state = (screenState as AssistantScreenState.EmptyContent)
EmptyContent(
paddingValues,
iconId = state.iconId,
descriptionId = state.descriptionId,
titleId = state.titleId
)
}
AssistantScreenState.TaskContent -> {
TaskContent(
paddingValues,
filteredTaskList ?: listOf(),
viewModel,
capability
)
}
AssistantScreenState.ChatContent -> {
ChatContent(
viewModel = viewModel,
modifier = Modifier.padding(paddingValues)
)
}
else -> EmptyContent(
paddingValues,
iconId = R.drawable.spinner_inner,
titleId = null,
descriptionId = R.string.common_loading
)
}
LinearProgressIndicator(
progress = { pullRefreshState.distanceFraction },
modifier = Modifier.fillMaxWidth()
)
OverlayState(screenOverlayState, activity, viewModel)
}
}
}
}
}
@Suppress("LongMethod")
@Composable
private fun ChatInputBar(sessionId: Long?, selectedTaskType: TaskTypeData?, viewModel: AssistantViewModel) {
val scope = rememberCoroutineScope()
var text by remember { mutableStateOf("") }
Surface(
tonalElevation = 3.dp,
shadowElevation = 4.dp,
color = MaterialTheme.colorScheme.surface
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = stringResource(R.string.assistant_output_generation_warning_text),
fontSize = 11.sp,
textAlign = TextAlign.Center,
color = colorResource(R.color.text_color)
)
Spacer(modifier = Modifier.height(8.dp))
Row(
modifier = Modifier
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
OutlinedTextField(
value = text,
onValueChange = { text = it },
modifier = Modifier
.weight(1f)
.padding(end = 8.dp),
placeholder = { Text(selectedTaskType?.description ?: "") },
singleLine = true
)
IconButton(
onClick = {
if (text.isBlank()) {
return@IconButton
}
val taskType = selectedTaskType ?: return@IconButton
if (taskType.isChat()) {
if (sessionId != null) {
viewModel.sendChatMessage(content = text, sessionId)
} else {
viewModel.createConversation(text)
}
} else {
viewModel.createTask(input = text, taskType = taskType)
}
scope.launch {
delay(CHAT_INPUT_DELAY)
text = ""
}
}
) {
Icon(
painter = painterResource(id = R.drawable.ic_send),
contentDescription = "Send message",
tint = MaterialTheme.colorScheme.primary
)
}
}
}
}
}
@Suppress("LongMethod")
@Composable
private fun OverlayState(state: ScreenOverlayState?, activity: Activity, viewModel: AssistantViewModel) {
when (state) {
is ScreenOverlayState.DeleteTask -> {
SimpleAlertDialog(
title = stringResource(id = R.string.assistant_screen_delete_task_alert_dialog_title),
description = stringResource(id = R.string.assistant_screen_delete_task_alert_dialog_description),
dismiss = { viewModel.updateScreenOverlayState(null) },
onComplete = { viewModel.deleteTask(state.id) }
)
}
is ScreenOverlayState.TaskActions -> {
val actions = state.getActions(activity, onDeleteCompleted = { deleteTask ->
viewModel.updateScreenOverlayState(deleteTask)
})
MoreActionsBottomSheet(
title = state.task.getInputTitle(),
actions = actions,
dismiss = { viewModel.updateScreenOverlayState(null) }
)
}
else -> Unit
}
}
@Composable
private fun TaskContent(
paddingValues: PaddingValues,
taskList: List<Task>,
viewModel: AssistantViewModel,
capability: OCCapability
) {
LazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
.padding(12.dp),
verticalArrangement = Arrangement.Top,
horizontalAlignment = Alignment.CenterHorizontally
) {
items(taskList, key = { it.id }) { task ->
TaskView(
task,
capability,
showTaskActions = {
val newState = ScreenOverlayState.TaskActions(task)
viewModel.updateScreenOverlayState(newState)
}
)
Spacer(modifier = Modifier.height(8.dp))
}
}
}
@Composable
private fun EmptyContent(paddingValues: PaddingValues, iconId: Int?, descriptionId: Int?, titleId: Int?) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
.padding(16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
iconId?.let {
Image(
painter = painterResource(id = iconId),
modifier = Modifier.size(32.dp),
colorFilter = ColorFilter.tint(color = colorResource(R.color.text_color)),
contentDescription = "empty content icon"
)
Spacer(modifier = Modifier.height(8.dp))
}
titleId?.let {
Text(
text = stringResource(titleId),
style = MaterialTheme.typography.headlineSmall,
textAlign = TextAlign.Center,
color = colorResource(R.color.text_color)
)
Spacer(modifier = Modifier.height(8.dp))
}
descriptionId?.let {
Text(
text = stringResource(descriptionId),
style = MaterialTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
color = colorResource(R.color.text_color)
)
}
}
}
@Suppress("MagicNumber")
@Composable
@Preview
private fun AssistantScreenPreview() {
MaterialTheme(
content = {
AssistantScreen(
conversationViewModel = getMockConversationViewModel(),
viewModel = getMockAssistantViewModel(false),
activity = ComposeActivity(),
capability = OCCapability().apply {
versionMayor = 30
}
)
}
)
}
@Suppress("MagicNumber")
@Composable
@Preview
private fun AssistantEmptyScreenPreview() {
MaterialTheme(
content = {
AssistantScreen(
conversationViewModel = getMockConversationViewModel(),
viewModel = getMockAssistantViewModel(true),
activity = ComposeActivity(),
capability = OCCapability().apply {
versionMayor = 30
}
)
}
)
}
private fun getMockConversationViewModel(): ConversationViewModel {
val mockRemoteRepository = MockConversationRemoteRepository()
return ConversationViewModel(
remoteRepository = mockRemoteRepository
)
}
private fun getMockAssistantViewModel(giveEmptyTasks: Boolean): AssistantViewModel {
val mockLocalRepository = MockAssistantLocalRepository()
val mockRemoteRepository = MockAssistantRemoteRepository(giveEmptyTasks)
return AssistantViewModel(
accountName = "test:localhost",
remoteRepository = mockRemoteRepository,
localRepository = mockLocalRepository,
sessionIdArg = null
)
}
@@ -9,27 +9,50 @@ package com.nextcloud.client.assistant
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.nextcloud.client.assistant.model.AssistantScreenState
import com.nextcloud.client.assistant.model.ScreenOverlayState
import com.nextcloud.client.assistant.model.ScreenState
import com.nextcloud.client.assistant.repository.AssistantRepositoryType
import com.nextcloud.client.assistant.repository.local.AssistantLocalRepository
import com.nextcloud.client.assistant.repository.remote.AssistantRemoteRepository
import com.nextcloud.utils.TimeConstants.MILLIS_PER_SECOND
import com.nextcloud.utils.extensions.isHuman
import com.owncloud.android.R
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.assistant.chat.model.ChatMessage
import com.owncloud.android.lib.resources.assistant.chat.model.ChatMessageRequest
import com.owncloud.android.lib.resources.assistant.v2.model.Task
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
class AssistantViewModel(private val repository: AssistantRepositoryType) : ViewModel() {
@Suppress("TooManyFunctions")
class AssistantViewModel(
private val accountName: String,
private val remoteRepository: AssistantRemoteRepository,
private val localRepository: AssistantLocalRepository,
sessionIdArg: Long?
) : ViewModel() {
private val _screenState = MutableStateFlow<ScreenState?>(null)
val screenState: StateFlow<ScreenState?> = _screenState
companion object {
private const val TAG = "AssistantViewModel"
private const val POLLING_INTERVAL_MS = 15_000L
}
private val _screenState = MutableStateFlow<AssistantScreenState?>(null)
val screenState: StateFlow<AssistantScreenState?> = _screenState
private val _screenOverlayState = MutableStateFlow<ScreenOverlayState?>(null)
val screenOverlayState: StateFlow<ScreenOverlayState?> = _screenOverlayState
private val _sessionId = MutableStateFlow(sessionIdArg)
val sessionId: StateFlow<Long?> = _sessionId
private val _snackbarMessageId = MutableStateFlow<Int?>(null)
val snackbarMessageId: StateFlow<Int?> = _snackbarMessageId
@@ -44,107 +67,238 @@ class AssistantViewModel(private val repository: AssistantRepositoryType) : View
private val _filteredTaskList = MutableStateFlow<List<Task>?>(null)
val filteredTaskList: StateFlow<List<Task>?> = _filteredTaskList
private val _chatMessages = MutableStateFlow<List<ChatMessage>>(listOf())
val chatMessages: StateFlow<List<ChatMessage>> = _chatMessages
private val _isAssistantAnswering = MutableStateFlow(false)
val isAssistantAnswering: StateFlow<Boolean> = _isAssistantAnswering
private var pollingJob: Job? = null
private var currentChatTaskId: String? = null
init {
observeScreenState()
fetchTaskTypes()
}
@Suppress("MagicNumber")
fun createTask(input: String, taskType: TaskTypeData) {
viewModelScope.launch(Dispatchers.IO) {
val result = repository.createTask(input, taskType)
// region task polling
fun startPolling(sessionId: Long?) {
stopPolling()
val messageId = if (result.isSuccess) {
R.string.assistant_screen_task_create_success_message
} else {
R.string.assistant_screen_task_create_fail_message
pollingJob = viewModelScope.launch(Dispatchers.IO) {
try {
while (isActive) {
delay(POLLING_INTERVAL_MS)
val taskType = _selectedTaskType.value ?: continue
if (taskType.isChat() && sessionId != null) {
Log_OC.d(TAG, "Polling chat messages, sessionId: $sessionId")
if (currentChatTaskId == null) {
remoteRepository.generateSession(sessionId.toString())?.let {
currentChatTaskId = it.taskId.toString()
}
}
fetchNewChatMessage(sessionId)
} else if (!taskType.isChat()) {
Log_OC.d(TAG, "Polling task list")
pollTaskList()
}
}
} finally {
Log_OC.d(TAG, "Polling cancelled, sessionId: $sessionId")
}
}
}
fun stopPolling() {
pollingJob?.cancel()
pollingJob = null
}
// endregion
private suspend fun pollTaskList() {
val cachedTasks = localRepository.getCachedTasks(accountName)
if (cachedTasks.isNotEmpty()) {
_filteredTaskList.value = cachedTasks.sortedByDescending { it.id }
}
val taskType = _selectedTaskType.value?.id ?: return
val result = remoteRepository.getTaskList(taskType)
if (result != null) {
taskList = result
_filteredTaskList.value = taskList?.sortedByDescending { it.id }
localRepository.cacheTasks(result, accountName)
}
}
fun fetchNewChatMessage(sessionId: Long) = viewModelScope.launch(Dispatchers.IO) {
val taskId = currentChatTaskId ?: return@launch
val newMessage = remoteRepository.checkGeneration(taskId, sessionId.toString()) ?: return@launch
_chatMessages.update { current ->
val messageExists = current.any {
it.id == newMessage.id ||
(it.timestamp == newMessage.timestamp && it.content == newMessage.content)
}
updateSnackbarMessage(messageId)
if (messageExists) {
current
} else {
if (!newMessage.isHuman()) {
_isAssistantAnswering.update {
false
}
}
current + newMessage
}
}
}
delay(2000L)
private fun observeScreenState() {
viewModelScope.launch {
combine(
_selectedTaskType,
_chatMessages,
_filteredTaskList
) { selectedTask, chats, tasks ->
val isChat = selectedTask?.isChat() == true
when {
selectedTask == null -> AssistantScreenState.Loading
isChat && chats.isEmpty() -> AssistantScreenState.emptyChatList()
isChat -> AssistantScreenState.ChatContent
!isChat && (tasks == null || tasks.isEmpty()) -> AssistantScreenState.emptyTaskList()
else -> AssistantScreenState.TaskContent
}
}.collect { newState ->
_screenState.value = newState
}
}
}
// region chat
fun sendChatMessage(content: String, sessionId: Long) = viewModelScope.launch(Dispatchers.IO) {
val request = ChatMessageRequest(
sessionId = sessionId.toString(),
role = "human",
content = content,
timestamp = System.currentTimeMillis() / MILLIS_PER_SECOND,
firstHumanMessage = _chatMessages.value.isEmpty()
)
remoteRepository.sendChatMessage(request)?.let { newMessage ->
_chatMessages.update { messages ->
messages + newMessage
}
_isAssistantAnswering.update {
true
}
} ?: updateSnackbarMessage(R.string.assistant_screen_chat_create_error)
}
fun fetchChatMessages(sessionId: Long) = viewModelScope.launch(Dispatchers.IO) {
remoteRepository.fetchChatMessages(sessionId)?.let { messageList ->
_chatMessages.update {
messageList
}
} ?: updateSnackbarMessage(R.string.assistant_screen_chat_fetch_error)
}
fun createConversation(title: String) = viewModelScope.launch(Dispatchers.IO) {
remoteRepository.createConversation(title)?.let { result ->
initSessionId(result.session.id)
sendChatMessage(title, result.session.id)
}
}
fun initSessionId(value: Long) {
Log_OC.d(TAG, "session id updated: $value")
currentChatTaskId = null
_sessionId.update { value }
}
// endregion
// region task
fun createTask(input: String, taskType: TaskTypeData) = viewModelScope.launch(Dispatchers.IO) {
val result = remoteRepository.createTask(input, taskType)
val message = if (result.isSuccess) {
R.string.assistant_screen_task_create_success_message
} else {
R.string.assistant_screen_task_create_fail_message
}
updateSnackbarMessage(message)
delay(MILLIS_PER_SECOND * 2L)
fetchTaskList()
}
fun selectTaskType(task: TaskTypeData) {
Log_OC.d(TAG, "Task type changed: ${task.name}, session id: ${_sessionId.value}")
updateTaskType(task)
val sessionId = _sessionId.value ?: return
if (task.isChat()) {
if (_chatMessages.value.isEmpty()) {
fetchChatMessages(sessionId)
} else {
fetchNewChatMessage(sessionId)
}
} else {
fetchTaskList()
}
}
fun selectTaskType(task: TaskTypeData) {
_selectedTaskType.update {
task
private fun fetchTaskTypes() = viewModelScope.launch(Dispatchers.IO) {
val result = remoteRepository.getTaskTypes()
if (result.isNullOrEmpty()) {
_screenState.value = AssistantScreenState.emptyTaskTypes()
return@launch
}
fetchTaskList()
}
private fun fetchTaskTypes() {
viewModelScope.launch(Dispatchers.IO) {
val taskTypesResult = repository.getTaskTypes()
if (taskTypesResult == null) {
updateSnackbarMessage(R.string.assistant_screen_task_types_error_state_message)
return@launch
}
if (taskTypesResult.isEmpty()) {
updateSnackbarMessage(R.string.assistant_screen_task_list_empty_message)
return@launch
}
_taskTypes.update {
taskTypesResult
}
selectTaskType(taskTypesResult.first())
_taskTypes.update {
result
}
selectTaskType(result.first())
}
fun fetchTaskList() {
viewModelScope.launch(Dispatchers.IO) {
_screenState.update {
ScreenState.Refreshing
}
fun fetchTaskList() = viewModelScope.launch(Dispatchers.IO) {
val cached = localRepository.getCachedTasks(accountName)
if (cached.isNotEmpty()) {
_filteredTaskList.value = cached.sortedByDescending { it.id }
}
val taskType = _selectedTaskType.value?.id ?: return@launch
val result = repository.getTaskList(taskType)
if (result != null) {
_selectedTaskType.value?.id?.let { typeId ->
remoteRepository.getTaskList(typeId)?.let { result ->
taskList = result
_filteredTaskList.update {
taskList?.sortedByDescending { task ->
task.id
}
}
_filteredTaskList.value = result.sortedByDescending { it.id }
localRepository.cacheTasks(result, accountName)
updateSnackbarMessage(null)
} else {
updateSnackbarMessage(R.string.assistant_screen_task_list_error_state_message)
}
updateScreenState()
} ?: updateSnackbarMessage(R.string.assistant_screen_task_list_error_state_message)
}
}
private fun updateScreenState() {
_screenState.update {
if (_filteredTaskList.value?.isEmpty() == true) {
ScreenState.EmptyContent
} else {
ScreenState.Content
}
fun deleteTask(id: Long) = viewModelScope.launch(Dispatchers.IO) {
val result = remoteRepository.deleteTask(id)
val message = if (result.isSuccess) {
R.string.assistant_screen_task_delete_success_message
} else {
R.string.assistant_screen_task_delete_fail_message
}
updateSnackbarMessage(message)
if (result.isSuccess) {
removeTaskFromList(id)
localRepository.deleteTask(id, accountName)
}
}
// endregion
fun deleteTask(id: Long) {
viewModelScope.launch(Dispatchers.IO) {
val result = repository.deleteTask(id)
val messageId = if (result.isSuccess) {
R.string.assistant_screen_task_delete_success_message
} else {
R.string.assistant_screen_task_delete_fail_message
}
updateSnackbarMessage(messageId)
if (result.isSuccess) {
removeTaskFromList(id)
}
private fun updateTaskType(value: TaskTypeData) {
_selectedTaskType.update {
value
}
}
@@ -154,7 +308,7 @@ class AssistantViewModel(private val repository: AssistantRepositoryType) : View
}
}
fun updateScreenState(value: ScreenOverlayState?) {
fun updateScreenOverlayState(value: ScreenOverlayState?) {
_screenOverlayState.update {
value
}
@@ -1,320 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.assistant
import android.app.Activity
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.pulltorefresh.PullToRefreshState
import androidx.compose.material3.pulltorefresh.pullToRefresh
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.nextcloud.client.assistant.component.AddTaskAlertDialog
import com.nextcloud.client.assistant.component.CenterText
import com.nextcloud.client.assistant.extensions.getInputTitle
import com.nextcloud.client.assistant.model.ScreenOverlayState
import com.nextcloud.client.assistant.model.ScreenState
import com.nextcloud.client.assistant.repository.AssistantMockRepository
import com.nextcloud.client.assistant.task.TaskView
import com.nextcloud.client.assistant.taskTypes.TaskTypesRow
import com.nextcloud.ui.composeActivity.ComposeActivity
import com.nextcloud.ui.composeComponents.alertDialog.SimpleAlertDialog
import com.nextcloud.ui.composeComponents.bottomSheet.MoreActionsBottomSheet
import com.owncloud.android.R
import com.owncloud.android.lib.resources.assistant.v2.model.Task
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.utils.DisplayUtils
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@Suppress("LongMethod")
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun AssistantScreen(viewModel: AssistantViewModel, capability: OCCapability, activity: Activity) {
val messageId by viewModel.snackbarMessageId.collectAsState()
val screenOverlayState by viewModel.screenOverlayState.collectAsState()
val selectedTaskType by viewModel.selectedTaskType.collectAsState()
val filteredTaskList by viewModel.filteredTaskList.collectAsState()
val screenState by viewModel.screenState.collectAsState()
val taskTypes by viewModel.taskTypes.collectAsState()
val scope = rememberCoroutineScope()
val pullRefreshState = rememberPullToRefreshState()
@Suppress("MagicNumber")
Box(
modifier = Modifier.pullToRefresh(
screenState == ScreenState.Refreshing,
pullRefreshState,
onRefresh = {
scope.launch {
delay(1500)
viewModel.fetchTaskList()
}
}
)
) {
ShowScreenState(screenState, selectedTaskType, taskTypes, viewModel, filteredTaskList, capability)
ShowLinearProgressIndicator(screenState, pullRefreshState)
AddFloatingActionButton(
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(16.dp),
selectedTaskType,
viewModel
)
}
showSnackBarMessage(messageId, activity, viewModel)
ShowOverlayState(screenOverlayState, activity, viewModel)
}
@Composable
private fun ShowScreenState(
screenState: ScreenState?,
selectedTaskType: TaskTypeData?,
taskTypes: List<TaskTypeData>?,
viewModel: AssistantViewModel,
filteredTaskList: List<Task>?,
capability: OCCapability
) {
when (screenState) {
ScreenState.Refreshing -> {
CenterText(text = stringResource(id = R.string.assistant_screen_loading))
}
ScreenState.EmptyContent -> {
EmptyTaskList(selectedTaskType, taskTypes, viewModel)
}
ScreenState.Content -> {
AssistantContent(
filteredTaskList ?: listOf(),
taskTypes,
selectedTaskType,
viewModel,
capability
)
}
null -> Unit
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun ShowLinearProgressIndicator(screenState: ScreenState?, pullToRefreshState: PullToRefreshState) {
if (screenState == ScreenState.Refreshing) {
LinearProgressIndicator(modifier = Modifier.fillMaxWidth())
} else {
LinearProgressIndicator(
progress = { pullToRefreshState.distanceFraction },
modifier = Modifier.fillMaxWidth()
)
}
}
@Composable
private fun AddFloatingActionButton(
modifier: Modifier,
selectedTaskType: TaskTypeData?,
viewModel: AssistantViewModel
) {
FloatingActionButton(
modifier = modifier,
onClick = {
selectedTaskType?.let {
val newState = ScreenOverlayState.AddTask(it, "")
viewModel.updateScreenState(newState)
}
}
) {
Icon(Icons.Filled.Add, "Add Task Icon")
}
}
private fun showSnackBarMessage(messageId: Int?, activity: Activity, viewModel: AssistantViewModel) {
messageId?.let {
DisplayUtils.showSnackMessage(
activity,
activity.getString(it)
)
viewModel.updateSnackbarMessage(null)
}
}
@Suppress("LongMethod")
@Composable
private fun ShowOverlayState(state: ScreenOverlayState?, activity: Activity, viewModel: AssistantViewModel) {
when (state) {
is ScreenOverlayState.AddTask -> {
AddTaskAlertDialog(
title = state.taskType.name,
description = state.taskType.description,
defaultInput = state.input,
addTask = { input ->
state.taskType.let { taskType ->
viewModel.createTask(input = input, taskType = taskType)
}
},
dismiss = {
viewModel.updateScreenState(null)
}
)
}
is ScreenOverlayState.DeleteTask -> {
SimpleAlertDialog(
title = stringResource(id = R.string.assistant_screen_delete_task_alert_dialog_title),
description = stringResource(id = R.string.assistant_screen_delete_task_alert_dialog_description),
dismiss = { viewModel.updateScreenState(null) },
onComplete = { viewModel.deleteTask(state.id) }
)
}
is ScreenOverlayState.TaskActions -> {
val actions = state.getActions(activity, onEditCompleted = { addTask ->
viewModel.updateScreenState(addTask)
}, onDeleteCompleted = { deleteTask ->
viewModel.updateScreenState(deleteTask)
})
MoreActionsBottomSheet(
title = state.task.getInputTitle(),
actions = actions,
dismiss = { viewModel.updateScreenState(null) }
)
}
else -> Unit
}
}
@Composable
private fun AssistantContent(
taskList: List<Task>,
taskTypes: List<TaskTypeData>?,
selectedTaskType: TaskTypeData?,
viewModel: AssistantViewModel,
capability: OCCapability
) {
Column(modifier = Modifier.fillMaxSize()) {
taskTypes?.let {
TaskTypesRow(selectedTaskType, data = taskTypes) { task ->
viewModel.selectTaskType(task)
}
}
LazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(12.dp)
) {
items(taskList) { task ->
TaskView(
task,
capability,
showTaskActions = {
val newState = ScreenOverlayState.TaskActions(task)
viewModel.updateScreenState(newState)
}
)
Spacer(modifier = Modifier.height(8.dp))
}
}
}
}
@Composable
private fun EmptyTaskList(
selectedTaskType: TaskTypeData?,
taskTypes: List<TaskTypeData>?,
viewModel: AssistantViewModel
) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp)
) {
taskTypes?.let {
TaskTypesRow(selectedTaskType, data = taskTypes) { task ->
viewModel.selectTaskType(task)
}
Spacer(modifier = Modifier.height(8.dp))
}
CenterText(
text = stringResource(
id = R.string.assistant_screen_create_a_new_task_from_bottom_right_text
)
)
}
}
@Suppress("MagicNumber")
@Composable
@Preview
private fun AssistantScreenPreview() {
val mockRepository = AssistantMockRepository()
MaterialTheme(
content = {
AssistantScreen(
viewModel = AssistantViewModel(repository = mockRepository),
activity = ComposeActivity(),
capability = OCCapability().apply {
versionMayor = 30
}
)
}
)
}
@Suppress("MagicNumber")
@Composable
@Preview
private fun AssistantEmptyScreenPreview() {
val mockRepository = AssistantMockRepository(giveEmptyTasks = true)
MaterialTheme(
content = {
AssistantScreen(
viewModel = AssistantViewModel(repository = mockRepository),
activity = ComposeActivity(),
capability = OCCapability().apply {
versionMayor = 30
}
)
}
)
}
@@ -0,0 +1,336 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@file:Suppress("TopLevelPropertyNaming", "MagicNumber")
package com.nextcloud.client.assistant.chat
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.scale
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.nextcloud.client.assistant.AssistantViewModel
import com.nextcloud.utils.TimeConstants
import com.nextcloud.utils.extensions.isHuman
import com.nextcloud.utils.extensions.time
import com.owncloud.android.R
import com.owncloud.android.lib.resources.assistant.chat.model.ChatMessage
import java.time.Instant
private val MIN_CHAT_HEIGHT = 60.dp
private val CHAT_BUBBLE_CORNER_RADIUS = 8.dp
private val ASSISTANT_ICON_SIZE = 40.dp
@Composable
fun ChatContent(viewModel: AssistantViewModel, modifier: Modifier = Modifier) {
val chatMessages by viewModel.chatMessages.collectAsState()
val isAssistantAnswering by viewModel.isAssistantAnswering.collectAsState()
val listState = rememberLazyListState()
LaunchedEffect(chatMessages) {
listState.animateScrollToItem(listState.layoutInfo.totalItemsCount)
}
LazyColumn(
modifier = modifier
.fillMaxSize()
.padding(horizontal = 12.dp, vertical = 8.dp),
verticalArrangement = Arrangement.Bottom,
reverseLayout = false,
state = listState
) {
items(chatMessages, key = { it.id }) { message ->
if (message.isHuman()) {
UserMessageItem(message)
} else {
AssistantMessageItem(message)
}
Spacer(modifier = Modifier.height(8.dp))
}
if (isAssistantAnswering) {
item {
AssistantTypingIndicator()
Spacer(modifier = Modifier.height(8.dp))
}
}
}
}
@Composable
private fun AssistantTypingIndicator() {
Box(
modifier = Modifier
.padding(vertical = 12.dp)
.fillMaxWidth(),
contentAlignment = Alignment.CenterStart
) {
Row(
verticalAlignment = Alignment.Bottom
) {
AnimatedAssistantIcon()
Box(
modifier = Modifier
.padding(start = 8.dp, end = 16.dp)
.defaultMinSize(minHeight = MIN_CHAT_HEIGHT)
.clip(
RoundedCornerShape(
topEnd = CHAT_BUBBLE_CORNER_RADIUS,
topStart = CHAT_BUBBLE_CORNER_RADIUS,
bottomEnd = CHAT_BUBBLE_CORNER_RADIUS
)
)
.background(color = colorResource(R.color.white))
) {
TypingAnimation()
}
}
}
}
@Composable
private fun AnimatedAssistantIcon() {
val infiniteTransition = rememberInfiniteTransition(label = "assistant_icon_animation")
val scale by infiniteTransition.animateFloat(
initialValue = 1f,
targetValue = 1.1f,
animationSpec = infiniteRepeatable(
animation = tween(TimeConstants.MILLIS_PER_SECOND, easing = LinearEasing),
repeatMode = RepeatMode.Reverse
),
label = "scale_animation"
)
Box(
modifier = Modifier
.size(ASSISTANT_ICON_SIZE)
.clip(CircleShape)
.background(Color.White),
contentAlignment = Alignment.Center
) {
Image(
painter = painterResource(id = R.drawable.ic_assistant),
contentDescription = null,
contentScale = ContentScale.Crop,
alignment = Alignment.Center,
modifier = Modifier
.scale(scale)
)
}
}
@Composable
private fun TypingAnimation() {
val infiniteTransition = rememberInfiniteTransition(label = "typing_animation")
val alpha by infiniteTransition.animateFloat(
initialValue = 0.3f,
targetValue = 1f,
animationSpec = infiniteRepeatable(
animation = tween(600, easing = LinearEasing),
repeatMode = RepeatMode.Reverse
),
label = "typing_alpha"
)
Column(
modifier = Modifier.padding(8.dp),
horizontalAlignment = Alignment.Start
) {
Text(
text = stringResource(R.string.assistant_thinking),
style = TextStyle(
color = colorResource(R.color.text_color).copy(alpha = alpha),
fontSize = 16.sp
)
)
}
}
@Composable
private fun AssistantMessageItem(message: ChatMessage) {
Box(
modifier = Modifier
.padding(vertical = 12.dp)
.fillMaxWidth(),
contentAlignment = Alignment.CenterStart
) {
Row(
verticalAlignment = Alignment.Bottom
) {
Box(
modifier = Modifier
.size(ASSISTANT_ICON_SIZE)
.clip(CircleShape)
.background(Color.White),
contentAlignment = Alignment.Center
) {
Image(
painter = painterResource(id = R.drawable.ic_assistant),
contentDescription = null,
contentScale = ContentScale.Crop,
alignment = Alignment.Center
)
}
Box(
modifier = Modifier
.padding(start = 8.dp, end = 16.dp)
.defaultMinSize(minHeight = MIN_CHAT_HEIGHT)
.clip(
RoundedCornerShape(
topEnd = CHAT_BUBBLE_CORNER_RADIUS,
topStart = CHAT_BUBBLE_CORNER_RADIUS,
bottomEnd = CHAT_BUBBLE_CORNER_RADIUS
)
)
.background(
color = colorResource(R.color.white)
)
) {
MessageTextItem(message)
}
}
}
}
@Composable
private fun UserMessageItem(message: ChatMessage) {
Box(
modifier = Modifier
.padding(vertical = 12.dp)
.fillMaxWidth(),
contentAlignment = Alignment.CenterEnd
) {
Row(
verticalAlignment = Alignment.Bottom
) {
Box(
modifier = Modifier
.padding(start = 16.dp, end = 8.dp)
.defaultMinSize(minHeight = MIN_CHAT_HEIGHT)
.clip(
RoundedCornerShape(
topEnd = CHAT_BUBBLE_CORNER_RADIUS,
topStart = CHAT_BUBBLE_CORNER_RADIUS,
bottomStart = CHAT_BUBBLE_CORNER_RADIUS
)
)
.background(color = colorResource(R.color.white))
) {
MessageTextItem(message)
}
}
}
}
@Composable
private fun MessageTextItem(message: ChatMessage) {
Column(
modifier = Modifier.padding(8.dp),
horizontalAlignment = Alignment.Start
) {
Text(
text = message.content,
style = TextStyle(
color = colorResource(R.color.text_color),
fontSize = 16.sp
)
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = message.time(),
style = TextStyle(
color = colorResource(R.color.text_color),
fontSize = 12.sp
)
)
}
}
@Preview(showBackground = true)
@Composable
private fun MessageTextItemPreview() {
val mockMessages = listOf(
ChatMessage(
id = 1,
sessionId = 101,
role = "human",
content = "Hey, how are you?",
timestamp = Instant.now().epochSecond,
ocpTaskId = null,
sources = "",
attachments = emptyList()
),
ChatMessage(
id = 2,
sessionId = 101,
role = "assistant",
content = "I'm good! Here’s a message from yesterday.",
timestamp = Instant.now().minusSeconds(86_400).epochSecond, // 1 day ago
ocpTaskId = null,
sources = "",
attachments = emptyList()
),
ChatMessage(
id = 3,
sessionId = 101,
role = "human",
content = "And an older one from last week.",
timestamp = Instant.now().minusSeconds(7 * 86_400).epochSecond, // 7 days ago
ocpTaskId = null,
sources = "",
attachments = emptyList()
)
)
Column(modifier = Modifier.padding(16.dp)) {
mockMessages.forEach { message ->
MessageTextItem(message = message)
Spacer(modifier = Modifier.height(16.dp))
}
}
}
@@ -1,66 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.assistant.component
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import com.nextcloud.ui.composeComponents.alertDialog.SimpleAlertDialog
import com.owncloud.android.R
@Composable
fun AddTaskAlertDialog(
title: String,
description: String?,
defaultInput: String = "",
addTask: (String) -> Unit,
dismiss: () -> Unit
) {
var input by remember {
mutableStateOf(defaultInput)
}
SimpleAlertDialog(
title = title,
description = description ?: "",
dismiss = { dismiss() },
onComplete = {
addTask(input)
},
content = {
TextField(
placeholder = {
Text(
text = stringResource(
id = R.string.assistant_screen_create_task_alert_dialog_input_field_placeholder
)
)
},
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
value = input,
onValueChange = {
input = it
}
)
}
)
}
@Composable
@Preview
private fun AddTaskAlertDialogPreview() {
AddTaskAlertDialog(title = "Title", description = "Description", addTask = { }, dismiss = {})
}
@@ -1,31 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.nextcloud.client.assistant.component
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.sp
import com.owncloud.android.R
@Composable
fun CenterText(text: String) {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Text(
text = text,
fontSize = 18.sp,
textAlign = TextAlign.Center,
color = colorResource(R.color.text_color)
)
}
}
@@ -0,0 +1,250 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@file:Suppress("TopLevelPropertyNaming", "MagicNumber")
package com.nextcloud.client.assistant.conversation
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
import androidx.compose.material.icons.filled.Add
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FabPosition
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableLongStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.nextcloud.client.assistant.conversation.model.ConversationScreenState
import com.nextcloud.ui.composeComponents.bottomSheet.MoreActionsBottomSheet
import com.owncloud.android.R
import com.owncloud.android.lib.resources.assistant.chat.model.Conversation
@OptIn(ExperimentalMaterial3Api::class)
@Suppress("LongMethod")
@Composable
fun ConversationScreen(viewModel: ConversationViewModel, close: () -> Unit, openChat: (Long) -> Unit) {
val screenState by viewModel.screenState.collectAsState()
val errorMessageId by viewModel.errorMessageId.collectAsState()
val conversations by viewModel.conversations.collectAsState()
val snackbarHostState = remember { SnackbarHostState() }
val errorString = errorMessageId?.let { stringResource(it) }
LaunchedEffect(Unit) {
viewModel.fetchConversations()
}
LaunchedEffect(errorString) {
errorString?.let {
snackbarHostState.showSnackbar(it)
}
}
Scaffold(
topBar = {
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
IconButton(
onClick = {
close()
}
) {
Icon(
imageVector = Icons.AutoMirrored.Outlined.ArrowBack,
contentDescription = "go back to assistant page"
)
}
Spacer(modifier = Modifier.width(8.dp))
Text(
text = stringResource(R.string.conversation_screen_title),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.headlineSmall
)
Spacer(modifier = Modifier.weight(1f))
}
},
snackbarHost = {
SnackbarHost(snackbarHostState)
},
floatingActionButton = {
FloatingActionButton(onClick = {
viewModel.createConversation(null, onResult = {
openChat(it)
})
}) {
Icon(Icons.Filled.Add, "Floating action button.")
}
},
floatingActionButtonPosition = FabPosition.EndOverlay
) { innerPadding ->
when (screenState) {
is ConversationScreenState.Loading -> {
Box(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding),
contentAlignment = Alignment.Center
) {
CircularProgressIndicator()
}
}
is ConversationScreenState.EmptyContent -> {
Box(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding),
contentAlignment = Alignment.Center
) {
Text(
stringResource(R.string.conversation_screen_empty_content_title),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.headlineSmall
)
}
}
else -> {
ConversationList(
viewModel = viewModel,
conversations = conversations,
modifier = Modifier.padding(innerPadding),
openChat = openChat
)
}
}
}
}
@Composable
private fun ConversationList(
viewModel: ConversationViewModel,
conversations: List<Conversation>,
modifier: Modifier = Modifier,
openChat: (Long) -> Unit
) {
var selectedConversationId by remember { mutableLongStateOf(-1L) }
LazyColumn(
modifier = modifier
.fillMaxSize()
.padding(16.dp),
verticalArrangement = Arrangement.Bottom
) {
items(conversations) { conversation ->
ConversationListItem(
conversation = conversation,
onClick = {
openChat(conversation.id)
},
onLongPressed = {
selectedConversationId = conversation.id
}
)
Spacer(modifier = Modifier.height(4.dp))
}
}
if (selectedConversationId != -1L) {
val currentId = selectedConversationId
val bottomSheetAction = listOf(
Triple(
R.drawable.ic_delete,
R.string.conversation_screen_delete_button_title
) {
val sessionId: String = currentId.toString()
viewModel.deleteConversation(sessionId)
selectedConversationId = -1L
}
)
MoreActionsBottomSheet(
actions = bottomSheetAction,
dismiss = { selectedConversationId = -1L }
)
}
}
@Composable
private fun ConversationListItem(conversation: Conversation, onClick: () -> Unit, onLongPressed: () -> Unit) {
Surface(
modifier = Modifier
.fillMaxWidth()
.combinedClickable(
onClick = onClick,
onLongClick = onLongPressed
)
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 8.dp, vertical = 6.dp),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = conversation.titleRepresentation(),
style = MaterialTheme.typography.bodyLarge.copy(fontSize = 16.sp),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
color = colorResource(R.color.text_color),
modifier = Modifier.weight(1f)
)
}
}
}
@Preview
@Composable
private fun ConversationListPreview() {
Column {
ConversationListItem(Conversation(1L, "User1", "Who is Al Pacino?", 1762847286L, "", null), {
}, {
})
Spacer(modifier = Modifier.height(8.dp))
ConversationListItem(Conversation(2L, "User1", "What is JetpackCompose?", 1761847286L, "", null), {
}, {
})
Spacer(modifier = Modifier.height(8.dp))
}
}
@@ -0,0 +1,99 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.client.assistant.conversation
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.nextcloud.client.assistant.conversation.model.ConversationScreenState
import com.nextcloud.client.assistant.conversation.repository.ConversationRemoteRepository
import com.nextcloud.utils.TimeConstants.MILLIS_PER_SECOND
import com.owncloud.android.R
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.assistant.chat.model.Conversation
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
class ConversationViewModel(private val remoteRepository: ConversationRemoteRepository) : ViewModel() {
private val _errorMessageId = MutableStateFlow<Int?>(null)
val errorMessageId: StateFlow<Int?> = _errorMessageId
private val _screenState = MutableStateFlow<ConversationScreenState?>(null)
val screenState: StateFlow<ConversationScreenState?> = _screenState
private val _conversations = MutableStateFlow<List<Conversation>>(listOf())
val conversations: StateFlow<List<Conversation>> = _conversations.asStateFlow()
fun fetchConversations() {
_screenState.update {
ConversationScreenState.Loading
}
viewModelScope.launch(Dispatchers.IO) {
val conversations = remoteRepository.fetchConversationList()
if (conversations != null) {
if (conversations.isEmpty()) {
_screenState.update {
ConversationScreenState.emptyConversationList()
}
} else {
_screenState.update {
null
}
_conversations.update {
conversations
}
}
} else {
_screenState.update {
null
}
_errorMessageId.update {
R.string.conversation_screen_fetch_error_title
}
}
}
}
fun createConversation(title: String?, onResult: (Long) -> Unit) {
viewModelScope.launch(Dispatchers.IO) {
val timestamp = System.currentTimeMillis().div(MILLIS_PER_SECOND)
val newConversation = remoteRepository.createConversation(title, timestamp)
if (newConversation != null) {
_conversations.update {
listOf(newConversation.session) + it
}
onResult(newConversation.session.id)
} else {
_errorMessageId.update {
R.string.conversation_screen_create_error_title
}
}
}
}
fun deleteConversation(sessionId: String) {
Log_OC.d("", "BBBB: $sessionId")
viewModelScope.launch(Dispatchers.IO) {
val success = remoteRepository.deleteConversation(sessionId)
if (success) {
val updatedList = _conversations.value.filterNot { it.id == sessionId.toLong() }
_conversations.update {
updatedList
}
} else {
_errorMessageId.update {
R.string.conversation_screen_delete_error_title
}
}
}
}
}
Loaded 100 of 816 files, more files were not shown because too many files have changed in this diff. Show more