Compare commits

..
Author SHA1 Message Date
Andy Scherzinger 1c9d100b04 add scrollable header interface
Signed-off-by: Andy Scherzinger <[email protected]>
2020-08-14 09:21:45 +02:00
Andy Scherzinger c65d50a8ee Merge pull request #6698 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.11.0
Bump detekt-gradle-plugin from 1.10.0 to 1.11.0
2020-08-14 09:17:38 +02:00
Nextcloud bot d85063ef67 [tx-robot] updated from transifex 2020-08-14 03:46:02 +00:00
dependabot-preview[bot] d3fb6a2ab6 Bump detekt-gradle-plugin from 1.10.0 to 1.11.0
Bumps detekt-gradle-plugin from 1.10.0 to 1.11.0.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-14 01:14:09 +00:00
dependabot-preview[bot] 18b9b0f147 Merge pull request #6695 from nextcloud/dependabot/gradle/butterknifeVersion-10.2.3 2020-08-13 15:05:48 +00:00
Nextcloud bot f1dfd44f07 [tx-robot] updated from transifex 2020-08-13 03:32:10 +00:00
dependabot-preview[bot] 3d934ed9fa Bump butterknifeVersion from 10.2.2 to 10.2.3
Bumps `butterknifeVersion` from 10.2.2 to 10.2.3.

Updates `butterknife` from 10.2.2 to 10.2.3
- [Release notes](https://github.com/JakeWharton/butterknife/releases)
- [Changelog](https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JakeWharton/butterknife/compare/10.2.2...10.2.3)

Updates `butterknife-compiler` from 10.2.2 to 10.2.3
- [Release notes](https://github.com/JakeWharton/butterknife/releases)
- [Changelog](https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JakeWharton/butterknife/compare/10.2.2...10.2.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-13 01:13:36 +00:00
Nextcloud bot f35ef1b320 [tx-robot] updated from transifex 2020-08-12 03:31:51 +00:00
Nextcloud bot 7daf2bfa5d [tx-robot] updated from transifex 2020-08-11 03:31:28 +00:00
Tobias Kaminsky 7e08278246 Merge pull request #6667 from nextcloud/sortUpload
add sort option to UploadFilesActivity and FolderPickerActivity
2020-08-07 19:09:00 +02:00
tobiasKaminsky bee0c7b4a1 add sort option to UploadFilesActivity and FolderPickerActivity
added UI tests

Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-07 17:51:22 +02:00
Andy Scherzinger babbd23bf2 Merge pull request #6669 from nextcloud/duplicatedFAB
removed FAB from text file preview and use FDA one
2020-08-07 14:17:34 +02:00
tobiasKaminsky 92301735af removed FAB from text file preview and use FDA one
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-07 13:56:08 +02:00
Tobias Kaminsky 5d21b3668d Merge pull request #6651 from nextcloud/fixLinkIcon
make + icon grey600 for proper icon coloring dark/light
2020-08-07 11:24:46 +02:00
Andy Scherzinger cd2c2d858b Merge pull request #6662 from nextcloud/npeExpirationDate
fix npe on setting expiration date on public share
2020-08-07 09:39:22 +02:00
tobiasKaminsky 898708cfc8 fix npe on setting expiration date on public share
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-07 09:04:47 +02:00
Nextcloud bot ff0dd4ace4 [tx-robot] updated from transifex 2020-08-07 03:33:43 +00:00
Andy Scherzinger 90b368b25b Merge pull request #6656 from nextcloud/dependabot/gradle/markwonVersion-4.5.0
Bump markwonVersion from 4.4.0 to 4.5.0
2020-08-06 17:34:29 +02:00
Tobias Kaminsky 5b22cbe038 Merge pull request #6655 from nextcloud/ezaquarii/rename-downloader-to-transfer-manager
Rename Downloader to TransferManager
2020-08-06 14:01:49 +02:00
Nextcloud bot 2d1dc5775d [tx-robot] updated from transifex 2020-08-06 03:32:34 +00:00
dependabot-preview[bot] 7cb9cc3bbb Bump markwonVersion from 4.4.0 to 4.5.0
Bumps `markwonVersion` from 4.4.0 to 4.5.0.

Updates `core` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/noties/Markwon/releases)
- [Changelog](https://github.com/noties/Markwon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/noties/Markwon/compare/v4.4.0...v4.5.0)

Updates `ext-strikethrough` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/noties/Markwon/releases)
- [Changelog](https://github.com/noties/Markwon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/noties/Markwon/compare/v4.4.0...v4.5.0)

Updates `ext-tables` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/noties/Markwon/releases)
- [Changelog](https://github.com/noties/Markwon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/noties/Markwon/compare/v4.4.0...v4.5.0)

Updates `ext-tasklist` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/noties/Markwon/releases)
- [Changelog](https://github.com/noties/Markwon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/noties/Markwon/compare/v4.4.0...v4.5.0)

Updates `html` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/noties/Markwon/releases)
- [Changelog](https://github.com/noties/Markwon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/noties/Markwon/compare/v4.4.0...v4.5.0)

Updates `syntax-highlight` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/noties/Markwon/releases)
- [Changelog](https://github.com/noties/Markwon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/noties/Markwon/compare/v4.4.0...v4.5.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-06 01:12:25 +00:00
Chris Narkiewicz b0053d1481 Rename Downloader to TransferManager
As the Downloader architecture can support any type of
asynchronous operations so we can easily support file uploads.

Rename Downloader to TransferManager to reflect this.
This is just a rename, without upload implementation.
Upload feature shall follow in separate PRs.

Signed-off-by: Chris Narkiewicz <[email protected]>
2020-08-06 00:05:52 +01:00
Andy Scherzinger 9db4585224 make + icon grey600 for proper icon coloring dark/light
Fixes #6647

Signed-off-by: Andy Scherzinger <[email protected]>
2020-08-05 12:43:26 +02:00
Andy Scherzinger 8d82203c15 Merge pull request #6646 from nextcloud/activityCompare
object.getId() can also be a string if RichObjects refers to an user
2020-08-05 12:23:04 +02:00
dependabot-preview[bot] 81d75ad5dd Merge pull request #6645 from nextcloud/dependabot/gradle/com.google.android.material-material-1.2.0 2020-08-05 08:47:41 +00:00
tobiasKaminsky 5ad6cafb92 change test to directly launch SyncedFoldersActivity
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-05 10:22:40 +02:00
tobiasKaminsky c8863c61b0 object.getId() can also be a string if RichObjects refers to an user
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-05 08:30:33 +02:00
dependabot-preview[bot] 251af8f0ef Bump material from 1.1.0 to 1.2.0
Bumps [material](https://github.com/material-components/material-components-android) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/material-components/material-components-android/releases)
- [Commits](https://github.com/material-components/material-components-android/compare/1.1.0...1.2.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-05 07:18:48 +02:00
Nextcloud bot 433e1c0c16 [tx-robot] updated from transifex 2020-08-05 03:32:52 +00:00
dependabot-preview[bot] ad4e3832bc Merge pull request #6635 from nextcloud/dependabot/gradle/com.jakewharton-butterknife-10.2.2 2020-08-04 16:18:36 +00:00
dependabot-preview[bot] a361df0b4c Bump butterknife from 10.2.1 to 10.2.2
Bumps [butterknife](https://github.com/JakeWharton/butterknife) from 10.2.1 to 10.2.2.
- [Release notes](https://github.com/JakeWharton/butterknife/releases)
- [Changelog](https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JakeWharton/butterknife/compare/10.2.1...10.2.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-04 17:45:50 +02:00
Tobias Kaminsky 54adf9823e Merge pull request #6634 from nextcloud/dependabot/gradle/com.jakewharton-butterknife-compiler-10.2.2
Bump butterknife-compiler from 10.2.1 to 10.2.2
2020-08-04 16:08:05 +02:00
Nextcloud bot 66d9465e11 [tx-robot] updated from transifex 2020-08-04 12:44:52 +00:00
dependabot-preview[bot] 3d73a2336f Merge pull request #6633 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.5.0 2020-08-04 11:44:09 +00:00
Andy Scherzinger a255c27f4f Merge pull request #6627 from nextcloud/fixE2Esync
Sync of encrypted folders, in sync with RefreshFolderOperation.synchronizeData
2020-08-04 13:09:35 +02:00
dependabot-preview[bot] d1131702f6 Bump butterknife-compiler from 10.2.1 to 10.2.2
Bumps [butterknife-compiler](https://github.com/JakeWharton/butterknife) from 10.2.1 to 10.2.2.
- [Release notes](https://github.com/JakeWharton/butterknife/releases)
- [Changelog](https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JakeWharton/butterknife/compare/10.2.1...10.2.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-04 01:13:39 +00:00
dependabot-preview[bot] 60856c6146 Bump spotbugs-gradle-plugin from 4.4.5 to 4.5.0
Bumps spotbugs-gradle-plugin from 4.4.5 to 4.5.0.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-04 01:13:05 +00:00
Chris Narkiewicz 67e6c3402c Rename Download into Transfer
Extending Download into more generic Transfer that
can support both downloads and uploads.

Upload functionality is not provided in this PR - it's
only a rename.

Signed-off-by: Chris Narkiewicz <[email protected]>
2020-08-03 23:23:16 +01:00
Andy Scherzinger d745a2cbbf Merge pull request #6556 from nextcloud/trashbinLoadingTests
TrashbinActivity: viewbindings tests
2020-08-03 20:49:50 +02:00
Andy Scherzinger 111daf1162 Merge pull request #6623 from nextcloud/fixOClistOnAutoUpload
OCFileListFragment can be used witout FDA, and this crashed
2020-08-03 20:33:28 +02:00
Andy Scherzinger c9d3641136 Update screenshot due to new toolbar height
Signed-off-by: Andy Scherzinger <[email protected]>
2020-08-03 20:27:24 +02:00
tobiasKaminsky f7ab5d90dc TrashbinActivity:
- moved to ViewBindings
- add UI test for error/view

Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-03 20:05:31 +02:00
Andy Scherzinger 607ed3115e Merge pull request #6595 from nextcloud/hidCursor
Hide cursor to make UI test more stable
2020-08-03 19:16:14 +02:00
tobiasKaminsky 93104917a7 Sync of encrypted folders, in sync with RefreshFolderOperation.synchronizeData
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-03 12:08:36 +02:00
Andy Scherzinger a2b95c5766 Merge pull request #6622 from nextcloud/dependabot/gradle/net.bytebuddy-byte-buddy-android-1.10.14
Bump byte-buddy-android from 1.10.13 to 1.10.14
2020-08-03 09:18:00 +02:00
dependabot-preview[bot] a0179aa6b6 Bump byte-buddy-android from 1.10.13 to 1.10.14
Bumps [byte-buddy-android](https://github.com/raphw/byte-buddy) from 1.10.13 to 1.10.14.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.10.13...byte-buddy-1.10.14)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-03 06:40:58 +00:00
Tobias Kaminsky a28fafaaab Merge pull request #6621 from nextcloud/dependabot/gradle/net.bytebuddy-byte-buddy-1.10.14
Bump byte-buddy from 1.10.13 to 1.10.14
2020-08-03 08:39:50 +02:00
Tobias Kaminsky d521a9f36c Merge pull request #6599 from nextcloud/fastlaneOrder
change order of fastlane lanes
2020-08-03 08:39:25 +02:00
tobiasKaminsky 3c5549adac OCFileListFragment can be used witout FDA, and this crashed
Signed-off-by: tobiasKaminsky <[email protected]>
2020-08-03 08:31:45 +02:00
dependabot-preview[bot] fcf81e5d89 Bump byte-buddy from 1.10.13 to 1.10.14
Bumps [byte-buddy](https://github.com/raphw/byte-buddy) from 1.10.13 to 1.10.14.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.10.13...byte-buddy-1.10.14)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-08-03 01:12:21 +00:00
Andy Scherzinger c7984a706c Merge pull request #6600 from nextcloud/Valdnet-patch-1
l10n: Add a period in the text string
2020-07-31 16:14:37 +02:00
Valdnet 68cae46c96 l10n: Add a period in the text string 2020-07-31 15:46:51 +02:00
tobiasKaminsky 1d3c2e98a9 change order of fastlane lanes
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-31 12:47:00 +02:00
Tobias Kaminsky cc750123a7 Merge pull request #6559 from nextcloud/downloadTest
Download / upload tests
2020-07-31 11:38:52 +02:00
tobiasKaminsky e9733ad744 - fix dummy storage location
- dummy files are re-created if needed

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-31 10:55:21 +02:00
tobiasKaminsky 7f339f9fe0 updated tests
Upload:
- obey LOCAL_BEHAVIOUR_COPY
- correct storage path for encrypted files in subdirectories

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-31 10:55:21 +02:00
tobiasKaminsky 78128ff5dc Hide cursor to make UI test more stable
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-31 08:32:58 +02:00
Tobias Kaminsky ba0005d930 Merge pull request #6592 from nextcloud/fixDetekt
Fix detekt: Random Date is magic number in test
2020-07-31 08:29:52 +02:00
Tobias Kaminsky 6469fdb658 Merge pull request #6585 from nextcloud/nullColor
parseColor("") throws IndexOutOfBounds, so catch all Exceptions is better
2020-07-31 08:13:28 +02:00
tobiasKaminsky 0d381c8233 Random Date is magic number in test
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-31 08:07:15 +02:00
tobiasKaminsky 07aff36578 added test cases
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-31 07:45:04 +02:00
dependabot-preview[bot] 9f4d90f48b Merge pull request #6591 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.4.5 2020-07-31 05:17:47 +00:00
dependabot-preview[bot] d60a2a6a3f Bump spotbugs-gradle-plugin from 4.4.4 to 4.4.5
Bumps spotbugs-gradle-plugin from 4.4.4 to 4.4.5.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-31 01:13:56 +00:00
Andy Scherzinger 5c5cdbb0a2 Merge pull request #6578 from nextcloud/dependabot/gradle/org.mockito-mockito-core-3.4.6
Bump mockito-core from 3.4.4 to 3.4.6
2020-07-30 17:14:16 +02:00
Andy Scherzinger 6f38bf7a8b Merge pull request #6586 from nextcloud/friendlyName
Fix crash when showing default storage friendly name
2020-07-30 17:11:38 +02:00
Andy Scherzinger 5f426223b2 Merge pull request #6580 from nextcloud/bige2eTest
E2E test with random files that are big enought to use chunked uploads
2020-07-30 17:08:05 +02:00
dependabot-preview[bot] 111713f52e Bump mockito-core from 3.4.4 to 3.4.6
Bumps [mockito-core](https://github.com/mockito/mockito) from 3.4.4 to 3.4.6.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.4.4...v3.4.6)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-30 14:28:59 +00:00
Tobias Kaminsky 24c84de9cd Merge pull request #6577 from nextcloud/dependabot/gradle/org.mockito-mockito-android-3.4.6
Bump mockito-android from 3.4.4 to 3.4.6
2020-07-30 16:27:46 +02:00
Tobias Kaminsky 02686e462a Merge pull request #6587 from nextcloud/updateContactsScreenshots
Update screenshots, wrong emulator was used
2020-07-30 16:10:23 +02:00
tobiasKaminsky 69476bba29 Update screenshots, wrong emulator was used
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-30 15:57:23 +02:00
tobiasKaminsky 60b1f3702e Fix crash when showing default storage friendly name
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-30 15:35:57 +02:00
tobiasKaminsky 528cd23cc0 parseColor("") throws IndexOutOfBounds, so catch all Exceptions is better
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-30 15:16:26 +02:00
Tobias Kaminsky e35dfbffc9 Merge pull request #6579 from nextcloud/openVCF
open vcf works again
2020-07-30 15:02:58 +02:00
Tobias Kaminsky 98bc395799 Merge pull request #6551 from nextcloud/dependabot/gradle/com.googlecode.ez-vcard-ez-vcard-0.11.0
Bump ez-vcard from 0.10.6 to 0.11.0
2020-07-30 14:57:34 +02:00
Tobias Kaminsky afc54de8f1 Merge pull request #6557 from nextcloud/onDevice
wrong storage location
2020-07-30 14:54:02 +02:00
tobiasKaminsky 2c96094f21 E2E test with random files that are big enought to use chunked uploads
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-30 13:41:24 +02:00
tobiasKaminsky 75c8359781 open vcf works again
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-30 09:17:02 +02:00
Andy Scherzinger 372e478bfd Merge pull request #6552 from nextcloud/contactsBackupTest
Contacts backup tests
2020-07-30 07:15:34 +02:00
Nextcloud bot be3c0db309 [tx-robot] updated from transifex 2020-07-30 03:32:43 +00:00
dependabot-preview[bot] b8fb7358b3 Bump mockito-android from 3.4.4 to 3.4.6
Bumps [mockito-android](https://github.com/mockito/mockito) from 3.4.4 to 3.4.6.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.4.4...v3.4.6)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-30 01:13:21 +00:00
Andy Scherzinger 663c0beda5 Merge pull request #6395 from cotechde/webauthn
add passwordless WebAuthn logins
2020-07-29 21:25:48 +02:00
Andy Scherzinger a930d9b6e1 reformat code
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 14:42:41 +02:00
tobiasKaminsky 8ef4e04312 only remove nextcloud accounts (no permission for others)
contact backup job: better rename than ask user, as we want to have backup not delayed
add test for contacts backup/import/vcard

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-29 14:42:41 +02:00
Tobias Kaminsky eedb5008bb Merge pull request #6573 from nextcloud/uploadStorageTest
Remove all uploads after test for sure
2020-07-29 14:42:07 +02:00
tobiasKaminsky 29a0c138c7 Remove all uploads after test for sure
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-29 13:00:50 +02:00
Tobias Kaminsky 0976f7abe2 Merge pull request #6566 from nextcloud/uiTestsColor
Test different primary colors / dark mode
2020-07-29 11:53:25 +02:00
Tobias Kaminsky f7d886037a Merge pull request #6569 from nextcloud/fixToolbar
Fix toolbar
2020-07-29 11:28:18 +02:00
tobiasKaminsky c9c0ae9e46 Allow to run different colors on dark/light mode
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-29 11:20:25 +02:00
Andy Scherzinger e02b9adf8a hide sort/list group on previews
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 08:20:53 +02:00
Andy Scherzinger fdb4489e38 Updated screenshots
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 08:20:53 +02:00
Andy Scherzinger 130503a6e3 optimize sorting/layout bar spacing for home/search bar
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 08:20:52 +02:00
Andy Scherzinger af924761b7 optimize toolbar layout
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 08:20:51 +02:00
Andy Scherzinger e7cd9ce6bc properly reset header for preview fragments
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 08:20:51 +02:00
Andy Scherzinger ddd7b901da proper coloring and sizing for toolbar_standard.xml(s)
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-29 08:20:46 +02:00
Nextcloud bot 0a062ea937 [tx-robot] updated from transifex 2020-07-29 03:34:20 +00:00
Andy Scherzinger ef1aaead0c Merge pull request #6561 from nextcloud/notificationButtonStyling
Make button text non-all-caps for consistent styling
2020-07-28 22:22:16 +02:00
nextcloud-android-bot 8f1d7b5b95 Drone: update Lint results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-07-28 19:28:59 +00:00
Andy Scherzinger 774beec484 lint: Use ResourcesCompat.getDrawable()
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 21:20:44 +02:00
Andy Scherzinger 6b6e7c7f2c lint: remove unused resources
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 21:17:16 +02:00
Andy Scherzinger 4c547c2de2 update screenshot due to updated testcase data
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 18:01:08 +02:00
Andy Scherzinger d1bd1dd16e use proper testing date within this century
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:44:26 +02:00
Andy Scherzinger a514ad81a0 update test screenshot due to consolidated icon tinting
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:39:29 +02:00
Andy Scherzinger ed229267d2 improve notification icon dark theming
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:28:15 +02:00
Andy Scherzinger 080dc4047f proper button styling
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:28:14 +02:00
Andy Scherzinger f744a2351d proper code formatting
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:28:13 +02:00
Andy Scherzinger 7d14c90b7d proper margin calculations
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:28:13 +02:00
Andy Scherzinger 6c8d52119f remove padding
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:28:12 +02:00
tobiasKaminsky 76c20b22db Write some UI tests for NotificationsActivity
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-28 17:28:11 +02:00
Andy Scherzinger 3bba95365c make button text non-all-caps for consistent styling
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-28 17:28:11 +02:00
Andy Scherzinger 81654379f9 Merge pull request #6562 from nextcloud/headerScroll
When going into subfolder or show details: show header even if it was scrolled away
2020-07-28 17:08:40 +02:00
tobiasKaminsky 376ad933fb When going into subfolder or show details: show header even if it was scrolled away
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-28 14:40:20 +02:00
Andy Scherzinger c981833bc1 Merge pull request #6560 from nextcloud/fixLargeTest
make sure to delete all uploads
2020-07-28 12:05:18 +02:00
tobiasKaminsky cdf0c97001 make sure to delete all uploads
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-28 11:35:21 +02:00
Nextcloud bot cb27c7b413 [tx-robot] updated from transifex 2020-07-28 03:32:22 +00:00
tobiasKaminsky 8966803e39 wrong storage location
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-27 15:23:29 +02:00
Andy Scherzinger 919539846f Merge pull request #6553 from nextcloud/photoSearch
if photo search returns less photos than limit -> hide spinner
2020-07-27 12:06:27 +02:00
Tobias Kaminsky 17a19bd4be Merge pull request #6537 from nextcloud/trashbinLoading
Trashbin: show empty message only if empty
2020-07-27 11:30:33 +02:00
tobiasKaminsky 0be925f00e if photo search returns less photos than limit -> hide spinner
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-27 11:25:17 +02:00
Nextcloud bot 1000c9b83f [tx-robot] updated from transifex 2020-07-27 03:30:44 +00:00
dependabot-preview[bot] 4931122392 Bump ez-vcard from 0.10.6 to 0.11.0
Bumps [ez-vcard](https://github.com/mangstadt/ez-vcard) from 0.10.6 to 0.11.0.
- [Release notes](https://github.com/mangstadt/ez-vcard/releases)
- [Commits](https://github.com/mangstadt/ez-vcard/compare/0.10.6...0.11.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-27 01:13:42 +00:00
Nextcloud bot 2bd5b1cb27 [tx-robot] updated from transifex 2020-07-25 03:31:17 +00:00
tobiasKaminsky e1bb072588 Trashbin: show empty message only if empty
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-24 17:28:44 +02:00
Andy Scherzinger 675e6dc4d5 Merge pull request #6519 from nextcloud/activityList
Enhancing activity list
2020-07-24 13:59:30 +02:00
Andy Scherzinger 3a324f11e6 Merge pull request #6528 from nextcloud/federatedIcon
add ROOM handling for sharees
2020-07-24 13:41:32 +02:00
tobiasKaminsky 681263cc7f Activity list:
- show correct placeholder
- click on preview open file

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-24 12:43:46 +02:00
Tobias Kaminsky 10580c9579 Merge pull request #6523 from nextcloud/sameHeight
align grid/sort buttons
2020-07-24 08:43:36 +02:00
tobiasKaminsky 7a9cf103b4 add ROOM handling for sharees
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-24 08:33:45 +02:00
Nextcloud bot 2248911da0 [tx-robot] updated from transifex 2020-07-24 03:33:06 +00:00
Andy Scherzinger 6fda99a633 Merge pull request #6522 from nextcloud/fabCrash
fix crash on folder picker of synced folder
2020-07-23 20:41:05 +02:00
Andy Scherzinger eed4293c43 Updated screenshots
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-23 19:20:42 +02:00
tobiasKaminsky d6890111bb align grid/sort buttons
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-23 18:10:40 +02:00
tobiasKaminsky a3487adbdf fix crash on folder picker of synced folder
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-23 16:40:57 +02:00
Tobias Kaminsky 57919b63c7 Merge pull request #6514 from nextcloud/dependabot/gradle/androidx.work-work-runtime-ktx-2.4.0
Bump work-runtime-ktx from 2.3.4 to 2.4.0
2020-07-23 09:12:16 +02:00
dependabot-preview[bot] 5dfeb14412 Bump work-runtime-ktx from 2.3.4 to 2.4.0
Bumps work-runtime-ktx from 2.3.4 to 2.4.0.

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-23 08:20:30 +02:00
Tobias Kaminsky 10b5113299 Merge pull request #6515 from nextcloud/dependabot/gradle/androidx.work-work-runtime-2.4.0
Bump work-runtime from 2.3.4 to 2.4.0
2020-07-23 08:19:12 +02:00
dependabot-preview[bot] e0c15717f7 Bump work-runtime from 2.3.4 to 2.4.0
Bumps work-runtime from 2.3.4 to 2.4.0.

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-23 07:39:39 +02:00
Andy Scherzinger ed94dfb139 Merge pull request #6479 from nextcloud/encUpdate
Fixed create folder due to new system (write on server is only performed upon unlock)
2020-07-23 07:06:24 +02:00
Nextcloud bot 623a0e9c59 [tx-robot] updated from transifex 2020-07-23 03:34:13 +00:00
tobiasKaminsky 907e9f0b26 Fixed create folder due to new system (write on server is only performed upon unlock)
added test case for remove file

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-22 16:47:53 +02:00
Andy Scherzinger 1bf3425ab2 Merge pull request #6511 from nextcloud/huawei
Add huawei upload
2020-07-22 16:47:11 +02:00
tobiasKaminsky 933c61d0c9 Fixed create folder due to new system (write on server is only performed upon unlock)
added test case for remove file

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-22 16:28:48 +02:00
tobiasKaminsky b39d3d4182 Add huawei upload
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-22 14:43:44 +02:00
Nextcloud bot d852aff107 [tx-robot] updated from transifex 2020-07-22 08:10:53 +00:00
Tobias Kaminsky 8e97d363fe Merge pull request #6503 from nextcloud/doNotTranslateETM
ETM internal strings that specify background jobs do not need to be translated
2020-07-22 07:11:15 +02:00
Nextcloud bot cb6ccbe650 [tx-robot] updated from transifex 2020-07-22 03:32:50 +00:00
tobiasKaminsky 121c6c1f23 Fixed create folder due to new system (write on server is only performed upon unlock)
added test case for remove file

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-21 14:58:28 +02:00
tobiasKaminsky 4d040fba86 ETM internal strings that specify background jobs do not need to be translated
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-21 11:52:29 +02:00
Tobias Kaminsky 2dfde203c8 Merge pull request #6501 from nextcloud/bumpServerVersions
Warn on NC16 as outdated server
2020-07-21 11:47:11 +02:00
Dominik Schürmann c5e624f1e2 add WebAuthn support using hwsecurity-fido2:4.1.0
Signed-off-by: Dominik Schürmann <[email protected]>
2020-07-21 09:17:46 +02:00
tobiasKaminsky f4684f15c1 Warn on NC16 as outdated server
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-21 08:35:18 +02:00
dependabot-preview[bot] 14cec7d029 Merge pull request #6498 from nextcloud/dependabot/gradle/net.bytebuddy-byte-buddy-android-1.10.13 2020-07-21 05:25:32 +00:00
Tobias Kaminsky 4fad4403fc Merge pull request #4146 from nextcloud/loginOnEmulator
Test login on integrationTests
2020-07-21 07:15:37 +02:00
dependabot-preview[bot] 95c2db021f Merge pull request #6497 from nextcloud/dependabot/gradle/org.mockito-mockito-android-3.4.4 2020-07-21 05:11:16 +00:00
dependabot-preview[bot] 8cf7ba60b5 Bump byte-buddy-android from 1.10.10 to 1.10.13
Bumps [byte-buddy-android](https://github.com/raphw/byte-buddy) from 1.10.10 to 1.10.13.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.10.10...byte-buddy-1.10.13)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-21 01:14:06 +00:00
dependabot-preview[bot] a8db8ef38f Bump mockito-android from 3.3.3 to 3.4.4
Bumps [mockito-android](https://github.com/mockito/mockito) from 3.3.3 to 3.4.4.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.3.3...v3.4.4)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-21 01:12:35 +00:00
Tobias Kaminsky 7861eb787e Merge pull request #6495 from nextcloud/directlyAskForE2E
upon encryption directly ask for mnemonic/setup
2020-07-20 17:13:26 +02:00
tobiasKaminsky 196b16d1d3 Test login on integrationTests
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 16:17:27 +02:00
Tobias Kaminsky 4f97110ab3 Merge pull request #6048 from nextcloud/ezaquarii/new-download-manager
New download manager
2020-07-20 12:52:49 +02:00
dependabot-preview[bot] 2150295acc Merge pull request #6493 from nextcloud/dependabot/gradle/daggerVersion-2.28.3 2020-07-20 10:42:44 +00:00
tobiasKaminsky de0467381c upon encryption directly ask for mnemonic/setup
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 12:33:58 +02:00
tobiasKaminsky 5a9d578018 supprss lint warning
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 12:28:50 +02:00
Chris Narkiewicz 75b9fa8551 New download manager
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-20 12:28:47 +02:00
dependabot-preview[bot] 72b9dd069a Bump daggerVersion from 2.28.1 to 2.28.3
Bumps `daggerVersion` from 2.28.1 to 2.28.3.

Updates `dagger` from 2.28.1 to 2.28.3
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.28.1...dagger-2.28.3)

Updates `dagger-android` from 2.28.1 to 2.28.3
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.28.1...dagger-2.28.3)

Updates `dagger-android-support` from 2.28.1 to 2.28.3
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.28.1...dagger-2.28.3)

Updates `dagger-compiler` from 2.28.1 to 2.28.3
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.28.1...dagger-2.28.3)

Updates `dagger-android-processor` from 2.28.1 to 2.28.3
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.28.1...dagger-2.28.3)

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 12:26:12 +02:00
Andy Scherzinger 51f48549c3 Merge pull request #6494 from nextcloud/dependabot/gradle/org.mockito-mockito-android-3.4.4
Bump mockito-android from 3.4.2 to 3.4.4
2020-07-20 11:53:50 +02:00
Andy Scherzinger 1b1823db0a Merge pull request #6492 from nextcloud/dependabot/gradle/org.mockito-mockito-core-3.4.4
Bump mockito-core from 3.4.2 to 3.4.4
2020-07-20 11:53:27 +02:00
dependabot-preview[bot] 65a2b895f5 Bump mockito-core from 3.4.2 to 3.4.4
Bumps [mockito-core](https://github.com/mockito/mockito) from 3.4.2 to 3.4.4.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.4.2...v3.4.4)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-20 09:32:57 +00:00
dependabot-preview[bot] 81bb72344c Bump mockito-android from 3.4.2 to 3.4.4
Bumps [mockito-android](https://github.com/mockito/mockito) from 3.4.2 to 3.4.4.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.4.2...v3.4.4)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-20 09:32:06 +00:00
Tobias Kaminsky 8a2bd6370d Merge pull request #6487 from nextcloud/fixScreenshotFDA
update FileDisplayActivityIT
2020-07-20 11:30:39 +02:00
tobiasKaminsky 88a609fc0e another try to get tests green
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 11:12:16 +02:00
tobiasKaminsky ffa19f0fa9 update screenshots to reflect https
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 10:58:00 +02:00
tobiasKaminsky 8957d5a525 missing protocol prefix
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 10:09:38 +02:00
tobiasKaminsky df72d84f91 fix last remaining tests
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-20 09:06:08 +02:00
Nextcloud bot c4fc2f52ea [tx-robot] updated from transifex 2020-07-19 03:33:32 +00:00
Andy Scherzinger ad12be8218 Merge pull request #6483 from nextcloud/dependabot/gradle/org.mockito-mockito-core-3.4.2
Bump mockito-core from 3.4.0 to 3.4.2
2020-07-17 23:17:09 +02:00
Andy Scherzinger 0ab788d116 Merge pull request #6484 from nextcloud/dependabot/gradle/org.mockito-mockito-android-3.4.2
Bump mockito-android from 3.4.0 to 3.4.2
2020-07-17 23:16:44 +02:00
tobiasKaminsky 7a3ef013d1 always start with no account
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 13:37:04 +02:00
tobiasKaminsky acbb2f06bf disable flaky screenshot tests
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 13:18:12 +02:00
tobiasKaminsky b29767b648 remove accounts, as otherwise account from AbstractOnServer might be there
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 12:52:54 +02:00
tobiasKaminsky d17dd38589 Fix DialogFragmentIT
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 12:32:27 +02:00
tobiasKaminsky 78cc80266a Fix: server IT tests need AbstractOnServerIT
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 12:16:41 +02:00
tobiasKaminsky d1adb2bf74 update FileDisplayActivityIT
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 11:56:23 +02:00
Tobias Kaminsky faab13ca92 Merge pull request #6476 from nextcloud/authCrash
Fix crash on missing user
2020-07-17 11:56:10 +02:00
Andy Scherzinger 1cf178893a Merge pull request #6480 from nextcloud/loginColor
Use same color for status bar
2020-07-17 09:27:44 +02:00
dependabot-preview[bot] a56a34079b Bump mockito-android from 3.4.0 to 3.4.2
Bumps [mockito-android](https://github.com/mockito/mockito) from 3.4.0 to 3.4.2.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.4.0...v3.4.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-17 08:33:01 +02:00
dependabot-preview[bot] e753f8ea3d Bump mockito-core from 3.4.0 to 3.4.2
Bumps [mockito-core](https://github.com/mockito/mockito) from 3.4.0 to 3.4.2.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.4.0...v3.4.2)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-17 08:32:26 +02:00
tobiasKaminsky 404f43fad4 Use same color for status bar
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 08:18:28 +02:00
tobiasKaminsky 9a07418e51 Fix crash on missing user
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 08:07:45 +02:00
Tobias Kaminsky 7b1522e86a Merge pull request #6486 from nextcloud/fixSettingScreenshotTest
update ScreenshotIT
2020-07-17 08:07:12 +02:00
tobiasKaminsky be977dda31 update ScreenshotIT
add helper script

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-17 07:47:59 +02:00
Nextcloud bot aa5cf6b5ae [tx-robot] updated from transifex 2020-07-17 03:32:59 +00:00
Tobias Kaminsky f7e08a724b Merge pull request #6441 from nextcloud/previewText
fix wrong show of sort/list group and FAB in details or text preview
2020-07-16 11:08:52 +02:00
Nextcloud bot 990673077f [tx-robot] updated from transifex 2020-07-16 03:43:23 +00:00
Andy Scherzinger cc1c4e9b11 Merge pull request #6452 from nextcloud/dialogTests
Add tests for dialogs
2020-07-15 19:31:26 +02:00
tobiasKaminsky cc18577efa fix after rebasing
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-15 15:44:36 +02:00
tobiasKaminsky db6c1ba055 new screenshots, disabled non working
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-15 15:42:26 +02:00
tobiasKaminsky 3b89449939 RetryRule does not work on Screenshot Tests
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-15 15:42:26 +02:00
tobiasKaminsky 4336082bb7 Add tests for dialogs
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-15 15:42:26 +02:00
Tobias Kaminsky 93183cf9b2 Merge pull request #6474 from nextcloud/dependabot/gradle/com.android.tools.build-gradle-4.0.1
Bump gradle from 4.0.0 to 4.0.1
2020-07-15 15:39:31 +02:00
Nextcloud bot e4335583cf [tx-robot] updated from transifex 2020-07-15 03:59:53 +00:00
dependabot-preview[bot] 7932a2a876 Bump gradle from 4.0.0 to 4.0.1
Bumps gradle from 4.0.0 to 4.0.1.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-15 01:12:12 +00:00
Nextcloud bot 818ff4f11d [tx-robot] updated from transifex 2020-07-14 03:31:31 +00:00
Tobias Kaminsky 7dd42f0bac Merge pull request #6438 from nextcloud/ezaquarii/migrate-upload-file-operation-to-user-model
Migrate UploadFileOperation to User model
2020-07-13 08:37:48 +02:00
Tobias Kaminsky ca7cdc9524 Merge pull request #6447 from nextcloud/ezaquarii/migrate-file-menu-filter-to-user-model
Migrate FileMenuFiler to User model
2020-07-13 08:37:07 +02:00
Tobias Kaminsky 4e31f15c09 Merge pull request #6466 from nextcloud/dependabot/gradle/org.mockito-mockito-core-3.4.0
Bump mockito-core from 3.3.3 to 3.4.0
2020-07-13 07:32:58 +02:00
Tobias Kaminsky 0896ad7c17 Merge pull request #6467 from nextcloud/dependabot/gradle/org.mockito-mockito-android-3.4.0
Bump mockito-android from 3.3.3 to 3.4.0
2020-07-13 07:32:31 +02:00
dependabot-preview[bot] 2edc1320ea Bump mockito-android from 3.3.3 to 3.4.0
Bumps [mockito-android](https://github.com/mockito/mockito) from 3.3.3 to 3.4.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.3.3...v3.4.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-13 01:14:00 +00:00
dependabot-preview[bot] 493d0b76ee Bump mockito-core from 3.3.3 to 3.4.0
Bumps [mockito-core](https://github.com/mockito/mockito) from 3.3.3 to 3.4.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.3.3...v3.4.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-07-13 01:13:08 +00:00
Nextcloud bot 9b73819256 [tx-robot] updated from transifex 2020-07-12 03:31:03 +00:00
Nextcloud bot 34c27204d4 [tx-robot] updated from transifex 2020-07-11 03:31:32 +00:00
Andy Scherzinger d96b4e4c6c Merge pull request #6442 from nextcloud/themeLogin
Theme login with server capability
2020-07-10 11:52:26 +02:00
Tobias Kaminsky 234c8d33ee Merge pull request #6434 from nextcloud/removeDialogTitleTheming
Remove title theming of modal dialog
2020-07-10 11:41:19 +02:00
tobiasKaminsky b46af2b5fa fix tests
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-10 11:34:25 +02:00
tobiasKaminsky ea0c09dd49 Theme login with server capability
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-10 11:22:55 +02:00
Tobias Kaminsky a2743f206a Merge pull request #6445 from nextcloud/downloadedE2E
show downloaded encrypted files in subfolders
2020-07-10 10:57:49 +02:00
Tobias Kaminsky 3730eff7ae Merge pull request #6435 from nextcloud/directLogin
direct login works again
2020-07-10 10:57:24 +02:00
Nextcloud bot aef8ee5384 [tx-robot] updated from transifex 2020-07-10 03:35:10 +00:00
Chris Narkiewicz 69414303a8 Migrate FileMenuFiler to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-09 23:00:19 +01:00
Chris Narkiewicz 7bb49bd610 Migrate UploadFileOperation to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-09 17:51:23 +02:00
nextcloud-android-bot 94b26cc28e Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-07-09 14:50:07 +00:00
Andy Scherzinger 2ed70f279d remove unused import
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-09 16:34:52 +02:00
Andy Scherzinger 2916c82a5b spotbugs: remove unused variables
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-09 16:34:51 +02:00
Andy Scherzinger b6d09c42a9 dialog buttons shouldn't have a background color
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-09 16:34:50 +02:00
Andy Scherzinger 8585e44d4b make sure dialog button text is not allCaps and title is standard material colored
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-09 16:34:50 +02:00
Andy Scherzinger 7cda9b5e8d remove unused variable
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-09 16:34:49 +02:00
Andy Scherzinger 27fc8c6540 Remove title theming of modal dialog
Resolves #6429

Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-09 16:34:37 +02:00
Tobias Kaminsky a7b90ed588 Merge pull request #6439 from nextcloud/ezaquarii/migrate-data-transfer-listener-to-user-model
Migrate data transfer listener to User model
2020-07-09 15:19:17 +02:00
tobiasKaminsky 419b14afcf show downloaded encrypted files in subfolders
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-09 12:17:47 +02:00
tobiasKaminsky be9d4facce fix wrong show of sort/list group and FAB in details or text preview
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-09 07:43:20 +02:00
Nextcloud bot 89edfe518b [tx-robot] updated from transifex 2020-07-09 03:33:24 +00:00
Chris Narkiewicz 6b3c4621b7 Migrate data transfer listener to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-08 22:47:35 +01:00
tobiasKaminsky d8d24908da direct login works again
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-08 16:03:12 +02:00
Nextcloud bot 4eadfac145 [tx-robot] updated from transifex 2020-07-08 03:42:18 +00:00
Tobias Kaminsky 9c066bbe2a Merge pull request #6426 from nextcloud/reduceOutput
reduce log output for drone
2020-07-07 15:48:00 +02:00
Andy Scherzinger 2562a84352 Merge pull request #6425 from nextcloud/changelog-master-stable-3.12.1
Add changelog for 3.12.1
2020-07-07 14:57:44 +02:00
tobiasKaminsky a884bab878 reduce log output for drone
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-07 11:48:25 +02:00
Tobias Kaminsky e3121bf18d Merge pull request #6423 from nextcloud/noNotNull
do not user NotNull, but NonNull
2020-07-07 11:34:02 +02:00
tobiasKaminsky 909fb2187f Add changelog for 3.12.1
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-07 10:32:29 +02:00
tobiasKaminsky 1b62bb93cb do not user NotNull, but NonNull
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-07 10:16:32 +02:00
Tobias Kaminsky fd1d391d2b Merge pull request #6421 from nextcloud/ezaquarii/migrate-setup-encryption-dialog-fragment-to-user-model
Migrate SetupEncryptionDialogFragment to User model
2020-07-07 07:55:30 +02:00
Tobias Kaminsky b047dccd56 Merge pull request #6420 from nextcloud/ezaquarii/migrate-mime-type-util-get-file-type-icon-to-user-model
Migrate MimeTypeUtil.getFileTypeIcon to User model
2020-07-07 07:51:26 +02:00
Tobias Kaminsky b39bceb607 Merge pull request #6419 from nextcloud/ezaquarii/migrate-preview-image-pager-adapter-to-user-model
Migrate PreviewImagePagerAdapter to User model
2020-07-07 07:50:27 +02:00
Nextcloud bot 31ac25f8d0 [tx-robot] updated from transifex 2020-07-07 03:36:26 +00:00
Chris Narkiewicz 3c87c8fc67 Migrate SetupEncryptionDialogFragment to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-06 20:58:36 +01:00
Chris Narkiewicz eb722457ca Migrate MimeTypeUtil.getFileTypeIcon to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-06 20:46:13 +01:00
Chris Narkiewicz c56e2c3d21 Migrate PreviewImagePagerAdapter to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-06 20:31:33 +01:00
Tobias Kaminsky 6b431a388e Merge pull request #6415 from nextcloud/ezaquarii/migrate-mimetypeutil-get-folder-type-icon-to-user-model
Migrate MimeTypeUtil.folderTypeIcon to user model
2020-07-06 15:29:42 +02:00
Tobias Kaminsky 5e6038ef1d Merge pull request #6414 from nextcloud/ezaquarii/migrate-upload-list-adapter-to-user-model
Migrate UploadListAdapter to User model
2020-07-06 15:29:11 +02:00
Tobias Kaminsky 3f254ee348 Merge pull request #6375 from nextcloud/ezaquarii/migrate-audio-player-and-audio-preview-to-user-model
Migrate audio player and preview fragment to user model
2020-07-06 15:28:35 +02:00
tobiasKaminsky 13593fb7f7 fix possible NPE
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-06 11:31:02 +02:00
tobiasKaminsky f9b232fb49 minor code formatting
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-06 10:37:18 +02:00
tobiasKaminsky 0af29bf500 Fix ReceiveExternalFilesActivity account -> user
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-06 10:29:07 +02:00
Nextcloud bot 9cd108d229 [tx-robot] updated from transifex 2020-07-06 03:25:45 +00:00
Chris Narkiewicz ed9afe8c6c Migrate MumeTypeUtil.folderTypeIcon to user model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-05 23:12:56 +01:00
Chris Narkiewicz c650e55af9 Migrate UploadListAdapter to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-05 22:53:29 +01:00
Chris Narkiewicz 277f08b941 Migrate player service and preview fragment to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-07-05 22:18:55 +01:00
Nextcloud bot 8e7ce3c7a1 [tx-robot] updated from transifex 2020-07-05 03:26:35 +00:00
Nextcloud bot d52b1cc6ba [tx-robot] updated from transifex 2020-07-04 03:28:45 +00:00
Nextcloud bot d137302dab [tx-robot] updated from transifex 2020-07-03 03:31:35 +00:00
Andy Scherzinger 93528534aa Merge pull request #6404 from nextcloud/removeFilesdrop
remove fileDrop capability
2020-07-02 14:34:39 +02:00
Tobias Kaminsky 1126823db9 Merge pull request #6400 from nextcloud/themeIconImagesWithUnicolorBackgrounds
Add theming logic for share link icons
2020-07-02 13:55:14 +02:00
tobiasKaminsky 73bc3735d4 remove fileDrop capability
Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-02 13:50:37 +02:00
Tobias Kaminsky a6dd338c79 Merge pull request #6403 from nextcloud/maliciousCode
Spotbugs: fixed all malicious code errors
2020-07-02 12:46:20 +02:00
Andy Scherzinger fd47348f1b Resolve #6399 adding theming logic for share link icons
Signed-off-by: Andy Scherzinger <[email protected]>
2020-07-02 09:18:32 +02:00
Nextcloud bot 0f67f4b1e1 [tx-robot] updated from transifex 2020-07-02 03:37:07 +00:00
nextcloud-android-bot a06057acfa Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-07-01 13:52:27 +00:00
tobiasKaminsky eda28d67a6 Spotbugs:
MS 	com.owncloud.android.db.ProviderMeta$ProviderTableMeta.FILE_ALL_COLUMNS is a mutable array
MS 	com.owncloud.android.providers.UsersAndGroupsSearchProvider.ACTION_SHARE_WITH isn't final and can't be protected from malicious code
MS 	com.owncloud.android.utils.FileSortOrder.sortOrders is a mutable collection
MS 	org.nextcloud.providers.cursors.FileCursor.DEFAULT_DOCUMENT_PROJECTION should be package protected

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-01 15:36:56 +02:00
Andy Scherzinger 2192bdcf39 Merge pull request #6396 from nextcloud/editLabel
Edit label for public share
2020-07-01 13:49:43 +02:00
tobiasKaminsky 4bb0a3c176 Edit label for public share
split up between public share and user shares

Signed-off-by: tobiasKaminsky <[email protected]>
2020-07-01 12:07:26 +02:00
Tobias Kaminsky 325e6005c5 Merge pull request #6397 from nextcloud/Valdnet-patch-1
l10n: Delete a space character
2020-07-01 11:11:16 +02:00
Valdnet ee3e92c805 l10n: Delete a space character 2020-07-01 09:22:38 +02:00
Nextcloud bot 19d37ef49d [tx-robot] updated from transifex 2020-07-01 03:27:02 +00:00
Andy Scherzinger 0acae91fdf Merge pull request #6392 from nextcloud/removeEditShareFragment
remove EditShareFragment.java
2020-06-30 16:52:23 +02:00
tobiasKaminsky f6e8636cfa remove EditShareFragment.java
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 15:32:17 +02:00
Andy Scherzinger ba62819180 Merge pull request #6391 from nextcloud/switch
add default to switch
2020-06-30 14:46:01 +02:00
Tobias Kaminsky cee5b45b84 Merge pull request #6121 from nextcloud/enhance_deep_links
enhance deep linking to allow pretty urls
2020-06-30 12:30:43 +02:00
tobiasKaminsky 05748959e9 exit always with 0
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 11:55:52 +02:00
Tobias Kaminsky 969c0d3916 Merge pull request #5593 from nextcloud/fix-synced-folder-dialog-click
Synced folder dialog: fix summary click event intercepting parent
2020-06-30 11:46:05 +02:00
tobiasKaminsky 726e4ca7b4 remove unused ressources
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 10:52:46 +02:00
nextcloud-android-bot 444dcd000e Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-30 07:55:26 +00:00
Tobias Kaminsky 551628d4fe Merge pull request #6358 from nextcloud/multipleShareLink
add multiple share links
2020-06-30 09:51:12 +02:00
Tobias Kaminsky 9f7f28c7c1 Merge pull request #6373 from nextcloud/ezaquarii/add-deck-api-to-dependency-injection-framework
Provide DeckApi via dependency injection framework
2020-06-30 09:49:17 +02:00
drone 5fa9f7420d Merge commit 'db5b0752f87d7b0647e7d8c99c21adc99151abb1' 2020-06-30 07:42:19 +00:00
tobiasKaminsky db5b0752f8 add default to switch
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 09:39:28 +02:00
tobiasKaminsky 7cbfc58036 fix switch statement
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 09:35:33 +02:00
tobiasKaminsky 3d7e8b770a add missing import
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 08:45:52 +02:00
Tobias Kaminsky f1a70ccb32 Merge pull request #6364 from nextcloud/ezaquarii/fix-npe-in-file-list-fragment-when-file-is-null
Fix NPE in OCFileListFragment when OCFile is null
2020-06-30 08:42:52 +02:00
tobiasKaminsky d721941032 fix test
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 08:41:27 +02:00
tobiasKaminsky f07e14fd30 minor code changes after rebase
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 08:34:39 +02:00
Alice Gaudon 7af28a1c36 Synced folder dialog: remove local and remote folder icons
Signed-off-by: Alice Gaudon <[email protected]>
2020-06-30 07:53:13 +02:00
Alice Gaudon e5f56152b0 Synced folder dialog: use display name instead of full path for local folder
Signed-off-by: Alice Gaudon <[email protected]>
2020-06-30 07:53:13 +02:00
Alice Gaudon 4a4ad20e66 Synced folder dialog: remove folder path expand action
Signed-off-by: Alice Gaudon <[email protected]>
2020-06-30 07:53:13 +02:00
Chris Narkiewicz 74e68d6b8e Deep link handler tests
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-30 07:51:21 +02:00
Chris Narkiewicz a887a4c32b Move user filtering to deep link handler
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-30 07:51:21 +02:00
Chris Narkiewicz 50b19e5d77 Refactored deep link handling
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-30 07:51:21 +02:00
Chris Narkiewicz bcb1262064 Deep link handler prototype
Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-30 07:51:20 +02:00
szaimen 214689bc0d allow 3 times deep nextcloud nesting
Signed-off-by: szaimen <[email protected]>
2020-06-30 07:51:20 +02:00
szaimen ed4917db14 Update pattern matcher to allow pretty urls
Signed-off-by: szaimen <[email protected]>
2020-06-30 07:51:20 +02:00
szaimen 815e30166e allow pretty urls
Signed-off-by: szaimen <[email protected]>
2020-06-30 07:51:20 +02:00
tobiasKaminsky 40d40c32b1 revert library
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 07:34:24 +02:00
tobiasKaminsky 51365fa7c3 fixes after rebase
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 07:34:24 +02:00
Andy Scherzinger 3848346f4a remove literals in conditional statements 2020-06-30 07:34:23 +02:00
Andy Scherzinger 3c7fe3a405 UI fine tuning for link items / sharing fragments
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-30 07:34:04 +02:00
tobiasKaminsky 8c9841f033 add multiple share links
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-30 07:34:03 +02:00
Tobias Kaminsky ff4a0a7030 Merge pull request #6372 from nextcloud/ezaquarii/migrate-file-details-to-user-model
Migate file details and share details to User model
2020-06-30 07:29:48 +02:00
Tobias Kaminsky 197552a488 Merge pull request #6158 from nextcloud/dependabot/gradle/daggerVersion-2.28
Bump daggerVersion from 2.27 to 2.28
2020-06-30 07:27:39 +02:00
Nextcloud bot beb45efc0b [tx-robot] updated from transifex 2020-06-30 03:26:21 +00:00
tobiasKaminsky 10f6ec94fa Add to jetified-dagger-lint-aar-2.28.1 for custom lint check
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 16:59:20 +02:00
tobiasKaminsky 738291b2fa Bump to dagger 2.28.1
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 16:31:15 +02:00
dependabot-preview[bot] 14fd15e9ae Bump daggerVersion from 2.27 to 2.28
Bumps `daggerVersion` from 2.27 to 2.28.

Updates `dagger` from 2.27 to 2.28
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.27...dagger-2.28)

Updates `dagger-android` from 2.27 to 2.28
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.27...dagger-2.28)

Updates `dagger-android-support` from 2.27 to 2.28
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.27...dagger-2.28)

Updates `dagger-compiler` from 2.27 to 2.28
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.27...dagger-2.28)

Updates `dagger-android-processor` from 2.27 to 2.28
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.27...dagger-2.28)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-29 16:31:15 +02:00
Tobias Kaminsky 4073cd235c Merge pull request #6341 from nextcloud/fragmentContainerView
Replace fragment by FragmentContainerView
2020-06-29 16:30:40 +02:00
tobiasKaminsky cc517ffcfd Lint ignore
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 16:00:44 +02:00
tobiasKaminsky 98d1b5e2b9 split up delete old commit to always delete them
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 16:00:44 +02:00
tobiasKaminsky 3102c23d2c always delete old comments
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 16:00:44 +02:00
tobiasKaminsky 32a0d1c309 Replace fragment by FragmentContainerView
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 16:00:44 +02:00
Tobias Kaminsky 212b3a6ef9 Merge pull request #6385 from nextcloud/fixDeleteOnSuccess
type -> TYPE
2020-06-29 15:59:58 +02:00
tobiasKaminsky fd7b722ac4 type -> TYPE
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 15:59:36 +02:00
Tobias Kaminsky 0207e70323 Merge pull request #6384 from nextcloud/dronePermission
make deleteOutdatedComments.sh executable
2020-06-29 15:42:14 +02:00
tobiasKaminsky fb5ae37a38 make deleteOutdatedComments.sh executable
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-29 15:41:55 +02:00
Tobias Kaminsky ced60bf59b Merge pull request #6366 from nextcloud/deleteOutdatedComments
Delete outdated comments in case of success
2020-06-29 10:28:59 +02:00
Tobias Kaminsky 3c609a329f Merge pull request #6332 from nextcloud/enh/darkThemeOptimizations
Enh/dark theme optimizations
2020-06-29 10:28:36 +02:00
Tobias Kaminsky 9a0d1085ed Merge pull request #6382 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.4.4
Bump spotbugs-gradle-plugin from 4.4.3 to 4.4.4
2020-06-29 10:00:45 +02:00
Tobias Kaminsky a5142483a4 Merge pull request #6381 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.10.0
Bump detekt-gradle-plugin from 1.9.1 to 1.10.0
2020-06-29 10:00:31 +02:00
Tobias Kaminsky 1edaffeafe Merge pull request #6380 from nextcloud/dependabot/gradle/net.bytebuddy-byte-buddy-1.10.13
Bump byte-buddy from 1.10.12 to 1.10.13
2020-06-29 10:00:12 +02:00
Tobias Kaminsky b2ff37505e Merge pull request #6244 from nextcloud/blackNavBar
black nav bar on image preview
2020-06-29 09:59:06 +02:00
Nextcloud bot ebbedb46a0 [tx-robot] updated from transifex 2020-06-29 03:26:45 +00:00
dependabot-preview[bot] dfe2e5dbd4 Bump spotbugs-gradle-plugin from 4.4.3 to 4.4.4
Bumps spotbugs-gradle-plugin from 4.4.3 to 4.4.4.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-29 01:14:26 +00:00
dependabot-preview[bot] c1f5817f3f Bump detekt-gradle-plugin from 1.9.1 to 1.10.0
Bumps detekt-gradle-plugin from 1.9.1 to 1.10.0.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-29 01:13:56 +00:00
dependabot-preview[bot] 9f23230bf1 Bump byte-buddy from 1.10.12 to 1.10.13
Bumps [byte-buddy](https://github.com/raphw/byte-buddy) from 1.10.12 to 1.10.13.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.10.12...byte-buddy-1.10.13)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-29 01:13:16 +00:00
Nextcloud bot fbfdf1104a [tx-robot] updated from transifex 2020-06-28 03:27:05 +00:00
Nextcloud bot bf587f1a65 [tx-robot] updated from transifex 2020-06-27 03:26:25 +00:00
Chris Narkiewicz dbae9443eb Provide DeckApi via dependency injection framework
- renamed integration packate to integrations (plural)
- created DI module for integrations
- added provider for DeckApi
- inject DeckApi to background job factory

Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-26 23:43:43 +01:00
Chris Narkiewicz e13a3ca7cb Migate file details and share details to User model
UserAccountManager:
 - added userOwnsFile API that replaces accountOwnsFile
 - deprecated accountOwnsFile

FileDisplayActivity:
 - simplified initFragmentWithFile by passing non-null instanecs
   of user and file and thus avoiding numerous redundant null-checks
 - fragments are initialized using User model instead of Account
 - transfer and download callbacks use getUser() instead of getAccount()
   and pass user instance to framents

ShareActivity
 - initlize fragment using user model instead of account
 - close acivity immediately if current user is not available
   (cannot reach such state not, but historically account was nullable)

FileDetailTabAdapter
 - framents are initialized using User model instead of Account

FileDetailActivitiesFragment
 - migrated to User
 - removed dependency on constants from FileActivity

FileDetailFragment
 - migrated to User
 - removed dependency on constants from FileActivity

FileDetailsSharingFragment
 - migrated to User
 - removed dependency on constants from FileActivity

Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-26 23:07:40 +01:00
nextcloud-android-bot 79f4270bb9 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-26 13:35:51 +00:00
Andy Scherzinger 5f73a5ec75 update screenshots
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:30 +02:00
Andy Scherzinger 0ad81bdd29 remove element color references
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:29 +02:00
Andy Scherzinger 8af257d54f remove unused method
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:27 +02:00
Andy Scherzinger a7088c8c87 improve edge case FAB coloring
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:25 +02:00
Andy Scherzinger 5b76892ab1 move primary action button theming to new theming method
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:24 +02:00
Andy Scherzinger 7005cdef2e Introduce light/dark theme / black/white primary-color-aware primary-button theming
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:22 +02:00
Andy Scherzinger 643454c1d7 proper coloring of drawer items in black/white edge case scenarios
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:21 +02:00
Andy Scherzinger 20d2ef989d proper button coloring for dark theme + black primary color
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 15:15:14 +02:00
Andy Scherzinger dfc94f4505 Merge pull request #6354 from nextcloud/noShare
Enhance FileDetailSharingFragment
2020-06-26 13:27:16 +02:00
tobiasKaminsky 8f0e4eab60 Delete outdated comments in case of success
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-26 12:51:47 +02:00
Andy Scherzinger 93d0875883 Merge pull request #6253 from nextcloud/noNothingIfNoActivity
PreviewImageFragment: if we have no activity, do nothing
2020-06-26 11:13:58 +02:00
Joris Bodin 947e4a1b10 Remove duplacation
Signed-off-by: Joris Bodin <[email protected]>
2020-06-26 11:05:44 +02:00
tobiasKaminsky c55e9b8fd2 black nav bar on image preview
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-26 11:05:44 +02:00
Andy Scherzinger 2b5c39095d lint: remove unused resource
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-26 11:03:09 +02:00
tobiasKaminsky 348ae4435a Enhance FileDetailSharingFragment:
- remove no users text
- disable search view if reshare is not allowed
- show note icon

Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-26 11:03:03 +02:00
Tobias Kaminsky a22b0724ae Merge pull request #6367 from nextcloud/fixTypeInReport
type -> TYPE
2020-06-26 10:58:58 +02:00
tobiasKaminsky c42c24be80 type -> TYPE
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-26 10:58:34 +02:00
Tobias Kaminsky 7e03aa39b5 Merge pull request #6365 from nextcloud/fixDeleteCommits
fix deleting outdated comments
2020-06-26 10:36:11 +02:00
tobiasKaminsky 097434916e fix deleting outdated comments
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-26 10:35:48 +02:00
Tobias Kaminsky 728de81736 Merge pull request #6263 from nextcloud/scrollPart2
Hide on scrolling for activities and notifications
2020-06-26 08:39:57 +02:00
Chris Narkiewicz 5609b5041e Fix NPE in OCFileListFragment when OCFile is null
1. Fixed NPE
2. Audited all use of nullable field in all called APIs
3. Updated called APIs nullability documentation

Fixes #6282

Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-25 22:55:08 +01:00
tobiasKaminsky d36c2d35a5 Hide on scrolling for activities and notifications
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 23:44:03 +02:00
tobiasKaminsky 741cc24d11 fix #5468
if we have no activity, do nothing

Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 23:36:05 +02:00
Andy Scherzinger 5288548e70 Merge pull request #6338 from nextcloud/legacyLoginFlow
Removed legacy login
2020-06-25 23:33:57 +02:00
nextcloud-android-bot e0d5676151 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-25 21:18:34 +00:00
tobiasKaminsky 7ed4e2b24e changes due to CR
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 22:57:48 +02:00
tobiasKaminsky 58ba15ac95 Removed legacy login
cleaned up a bit AuthenticatorActivity

Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 22:57:22 +02:00
Andy Scherzinger fe1cd33c26 Merge pull request #6344 from nextcloud/ocp
fix OCP_OVERLY_CONCRETE_PARAMETER
2020-06-25 20:30:34 +02:00
Andy Scherzinger c3f838d445 Merge pull request #6349 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.4.3
Bump spotbugs-gradle-plugin from 4.3.0 to 4.4.3
2020-06-25 20:29:45 +02:00
Andy Scherzinger 2f60b75fc5 add null check 2020-06-25 18:55:50 +02:00
nextcloud-android-bot f6e7c44596 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-25 16:55:05 +00:00
tobiasKaminsky 1017e3ac3b fix OCP_OVERLY_CONCRETE_PARAMETER
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 18:45:28 +02:00
Andy Scherzinger 2913918232 Merge pull request #6361 from nextcloud/fixZoom
Fix zoom, toggle background
2020-06-25 17:12:00 +02:00
tobiasKaminsky ca7350fa8a use fixed spotbug version
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 16:52:12 +02:00
dependabot-preview[bot] 2c5fb2b2f9 Bump spotbugs-gradle-plugin from 4.3.0 to 4.4.3
Bumps spotbugs-gradle-plugin from 4.3.0 to 4.4.3.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-25 16:52:12 +02:00
Tobias Kaminsky d70502f747 Merge pull request #6262 from nextcloud/hideOnScrolling
Hide on scrolling
2020-06-25 16:18:40 +02:00
tobiasKaminsky 38c28332e2 fix tests
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 15:57:46 +02:00
tobiasKaminsky bd5c9dfa1e make function puplic for testing
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 15:22:58 +02:00
tobiasKaminsky db4a7ee8f5 Fix zoom, toggle background
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 15:17:54 +02:00
Andy Scherzinger 066fef03c2 Merge pull request #6359 from nextcloud/photoBugfix
use view instead of linear layout as common parent
2020-06-25 13:44:32 +02:00
nextcloud-android-bot 741fb410f1 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-25 11:13:55 +00:00
nextcloud-android-bot 961e6c179a Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-25 13:00:04 +02:00
tobiasKaminsky 22657040bd Removed possible NPE
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 12:59:54 +02:00
tobiasKaminsky a9dc3f5787 removed duplicated sort/switch grid buttons
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 12:59:54 +02:00
tobiasKaminsky e5ec91b5a7 Changes due to CR
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 12:59:54 +02:00
tobiasKaminsky 1ecd64f128 Hide on scrolling, fix https://github.com/nextcloud/android/issues/6238
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 12:59:54 +02:00
tobiasKaminsky 6dfb4c7ef6 use view instead of linear layout as common parent
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-25 12:48:40 +02:00
Nextcloud bot 56a1fc868d [tx-robot] updated from transifex 2020-06-25 03:28:24 +00:00
Andy Scherzinger 83d4aaf1ab Merge pull request #6345 from nextcloud/usbr
fix USBR_UNNECESSARY_STORE_BEFORE_RETURN
2020-06-24 23:18:08 +02:00
Andy Scherzinger 01d9d2e437 Merge pull request #6347 from nextcloud/uselessParent
Remove useless parents
2020-06-24 23:15:04 +02:00
nextcloud-android-bot 98d930b8ab Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-24 21:00:09 +00:00
nextcloud-android-bot 0fa902d2d2 Drone: update Lint results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-24 20:58:48 +00:00
tobiasKaminsky 1f5352f2ec Remove useless parents
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-24 22:05:37 +02:00
tobiasKaminsky 72fce1dd1e fix USBR_UNNECESSARY_STORE_BEFORE_RETURN
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-24 21:54:56 +02:00
Andy Scherzinger 9e633b91b5 Merge pull request #6342 from nextcloud/view-binding
View binding
2020-06-24 20:28:20 +02:00
Andy Scherzinger 37fdd97c29 Merge pull request #6355 from nextcloud/unshareOnBottom
on user share permission: unshare as destructive option on bottom
2020-06-24 20:22:20 +02:00
Andy Scherzinger cb0ae700db Merge pull request #6346 from nextcloud/urf
fix URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD
2020-06-24 17:21:41 +02:00
nextcloud-android-bot 9f3e1857db Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-24 15:17:33 +00:00
Andy Scherzinger f0a608acde remove unused constants
Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-24 17:00:38 +02:00
tobiasKaminsky 4a791dda86 fix URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-24 16:45:15 +02:00
Andy Scherzinger 3e05624064 Merge pull request #6351 from nextcloud/castException
rich workspace not in folder picker activity
2020-06-24 12:52:36 +02:00
Andy Scherzinger 33dfc9651a Merge pull request #6353 from nextcloud/userSearchText
Use same search hint as on server
2020-06-24 12:49:21 +02:00
tobiasKaminsky 14172fd1f0 on user share permission: unshare as destructive option on bottom
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-24 11:51:53 +02:00
tobiasKaminsky b18ff7404e Use same search hint as on server
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-24 10:58:24 +02:00
Tobias Kaminsky ed8819ec86 Merge pull request #6327 from nextcloud/combineShare
Combined ShareActivity with FileDetailSharingFragment as much as possible
2020-06-24 10:43:24 +02:00
tobiasKaminsky a424706368 rich workspace not in folder picker activity
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-24 07:56:58 +02:00
Andy Scherzinger 7ced94d42e Merge pull request #6343 from nextcloud/lsc
fix LSC_LITERAL_STRING_COMPARISON
2020-06-24 06:56:54 +02:00
Stefan Niedermann 0aed8aaa86 #6247 View Binding - Fix new SpotBugs performance warning (unread field)
Signed-off-by: Stefan Niedermann <[email protected]>
2020-06-23 18:21:22 +02:00
nextcloud-android-bot c5abe938bd Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-23 14:30:27 +00:00
tobiasKaminsky 4e52f7f970 fix LSC_LITERAL_STRING_COMPARISON
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-23 14:59:02 +02:00
Stefan Niedermann a43933082d #6247 View Binding - Remove unused imports
Signed-off-by: Stefan Niedermann <[email protected]>
2020-06-23 14:10:18 +02:00
Stefan Niedermann 374bb21c33 #6247 View Binding - SendButtonAdapter.ViewHolder
Signed-off-by: Stefan Niedermann <[email protected]>
2020-06-23 14:01:45 +02:00
Stefan Niedermann 558f1775de #6247 View Binding - AccountItemBinding & AccountActionBinding
Signed-off-by: Stefan Niedermann <[email protected]>
2020-06-23 11:15:03 +02:00
Stefan Niedermann 934e1f406a #6247 View Binding - ConflictResolveDialogBinding
Signed-off-by: Stefan Niedermann <[email protected]>
2020-06-23 10:51:40 +02:00
tobiasKaminsky 7732ff065b Combined ShareActivity with FileDetailSharingFragment as much as possible
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-23 10:47:43 +02:00
Tobias Kaminsky 9e6fa5c769 Merge pull request #6281 from nextcloud/view-binding
#6247 View Binding - FileDisplayActivity and partial Ssl views
2020-06-23 10:36:08 +02:00
Tobias Kaminsky 59fddce138 Merge pull request #6243 from nextcloud/navBar
color nav bar
2020-06-23 10:30:52 +02:00
tobiasKaminsky e503106960 Fixed NPE when hiding ssl cert
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-23 09:23:59 +02:00
Stefan Niedermann 96aecac8ed #6247 View Binding - Fix codacy issue
Signed-off-by: Stefan Niedermann <[email protected]>
2020-06-23 09:23:59 +02:00
Stefan Niedermann ab3dff9e1b #6247 View Binding - FileDisplayActivity and partial Ssl views 2020-06-23 09:23:59 +02:00
Tobias Kaminsky 2bbaf7b21d Merge pull request #6335 from stephanritscher/fix-deleting-synced-folder
Fix improper deleting synced folder by OfflineSyncWork
2020-06-23 08:12:21 +02:00
Stephan Ritscher 9370cbab09 Fix improper deleting synced folder by OfflineSyncWork 2020-06-22 21:09:41 +02:00
Tobias Kaminsky 388301082d Merge pull request #6322 from nextcloud/bountysource
Do not advertise bountyscource, but NC include
2020-06-19 13:00:32 +02:00
tobiasKaminsky 4bdd27ffe0 Do not advertise bountyscource, but NC include
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 12:59:41 +02:00
Andy Scherzinger fb1bb6905c Merge pull request #6180 from nextcloud/dependabot/gradle/com.android.tools.build-gradle-4.0.0
Bump gradle from 3.6.3 to 4.0.0
2020-06-19 12:23:56 +02:00
nextcloud-android-bot 3a28b84e9d Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-19 09:29:38 +00:00
tobiasKaminsky 94d7506cb5 fix after rebase
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:16:34 +02:00
tobiasKaminsky ab0ea3e8d9 minor changes to build.gradle and fixed type on uploadReport.sh
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:05:47 +02:00
tobiasKaminsky eb08f75257 minor changes to build.gradle
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:24 +02:00
tobiasKaminsky e40893a136 Use always recommended spotbug version, defined by plugin
exclude data binding generated classes

Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:24 +02:00
tobiasKaminsky 5f185326ab Fixed Lint:
MissingClass: Missing registered class
Range: Outside Range
UseAppTint: app:tint attribute should be used on ImageView
UseCompatLoadingForDrawables
UseCompatTextViewDrawableXml

Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:22 +02:00
tobiasKaminsky a9f689044d Delete old comments for corresponding type
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:07 +02:00
tobiasKaminsky 7360bbabfe Fix spotbugs output
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:07 +02:00
tobiasKaminsky 0f9ec55d7a update combinedTestReport
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:07 +02:00
tobiasKaminsky 7802fabf0e if multiple apksigner are available, use newest one
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:07 +02:00
tobiasKaminsky f6f401aa0d change to newer spotbugs
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:07 +02:00
tobiasKaminsky 123593fc4e change Gradle to 6.1.1
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-19 11:03:06 +02:00
dependabot-preview[bot] a9b8bf7f3a Bump gradle from 3.6.3 to 4.0.0
Bumps gradle from 3.6.3 to 4.0.0.

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-19 11:03:06 +02:00
Andy Scherzinger 0630142792 Merge pull request #6320 from nextcloud/dependabot/gradle/net.bytebuddy-byte-buddy-1.10.12
Bump byte-buddy from 1.10.11 to 1.10.12
2020-06-19 09:56:47 +02:00
dependabot-preview[bot] 7306bc096d Bump byte-buddy from 1.10.11 to 1.10.12
Bumps [byte-buddy](https://github.com/raphw/byte-buddy) from 1.10.11 to 1.10.12.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.10.11...byte-buddy-1.10.12)

Signed-off-by: dependabot-preview[bot] <[email protected]>
2020-06-19 01:13:00 +00:00
Joris Bodin a475af6ac6 Remove redundant style
Signed-off-by: Joris Bodin <[email protected]>
2020-06-18 11:02:52 +02:00
Andy Scherzinger c048fe2121 Merge pull request #6256 from nextcloud/clickConflictNotification
fix #5281: click on conflict notification opens conflict dialog directly
2020-06-18 09:26:58 +02:00
Tobias Kaminsky ace90ef2ad Merge pull request #6306 from nextcloud/fixBatteryDialog
check if activity is running before showing dialog
2020-06-18 07:06:47 +02:00
Tobias Kaminsky 1b1a58ed8c Merge pull request #6289 from nextcloud/ezaquarii/migrate-contacts-preference-activity-startup-to-type-safe-api
Migrate ContactsPreferenceActivity startup to type-safe API
2020-06-18 07:03:58 +02:00
tobiasKaminsky 6e7cdededb color nav bar
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-18 06:57:43 +02:00
Tobias Kaminsky cc06c8b613 Merge pull request #6283 from nextcloud/fixPhotoviewTitle
Show "photos" in title
2020-06-18 06:54:58 +02:00
Nextcloud bot 347abae8aa [tx-robot] updated from transifex 2020-06-18 03:28:10 +00:00
Andy Scherzinger 6a6913b17e Merge pull request #6303 from thgoebel/bottom-sheet-touch
Add touch states to file_list_actions_bottom_sheet
2020-06-17 18:53:25 +02:00
Andy Scherzinger 28279bc3c1 Merge pull request #6284 from nextcloud/fixPhotoViewAppbar
Fix appbar photos view when enter in background
2020-06-17 16:55:18 +02:00
Andy Scherzinger 663537f304 Merge pull request #6209 from nextcloud/dependabot/gradle/com.pinterest-ktlint-0.37.0
Bump ktlint from 0.36.0 to 0.37.0
2020-06-17 16:54:38 +02:00
Andy Scherzinger 39bb258648 Merge pull request #6231 from nextcloud/theme-refresh
Theme refresh bugfix
2020-06-17 16:53:51 +02:00
Andy Scherzinger a33cc9d278 Merge pull request #6309 from nextcloud/layout
remove unneeded linearLayout id
2020-06-17 16:53:06 +02:00
Andy Scherzinger 73c22d4e8f Merge pull request #6307 from thgoebel/addaccount-materialbutton
Use MaterialButton for addAccount action in accounts screen
2020-06-17 16:37:28 +02:00
Andy Scherzinger 7b88e39572 Merge pull request #6278 from nextcloud/enh/dropAndroid42
Drop Android 4.2 support
2020-06-17 15:35:51 +02:00
Daniel Bailey 6f31f92a3f Theme refresh bugfix
Removed call to setLocalNightMode from DrawerActivity to allow the theme
setting to be done by SettingsActivity and the following activity
recreation to be handled by BaseActivity.

Signed-off-by: Daniel Bailey <[email protected]>
2020-06-17 14:33:19 +02:00
Tobias Kaminsky f499fb3ee8 Merge pull request #6265 from nextcloud/fix/iconAlignment
Properly align 3-dot menu of folder items
2020-06-17 14:26:36 +02:00
Tobias Kaminsky d053177cf7 Merge pull request #6296 from nextcloud/tintFirstRun
tint first run
2020-06-17 14:25:41 +02:00
nextcloud-android-bot 8e5f893812 Drone: update Lint results to reflect reduced error/warning count [skip ci]
Signed-off-by: nextcloud-android-bot <[email protected]>
2020-06-17 12:12:39 +00:00
Joris Bodin 7f1ba75b7d Fix appbar photos view when enter in background
Signed-off-by: Joris Bodin <[email protected]>
2020-06-17 12:21:32 +02:00
tobiasKaminsky b6b57fa06e remove unneeded linearLayout id
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-17 11:06:38 +02:00
Andy Scherzinger adac921f5c Drop Android 4.2 support
Resolves #6276

Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-17 10:58:35 +02:00
dependabot-preview[bot] 78b879d10f Bump ktlint from 0.36.0 to 0.37.2
Bumps [ktlint](https://github.com/pinterest/ktlint) from 0.36.0 to 0.37.0.
- [Release notes](https://github.com/pinterest/ktlint/releases)
- [Changelog](https://github.com/pinterest/ktlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pinterest/ktlint/compare/0.36.0...0.37.0)

changed to new syntax

Signed-off-by: dependabot-preview[bot] <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-17 10:45:36 +02:00
Thore Goebel 7c5948b61a Use MaterialButton for addAccount action in accounts screen 2020-06-17 09:00:35 +02:00
tobiasKaminsky 0b15433cda check if activity is running before showing dialog
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-17 07:57:15 +02:00
Nextcloud bot 228a44fc87 [tx-robot] updated from transifex 2020-06-17 03:26:05 +00:00
Thore Goebel 094416e8e3 Add touch states to file_list_actions_bottom_sheet 2020-06-16 18:06:01 +02:00
Tobias Kaminsky 2d6c25ab0f Merge pull request #6300 from nextcloud/nextcloudClientNonBlocking
remove non needed exceptions
2020-06-16 15:40:18 +02:00
tobiasKaminsky 34eaf9d6db remove non needed exceptions
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-16 14:49:01 +02:00
tobiasKaminsky fd7cf51a4b tint first run
Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-15 16:23:30 +02:00
Chris Narkiewicz 3e3d80d08c Migrate ContactsPreferenceActivity startup to type-safe API
This change addresses #6277 bug in more comprehensible way.
All calls to Context.startActivity(...) starthing
ContactsPreferenceActivity are replaced with type-safe
calls to static ContactsPreferenceActivity.startActivity*
sets of APIs.

No client code should be calling `Intent(..., ContactsPreferenceActivity.class)`
constructor anymore.

See #5866 for discussion about the pattern used in this PR.

Signed-off-by: Chris Narkiewicz <[email protected]>
2020-06-13 17:42:24 +01:00
Joris Bodin fa9804d742 Show "photos" in title
Signed-off-by: Joris Bodin <[email protected]>
2020-06-12 15:25:44 +02:00
Andy Scherzinger 7d000f964e perperly align 3-dot menu of folder items
Fixes #6259

Signed-off-by: Andy Scherzinger <[email protected]>
2020-06-10 17:52:48 +02:00
tobiasKaminsky e95caf3572 centralize intent creation for
- FileUploader
- ConflictsResolveActivity

fix #5281: click on conflict notification opens conflict dialog directly

Signed-off-by: tobiasKaminsky <[email protected]>
2020-06-09 14:13:23 +02:00
439 changed files with 12273 additions and 10372 deletions

No files matched your search

+14 -50
View File
@@ -22,13 +22,14 @@ steps:
- emulator-headless -avd android-27 -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 src/main/res/values/setup.xml
- sed -i s"#server#server#" gradle.properties
- sed -i s"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
- ./gradlew assembleGplay
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew jacocoTestGplayDebugUnitTestReport && scripts/deleteOutdatedComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew createGplayDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew createGplayDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest && scripts/deleteOutdatedComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew combinedTestReport
- name: notify
image: drillster/drone-email
@@ -55,6 +56,8 @@ steps:
services:
- name: server
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
environment:
EVAL: true
commands:
- BRANCH='stable18' /usr/local/bin/initnc.sh
- echo 127.0.0.1 server >> /etc/hosts
@@ -101,13 +104,14 @@ steps:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- emulator-headless -avd android-27 -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 src/main/res/values/setup.xml
- sed -i s"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
- ./gradlew assembleGplay
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew jacocoTestGplayDebugUnitTestReport && scripts/deleteOutdatedComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew createGplayDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew createGplayDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest && scripts/deleteOutdatedComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew combinedTestReport
- curl -o codecov.sh https://codecov.io/bash
- bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
@@ -136,6 +140,8 @@ steps:
services:
- name: server
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
environment:
EVAL: true
commands:
- /usr/local/bin/initnc.sh
- echo 127.0.0.1 server >> /etc/hosts
@@ -186,8 +192,7 @@ steps:
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Screenshot" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- scripts/runAllScreenshotCombinations "stable" false
- name: notify
image: drillster/drone-email
settings:
@@ -209,26 +214,6 @@ steps:
- failure
branch:
- master
services:
- name: server
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
commands:
- BRANCH='stable18' /usr/local/bin/initnc.sh
- su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
- su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
- su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
- su www-data -c "php /var/www/html/occ group:add users"
- su www-data -c "php /var/www/html/occ group:adduser users user1"
- su www-data -c "php /var/www/html/occ group:adduser users user2"
- su www-data -c "git clone -b stable18 https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
- su www-data -c "php /var/www/html/occ app:enable activity"
- su www-data -c "git clone -b stable18 https://github.com/nextcloud/text.git /var/www/html/apps/text/"
- su www-data -c "php /var/www/html/occ app:enable text"
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
- /usr/local/bin/run.sh
trigger:
branch:
- master
@@ -261,8 +246,8 @@ steps:
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew gplayDebugExecuteScreenshotTests -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Screenshot" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- sed -i s"#5#1#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
- scripts/runAllScreenshotCombinations "master" false
- name: notify
image: drillster/drone-email
settings:
@@ -284,27 +269,6 @@ steps:
- failure
branch:
- master
services:
- name: server
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
commands:
- /usr/local/bin/initnc.sh
- su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
- su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
- su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
- su www-data -c "php /var/www/html/occ group:add users"
- su www-data -c "php /var/www/html/occ group:adduser users user1"
- su www-data -c "php /var/www/html/occ group:adduser users user2"
- su www-data -c "git clone -b master https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
- su www-data -c "php /var/www/html/occ app:enable activity"
- su www-data -c "git clone -b master https://github.com/nextcloud/text.git /var/www/html/apps/text/"
- su www-data -c "php /var/www/html/occ app:enable text"
- su www-data -c "git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/"
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
- /usr/local/bin/run.sh
trigger:
branch:
- master
@@ -388,7 +352,7 @@ steps:
- sed -i "/qa/,/\}/ s/versionCode .*/versionCode $DRONE_BUILD_NUMBER/" build.gradle
- sed -i "/qa/,/\}/ s/versionName .*/versionName \"$DRONE_BUILD_NUMBER\"/" build.gradle
- ./gradlew assembleQaDebug
- /opt/android-sdk-linux/build-tools/*/apksigner sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
- $(find /opt/android-sdk-linux/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
- scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
trigger:
+1 -1
View File
@@ -1,2 +1,2 @@
# You can add one username per supported platform and one custom link
custom: https://www.bountysource.com/teams/nextcloud/issues?tracker_ids=38838206
custom: https://nextcloud.com/include/
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build with Gradle
run: |
mkdir -p $HOME/.gradle
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build generic
run: |
mkdir -p $HOME/.gradle
+2
View File
@@ -47,3 +47,5 @@ fastlane/Fastfile
# scan temporary files
**/fastlane/test_output
/fastlane/vendor/
/.bundle/
+8
View File
@@ -1,3 +1,11 @@
## 3.12.1 (July, 07, 2020)
- UI does not hang when changing auto upload
- fix crash on contacts backup settings
- bugfixes
For a full list, please see https://github.com/nextcloud/android/milestone/49
## 3.12.0 (June, 10, 2020)
- add circle support for searching/displaying
+1
View File
@@ -379,6 +379,7 @@ Generally, whenever you need:
* media playback
* networking
* logging
* notifications management
we have something more suitable.
+10
View File
@@ -0,0 +1,10 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
source "https://rubygems.org"
gem 'fastlane'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
+180
View File
@@ -0,0 +1,180 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
aws-eventstream (1.1.0)
aws-partitions (1.343.0)
aws-sdk-core (3.104.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.36.0)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.75.0)
aws-sdk-core (~> 3, >= 3.104.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.3)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.6.1)
rake (~> 13.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.0.0)
excon (0.75.0)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.7)
fastlane (2.152.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (>= 0.17, < 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (>= 0.13.1, < 2.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-huawei_appgallery_connect (1.0.9)
gh_inspector (1.1.3)
google-api-client (0.38.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.3)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.26.2)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.13.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.3.1)
jwt (2.2.1)
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.0)
os (1.1.0)
plist (3.5.0)
public_suffix (4.0.5)
rake (13.0.1)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
rubyzip (2.3.0)
security (0.1.3)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.17.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
DEPENDENCIES
fastlane
fastlane-plugin-huawei_appgallery_connect
BUNDLED WITH
2.1.4
+62 -58
View File
@@ -1,10 +1,11 @@
import com.github.spotbugs.snom.SpotBugsTask
// Gradle build file
//
// This project was started in Eclipse and later moved to Android Studio. In the transition, both IDEs were supported.
// Due to this, the files layout is not the usual in new projects created with Android Studio / gradle. This file
// merges declarations usually split in two separates build.gradle file, one for global settings of the project in
// its root folder, another one for the app module in subfolder of root.
import com.github.spotbugs.SpotBugsTask
buildscript {
ext.kotlin_version = '1.3.72'
@@ -20,13 +21,11 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath('com.hiya:jacoco-android:0.2')
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.11.0"
classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
classpath 'com.karumi:shot:4.3.0'
}
@@ -39,7 +38,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'jacoco-android'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: 'com.github.spotbugs'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'shot'
@@ -51,7 +50,7 @@ configurations {
exclude group: 'com.google.firebase', module: 'firebase-core'
exclude group: 'com.google.firebase', module: 'firebase-analytics'
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitely
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
@@ -60,15 +59,16 @@ configurations {
ext {
jacocoVersion = "0.8.2"
daggerVersion = "2.27"
markwonVersion = "4.4.0"
daggerVersion = "2.28.3"
markwonVersion = "4.5.0"
prismVersion = "2.0.0"
androidLibraryVersion = "interceptor-SNAPSHOT"
butterknifeVersion = "10.2.3"
androidLibraryVersion = "master-SNAPSHOT"
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
// allows for -D pre-dex=false to be set
preDexEnabled = "true" == System.getProperty("pre-dex", "true")
}
repositories {
@@ -99,9 +99,7 @@ for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()
}
}
spotbugs {
toolVersion = '3.1.12'
}
android {
lintOptions {
@@ -126,7 +124,7 @@ android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 17
minSdkVersion 18
targetSdkVersion 29
// arguments to be passed to functional tests
@@ -196,7 +194,7 @@ android {
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
// Skip pre-dexing when running on Travis CI or when disabled via -D pre-dex=false.
preDexLibraries = preDexEnabled && !travisBuild
}
@@ -238,41 +236,33 @@ android {
android.applicationVariants.all { variant ->
String variantName = variant.name
String capVariantName = variantName.substring(0, 1).toUpperCase() + variantName.substring(1)
tasks.register("spotbugs${capVariantName}", SpotBugsTask) {
tasks.register("spotbugs${capVariantName}Report", SpotBugsTask) {
ignoreFailures = true // should continue checking
effort = "max"
reportLevel = "medium"
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
pluginClasspath = project.configurations.spotbugsPlugins
source = fileTree('src/main/java')
classpath = files()
include '**/*.java'
exclude '**/gen/**'
reports {
xml.enabled = false
html.enabled = true
html {
enabled = true
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
}
}
}
}
check.dependsOn 'checkstyle', 'spotbugsGplayDebug', 'pmd', 'lint', 'ktlint', 'detekt'
check.dependsOn 'checkstyle', 'spotbugsGplayDebugReport', 'pmd', 'lint', 'ktlint', 'detekt'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled true
}
viewBinding {
enabled true
buildFeatures {
dataBinding true
viewBinding true
}
}
@@ -298,21 +288,22 @@ dependencies {
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.1' // remove after entire switch to lib v2
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.android.material:material:1.2.0'
implementation 'com.jakewharton:disklrucache:2.0.2'
implementation 'androidx.appcompat:appcompat:1.2.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
implementation "androidx.work:work-runtime:2.3.4"
implementation "androidx.work:work-runtime-ktx:2.3.4"
implementation "androidx.work:work-runtime:2.4.0"
implementation "androidx.work:work-runtime-ktx:2.4.0"
implementation "androidx.fragment:fragment:1.2.5"
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
compileOnly 'com.google.code.findbugs:annotations:2.0.1'
implementation 'commons-io:commons-io:2.7'
implementation 'com.jakewharton:butterknife:10.2.1'
kapt 'com.jakewharton:butterknife-compiler:10.2.1'
implementation "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.6'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.0'
implementation 'org.lukhnos:nnio:0.2'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.65'
implementation 'com.google.code.gson:gson:2.8.6'
@@ -330,7 +321,8 @@ dependencies {
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.5.1'
implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:4.1.0'
implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido2:4.1.0'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.10.1'
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.7'
@@ -341,7 +333,7 @@ dependencies {
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
ktlint "com.pinterest:ktlint:0.36.0"
ktlint "com.pinterest:ktlint:0.37.2"
implementation 'org.conscrypt:conscrypt-android:2.4.0'
// Shimmer animation
@@ -360,16 +352,16 @@ dependencies {
// dependencies for local unit tests
testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:3.3.3'
testImplementation 'org.mockito:mockito-core:3.4.6'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'org.powermock:powermock-core:2.0.7'
testImplementation 'org.powermock:powermock-module-junit4:2.0.7'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.7'
testImplementation 'org.json:json:20200518'
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation "androidx.arch.core:core-testing:2.1.0"
kaptAndroidTest "com.google.dagger:dagger-compiler:$daggerVersion"
kaptTest "com.google.dagger:dagger-compiler:$daggerVersion"
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'io.mockk:mockk:1.10.0'
testImplementation 'io.mockk:mockk-android:1.10.0'
// dependencies for instrumented tests
// JUnit4 Rules
@@ -382,7 +374,20 @@ dependencies {
// Espresso core
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'org.mockito:mockito-core:3.3.1'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
// Mocking support
androidTestImplementation 'com.github.tmurakami:dexopener:2.0.5' // required to allow mocking on API 27 and older
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
androidTestImplementation 'org.mockito:mockito-core:3.4.4'
androidTestImplementation("org.mockito:mockito-android:3.4.6") {
exclude group: "net.bytebuddy", module: "byte-buddy-android"
}
androidTestImplementation 'net.bytebuddy:byte-buddy:1.10.14'
androidTestImplementation "net.bytebuddy:byte-buddy-android:1.10.14"
androidTestImplementation "io.mockk:mockk-android:1.10.0"
androidTestImplementation 'androidx.arch.core:core-testing:2.0.1'
// 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
@@ -400,9 +405,10 @@ dependencies {
// androidJacocoAnt "org.jacoco:org.jacoco.agent:${jacocoVersion}"
implementation "com.github.stateless4j:stateless4j:2.6.0"
androidTestImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
androidTestImplementation "org.mockito:mockito-android:3.3.3"
androidTestImplementation 'net.bytebuddy:byte-buddy:1.10.11'
}
spotbugs {
toolVersion = '3.1.12'
}
configurations.all {
@@ -425,17 +431,15 @@ android.applicationVariants.all { variant ->
tasks.register("combinedTestReport", JacocoReport) {
reports {
xml.enabled = true
html.enabled = true
xml.enabled true
html.enabled true
csv.enabled false
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/gplay/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: project.buildDir, includes: [
'jacoco/testGplayDebugUnitTest.exec', 'outputs/code-coverage/connected/flavors/GPLAY/*coverage.ec'
])
}
+6 -6
View File
@@ -83,14 +83,14 @@ complexity:
ignoreStringsRegex: '$^'
TooManyFunctions:
active: true
thresholdInFiles: 11
thresholdInClasses: 11
thresholdInInterfaces: 11
thresholdInObjects: 11
thresholdInFiles: 15
thresholdInClasses: 15
thresholdInInterfaces: 15
thresholdInObjects: 15
thresholdInEnums: 11
ignoreDeprecated: false
ignoreDeprecated: true
ignorePrivate: false
ignoreOverridden: false
ignoreOverridden: true
empty-blocks:
active: true
+25 -8
View File
@@ -8,6 +8,9 @@ fastlane_version "2.58.0"
# export FASTLANE_NEXTCLOUD_KEY_ALIAS=""
# export FASTLANE_NEXTCLOUD_KEY_PASSWORD=""
# export FASTLANE_NEXTCLOUD_GITHUB_API_TOKEN=""
# export FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_ID=""
# export FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_SECRET=""
# export FASTLANE_NEXTCLOUD_HUAWEI_APP_ID=""
skip_docs
@@ -36,19 +39,14 @@ lane :screenshotsTablet do
end
desc "Release phase 1: make gplay/generic for RC, then test it"
lane :releasePhase1_RC do
lane :RC_releasePhase1 do
disableLogger()
makeReleases()
enableLogger()
end
desc "Release phase 1: make gplay/generic for FINAL, then test it"
lane :releasePhase1_Final do
makeReleases()
end
desc "Release phase 2 for RC: checks, tag, upload gplay to playstore with values from build.gradle"
lane :releasePhase2_RC do |options|
lane :RC_releasePhase2 do |options|
info = androidVersion
checkChangelog(info)
checkLibrary_RC()
@@ -61,8 +59,13 @@ lane :releasePhase2_RC do |options|
createChangelogPullRequest_RC(info)
end
desc "Release phase 1: make gplay/generic for FINAL, then test it"
lane :Final_releasePhase1 do
makeReleases()
end
desc "Release phase 2 for FINAL: checks, tag, upload gplay to playstore with values from build.gradle"
lane :releasePhase2_Final do |options|
lane :Final_releasePhase2 do |options|
info = androidVersion
checkChangelog(info)
checkLibrary_Final()
@@ -70,6 +73,7 @@ lane :releasePhase2_Final do |options|
checkIfAPKexists()
tag(info)
uploadToPlaystore_Final(info)
uploadToHuawei_Final(info)
createGithubRelease_Final(info)
fdroidMergeRequest_Final(info)
createChangelogPullRequest_Final(info)
@@ -116,6 +120,19 @@ lane :beautifyPhone do
sh("adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100")
end
# to install
# bundle exec fastlane add_plugin huawei_appgallery_connect
# bundle install --path build/vendor/bundle
private_lane :uploadToHuawei_Final do |options|
huawei_appgallery_connect(
client_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_ID"],
client_secret: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_SECRET"],
app_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_APP_ID"],
apk_path: "release/nextcloud-" + options["versionCode"] + ".apk",
submit_for_review: true,
)
end
## private lanes
desc "Build debug and test APK for screenshots"
+6
View File
@@ -0,0 +1,6 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-huawei_appgallery_connect'
gem 'fastlane-plugin-huawei_appgallery_connect'
+2 -2
View File
@@ -1,6 +1,6 @@
#Wed Aug 21 07:03:37 CEST 2019
#Fri May 29 07:39:21 CEST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+8
View File
@@ -55,4 +55,12 @@
<issue id="NewApi" severity="error">
<ignore path="build" />
</issue>
<issue id="ObsoleteLintCustomCheck" severity="warning">
<ignore path="**/fragment-1.2.5/**/lint.jar" />
<ignore path="**/work-runtime-2.**/**/lint.jar" />
<ignore path="**/jetified-butterknife-runtime-10.**/**/lint.jar" />
<ignore path="**/jetified-dagger-lint-aar-2.28.**/**/lint.jar" />
<ignore path="**/jetified-annotation-experimental-1.**/**/lint.jar" />
</issue>
</lint>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+1 -1
View File
@@ -1 +1 @@
373
329
+2 -2
View File
@@ -47,7 +47,7 @@ require 'xmlsimple'
# run FindBugs
puts "running FindBugs..."
system './gradlew assembleGplayDebug'
system './gradlew assembleGplayDebug 1>/dev/null'
# confirm that assemble ran w/out error
result = $?.to_i
@@ -56,7 +56,7 @@ if result != 0
exit 1
end
system './gradlew spotbugsGplayDebug'
system './gradlew spotbugsGplayDebugReport 1>/dev/null 2>&1'
# find FindBugs report file
findbugs_reports = Dir.glob(FINDBUGS_REPORT_FILE)
+1 -1
View File
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 95 warnings</span>
<span class="mdl-layout-title">Lint Report: 81 warnings</span>
+1 -1
View File
@@ -56,7 +56,7 @@ end
# run Lint
puts "running Lint..."
system './gradlew clean lint'
system './gradlew clean lint 1>/dev/null'
# confirm that Lint ran w/out error
result = $?.to_i
+69
View File
@@ -0,0 +1,69 @@
#!/bin/bash
if [ $# -lt 2 ]; then
echo "1: record: true/false
2: class name
3: method name
4: darkMode / \"all\" to run all screenshot combinations
5: color"
exit
fi
sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g src/main/res/values/setup.xml
emulator -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 &
cd src/androidTest/java
class=$(find | grep $2 | grep -E "java$|kt$" | head -n1|sed s'/\//\./'g | sed s'#^\.\.##' | sed s'#\.java##'| sed s'#\.kt##')
if [[ -z $class ]]; then
echo "Class not found!"
exit 1
fi
cd ../../../
if [ $1 == "true" ] ; then
record="-Precord"
else
record=""
fi
if [ -e $3 ] ; then
method=""
else
method="#$3"
# check if method exists
if [[ $(grep -c $3 $(find | grep $2 | grep -E "java$|kt$" | head -n1)) -eq 0 ]]; then
echo "Method not found!"
exit 1
fi
fi
if [ -e $4 ] ; then
darkMode=""
else
darkMode="-Pandroid.testInstrumentationRunnerArguments.DARKMODE=$4"
fi
if [ -e $5 ] ; then
color=""
else
color="-Pandroid.testInstrumentationRunnerArguments.COLOR=$5"
fi
if [[ $4 = "all" ]]; then
scripts/runAllScreenshotCombinations "noCI" "$1" "-Pandroid.testInstrumentationRunnerArguments.class=$class$method"
else
./gradlew gplayDebugExecuteScreenshotTests $record \
-Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
-Pandroid.testInstrumentationRunnerArguments.class=$class$method \
$darkMode \
$color
fi
sed -i s'#<bool name="is_beta">true</bool>#<bool name="is_beta">false</bool>#'g src/main/res/values/setup.xml
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
BRANCH=$1
TYPE=$2
PR=$3
GITHUB_USER=$4
GITHUB_PASSWORD=$5
BRANCH_TYPE=$BRANCH-$TYPE
# delete all old comments, matching this type
oldComments=$(curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
echo $oldComments | while read comment ; do
curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
exit 0
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
## $1 noCI/stable/master: wether to run deleteOutdatedComments.sh or uploadReport.sh
## $2 true/false: record or verify screenshots
## $3 classMethod: piped from androidScreenshotTest
if [[ $2 = "true" ]]; then
record="-Precord"
else
record=""
fi
classMethod=$3
while read line
do
darkMode=$(echo "$line" | cut -d" " -f1)
color=$(echo "$line" | cut -d" " -f2)
echo "Run $color on $darkMode mode"
if [[ $1 = "noCI" ]]; then
./gradlew --console plain gplayDebugExecuteScreenshotTests \
$record \
-Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
-Pandroid.testInstrumentationRunnerArguments.COLOR="$color" \
-Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" \
$classMethod </dev/null > /dev/null
if [[ $? -ne 0 ]]; then
exit
fi
else
./gradlew gplayDebugExecuteScreenshotTests \
$record \
-Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
-Pandroid.testInstrumentationRunnerArguments.COLOR="$color" \
-Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" \
&& scripts/deleteOutdatedComments.sh "$1-$darkMode-$color" "Screenshot" "$DRONE_PULL_REQUEST" \
"$GIT_USERNAME" "$GIT_TOKEN" \
|| scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" "$DRONE_BUILD_NUMBER" \
"$1-$darkMode-$color" "Screenshot" "$DRONE_PULL_REQUEST" "$GIT_USERNAME" "$GIT_TOKEN"
fi
done < scripts/screenshotCombinations
+1
View File
@@ -0,0 +1 @@
light blue
+29 -8
View File
@@ -1,6 +1,21 @@
#!/usr/bin/env bash
deleteOldComments() {
# delete all old comments, matching this type
echo "Deleting old comments for $BRANCH_TYPE"
oldComments=$(curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
count=$(echo $oldComments | grep true | wc -l)
echo "Found $count old comments"
echo $oldComments | while read comment ; do
echo "Deleting comment: $comment"
curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
}
upload() {
deleteOldComments
cd $1
find . -type d -exec curl -u $USER:$PASS -X MKCOL $URL/$REMOTE_FOLDER/$(echo {} | sed s#\./##) \;
@@ -9,7 +24,7 @@ upload() {
echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER"
curl -u $GITHUB_USER:$GITHUB_PASSWORD -X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
-d "{ \"body\" : \"$TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER \" }"
-d "{ \"body\" : \"$BRANCH_TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER \" }"
exit 1
}
@@ -17,10 +32,11 @@ upload() {
#1: LOG_USERNAME
#2: LOG_PASSWORD
#3: DRONE_BUILD_NUMBER
#4: TYPE (IT or Unit)
#5: DRONE_PULL_REQUEST
#6: GIT_USERNAME
#7: GIT_TOKEN
#4: BRANCH (stable or master)
#5: TYPE (IT or Unit)
#6: DRONE_PULL_REQUEST
#7: GIT_USERNAME
#8: GIT_TOKEN
URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-integrationTests
ID=$3
@@ -31,7 +47,8 @@ TYPE=$5
PR=$6
GITHUB_USER=$7
GITHUB_PASSWORD=$8
REMOTE_FOLDER=$ID-$TYPE
REMOTE_FOLDER=$ID-$TYPE-$BRANCH
BRANCH_TYPE=$BRANCH-$TYPE
set -e
@@ -46,24 +63,28 @@ fi
if [ -e $FOLDER ]; then
upload $FOLDER
else
echo "$BRANCH-$TYPE test failed, but no output was generated. Maybe a preliminary stage failed."
deleteOldComments
echo "$BRANCH_TYPE test failed, but no output was generated. Maybe a preliminary stage failed."
curl -u $GITHUB_USER:$GITHUB_PASSWORD \
-X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
-d "{ \"body\" : \"$BRANCH-$TYPE test failed, but no output was generated. Maybe a preliminary stage failed. \" }"
-d "{ \"body\" : \"$BRANCH_TYPE test failed, but no output was generated. Maybe a preliminary stage failed. \" }"
if [ -e build/reports/androidTests/connected/flavors/GPLAY ] ; then
TYPE="IT"
BRANCH_TYPE=$BRANCH-$TYPE
upload "build/reports/androidTests/connected/flavors/GPLAY"
fi
if [ -e build/reports/tests/testGplayDebugUnitTest ] ; then
TYPE="Unit"
BRANCH_TYPE=$BRANCH-$TYPE
upload "build/reports/tests/testGplayDebugUnitTest"
fi
if [ -e build/reports/shot/verification ] ; then
TYPE="Screenshot"
BRANCH_TYPE=$BRANCH-$TYPE
upload "build/reports/shot/verification"
fi
fi
+1
View File
@@ -32,6 +32,7 @@
<Or>
<Class name="~.*BindingImpl"/>
<Class name="~.*\.DataBinderMapperImpl" />
<Class name="~.*Binding" />
</Or>
</Match>
-2
View File
@@ -31,6 +31,4 @@
android:sharedUserId="${applicationId}.uid">
<uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator, tools.fastlane.screengrab" />
<application android:name="com.owncloud.android.TestApp"></application>
</manifest>
+17
View File
@@ -0,0 +1,17 @@
BEGIN:VCARD
VERSION:3.0
N:Mustermann;Erika;;Dr.;
FN:Dr. Erika Mustermann
ORG:Wikimedia
ROLE:Kommunikation
TITLE:Redaktion & Gestaltung
PHOTO;VALUE=URL;TYPE=JPEG:http://commons.wikimedia.org/wiki/File:Erika_Mustermann_2010.jpg
TEL;TYPE=WORK,VOICE:+49 221 9999123
TEL;TYPE=HOME,VOICE:+49 221 1234567
ADR;TYPE=HOME:;;Heidestraße 17;Köln;;51147;Germany
EMAIL;TYPE=PREF,INTERNET:[email protected]
URL:http://de.wikipedia.org/
REV:2014-03-01T22:11:10Z
END:VCARD
## from https://de.wikipedia.org/wiki/VCard#vCard_3.0 on 27.07.2020
@@ -25,7 +25,6 @@ package com.nextcloud.client;
import android.Manifest;
import android.view.View;
import com.facebook.testing.screenshot.Screenshot;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.R;
import com.owncloud.android.ui.activities.ActivitiesActivity;
@@ -60,16 +59,13 @@ public class ActivitiesActivityIT extends AbstractIT {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
sut.runOnUiThread(new Runnable() {
@Override
public void run() {
sut.emptyContentContainer.setVisibility(View.VISIBLE);
sut.recyclerView.setVisibility(View.INVISIBLE);
}
sut.runOnUiThread(() -> {
sut.emptyContentContainer.setVisibility(View.VISIBLE);
sut.recyclerView.setVisibility(View.INVISIBLE);
});
waitForIdleSync();
Screenshot.snapActivity(sut).record();
screenshot(sut);
}
}
@@ -24,18 +24,24 @@ package com.nextcloud.client;
import android.accounts.AccountManager;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.AbstractOnServerIT;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.e2ee.ToggleEncryptionRemoteOperation;
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation;
import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.lib.resources.users.GetPrivateKeyOperation;
import com.owncloud.android.lib.resources.users.GetPublicKeyOperation;
import com.owncloud.android.lib.resources.users.SendCSROperation;
import com.owncloud.android.lib.resources.users.StorePrivateKeyOperation;
import com.owncloud.android.operations.DownloadFileOperation;
import com.owncloud.android.operations.GetCapabilitiesOperation;
import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.utils.CsrHelper;
import com.owncloud.android.utils.EncryptionUtils;
@@ -52,19 +58,24 @@ import java.io.IOException;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import static com.owncloud.android.lib.resources.status.OwnCloudVersion.nextcloud_19;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assume.assumeTrue;
public class EndToEndRandomIT extends AbstractIT {
public class EndToEndRandomIT extends AbstractOnServerIT {
public enum Action {
CREATE_FOLDER,
GO_INTO_FOLDER,
GO_UP,
UPLOAD_FILE
UPLOAD_FILE,
DOWNLOAD_FILE,
DELETE_FILE,
}
private static ArbitraryDataProvider arbitraryDataProvider;
@@ -79,7 +90,13 @@ public class EndToEndRandomIT extends AbstractIT {
}
@Before
public void before() {
public void before() throws IOException {
OCCapability capability = getStorageManager().getCapability(account.name);
if (capability.getVersion().equals(new OwnCloudVersion("0.0.0"))) {
// fetch new one
assertTrue(new GetCapabilitiesOperation().execute(client, getStorageManager()).isSuccess());
}
// tests only for NC19+
assumeTrue(getStorageManager()
.getCapability(account.name)
@@ -87,6 +104,8 @@ public class EndToEndRandomIT extends AbstractIT {
.isNewerOrEqual(nextcloud_19)
);
// make sure that every file is available, even after tests that remove source file
createDummyFiles();
}
@Test
@@ -113,6 +132,14 @@ public class EndToEndRandomIT extends AbstractIT {
uploadFile(i);
break;
case DOWNLOAD_FILE:
downloadFile(i);
break;
case DELETE_FILE:
deleteFile(i);
break;
default:
Log_OC.d(this, "[" + i + "/" + actionCount + "]" + " Unknown action: " + nextAction);
break;
@@ -198,6 +225,14 @@ public class EndToEndRandomIT extends AbstractIT {
deleteFile(1);
}
@Test
public void downloadFile() throws Exception {
init();
uploadFile(1);
downloadFile(1);
}
private void init() throws Exception {
// create folder
createFolder(rootEncFolder);
@@ -260,17 +295,149 @@ public class EndToEndRandomIT extends AbstractIT {
private void uploadFile(int i) throws IOException {
String fileName = RandomString.make(5) + ".txt";
createFile(fileName, new Random().nextInt(50000));
String path = currentFolder.getRemotePath() + fileName;
File file;
if (new Random().nextBoolean()) {
file = createFile(fileName, new Random().nextInt(50000));
} else {
file = createFile(fileName, 500000 + new Random().nextInt(50000));
}
String remotePath = currentFolder.getRemotePath() + fileName;
Log_OC.d(this,
"[" + i + "/" + actionCount + "] " +
"Upload file to: " + currentFolder.getDecryptedRemotePath() + fileName);
OCUpload ocUpload = new OCUpload(FileStorageUtils.getSavePath(account.name) + File.separator + fileName,
path,
OCUpload ocUpload = new OCUpload(file.getAbsolutePath(),
remotePath,
account.name);
uploadOCUpload(ocUpload);
shortSleep();
OCFile parentFolder = getStorageManager()
.getFileByEncryptedRemotePath(new File(ocUpload.getRemotePath()).getParent() + "/");
String uploadedFileName = new File(ocUpload.getRemotePath()).getName();
String decryptedPath = parentFolder.getDecryptedRemotePath() + uploadedFileName;
OCFile uploadedFile = getStorageManager().getFileByDecryptedRemotePath(decryptedPath);
verifyStoragePath(uploadedFile);
// verify storage path
refreshFolder(currentFolder.getRemotePath());
uploadedFile = getStorageManager().getFileByDecryptedRemotePath(decryptedPath);
verifyStoragePath(uploadedFile);
// verify that encrypted file is on server
assertTrue(new ReadFileRemoteOperation(currentFolder.getRemotePath() + uploadedFile.getEncryptedFileName())
.execute(client)
.isSuccess());
// verify that unencrypted file is not on server
assertFalse(new ReadFileRemoteOperation(currentFolder.getDecryptedRemotePath() + fileName)
.execute(client)
.isSuccess());
}
private void downloadFile(int i) {
ArrayList<OCFile> files = new ArrayList<>();
for (OCFile file : getStorageManager().getFolderContent(currentFolder, false)) {
if (!file.isFolder()) {
files.add(file);
}
}
if (files.isEmpty()) {
Log_OC.d(this, "[" + i + "/" + actionCount + "] No files in: " + currentFolder.getDecryptedRemotePath());
return;
}
OCFile fileToDownload = files.get(new Random().nextInt(files.size()));
assertNotNull(fileToDownload.getRemoteId());
Log_OC.d(this,
"[" + i + "/" + actionCount + "] " + "Download file: " +
currentFolder.getDecryptedRemotePath() + fileToDownload.getDecryptedFileName());
assertTrue(new DownloadFileOperation(account, fileToDownload, targetContext)
.execute(client)
.isSuccess());
assertTrue(new File(fileToDownload.getStoragePath()).exists());
verifyStoragePath(fileToDownload);
}
@Test
public void testUploadWithCopy() throws Exception {
init();
OCUpload ocUpload = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt",
currentFolder.getRemotePath() + "nonEmpty.txt",
account.name);
uploadOCUpload(ocUpload, FileUploader.LOCAL_BEHAVIOUR_COPY);
File originalFile = new File(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt");
OCFile uploadedFile = fileDataStorageManager.getFileByDecryptedRemotePath(currentFolder.getRemotePath() +
"nonEmpty.txt");
assertTrue(originalFile.exists());
assertTrue(new File(uploadedFile.getStoragePath()).exists());
}
@Test
public void testUploadWithMove() throws Exception {
init();
OCUpload ocUpload = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt",
currentFolder.getRemotePath() + "nonEmpty.txt",
account.name);
uploadOCUpload(ocUpload, FileUploader.LOCAL_BEHAVIOUR_MOVE);
File originalFile = new File(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt");
OCFile uploadedFile = fileDataStorageManager.getFileByDecryptedRemotePath(currentFolder.getRemotePath() +
"nonEmpty.txt");
assertFalse(originalFile.exists());
assertTrue(new File(uploadedFile.getStoragePath()).exists());
}
@Test
public void testUploadWithForget() throws Exception {
init();
OCUpload ocUpload = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt",
currentFolder.getRemotePath() + "nonEmpty.txt",
account.name);
uploadOCUpload(ocUpload, FileUploader.LOCAL_BEHAVIOUR_FORGET);
File originalFile = new File(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt");
OCFile uploadedFile = fileDataStorageManager.getFileByDecryptedRemotePath(currentFolder.getRemotePath() +
"nonEmpty.txt");
assertTrue(originalFile.exists());
assertFalse(new File(uploadedFile.getStoragePath()).exists());
}
@Test
public void testUploadWithDelete() throws Exception {
init();
OCUpload ocUpload = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt",
currentFolder.getRemotePath() + "nonEmpty.txt",
account.name);
uploadOCUpload(ocUpload, FileUploader.LOCAL_BEHAVIOUR_DELETE);
File originalFile = new File(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt");
OCFile uploadedFile = fileDataStorageManager.getFileByDecryptedRemotePath(currentFolder.getRemotePath() +
"nonEmpty.txt");
assertFalse(originalFile.exists());
assertFalse(new File(uploadedFile.getStoragePath()).exists());
}
private void deleteFile(int i) {
@@ -281,7 +448,13 @@ public class EndToEndRandomIT extends AbstractIT {
}
}
if (files.isEmpty()) {
Log_OC.d(this, "[" + i + "/" + actionCount + "] No files in: " + currentFolder.getDecryptedRemotePath());
return;
}
OCFile fileToDelete = files.get(new Random().nextInt(files.size()));
assertNotNull(fileToDelete.getRemoteId());
Log_OC.d(this,
"[" + i + "/" + actionCount + "] " +
@@ -395,4 +568,65 @@ public class EndToEndRandomIT extends AbstractIT {
private String generateMnemonicString() {
return "1 2 3 4 5 6";
}
public void after() {
// remove all encrypted files
OCFile root = fileDataStorageManager.getFileByDecryptedRemotePath("/");
removeFolder(root);
// List<OCFile> files = fileDataStorageManager.getFolderContent(root, false);
//
// for (OCFile child : files) {
// removeFolder(child);
// }
assertEquals(0, fileDataStorageManager.getFolderContent(root, false).size());
super.after();
}
private void removeFolder(OCFile folder) {
Log_OC.d(this, "Start removing content of folder: " + folder.getDecryptedRemotePath());
List<OCFile> children = fileDataStorageManager.getFolderContent(folder, false);
// remove children
for (OCFile child : children) {
if (child.isFolder()) {
removeFolder(child);
// remove folder
Log_OC.d(this, "Remove folder: " + child.getDecryptedRemotePath());
if (!folder.isEncrypted() && child.isEncrypted()) {
assertTrue(new ToggleEncryptionRemoteOperation(child.getLocalId(),
child.getRemotePath(),
false)
.execute(client)
.isSuccess());
OCFile f = getStorageManager().getFileByEncryptedRemotePath(child.getRemotePath());
f.setEncrypted(false);
getStorageManager().saveFile(f);
child.setEncrypted(false);
}
} else {
Log_OC.d(this, "Remove file: " + child.getDecryptedRemotePath());
}
assertTrue(new RemoveFileOperation(child, false, account, false, targetContext)
.execute(client, getStorageManager())
.isSuccess()
);
}
Log_OC.d(this, "Finished removing content of folder: " + folder.getDecryptedRemotePath());
}
private void verifyStoragePath(OCFile file) {
assertEquals(FileStorageUtils.getSavePath(account.name) +
currentFolder.getDecryptedRemotePath() +
file.getDecryptedFileName(),
file.getStoragePath());
}
}
@@ -25,8 +25,7 @@ package com.nextcloud.client;
import android.Manifest;
import android.app.Activity;
import com.facebook.testing.screenshot.Screenshot;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.AbstractOnServerIT;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation;
@@ -38,7 +37,6 @@ import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.events.SearchEvent;
import com.owncloud.android.utils.ScreenshotTest;
import org.greenrobot.eventbus.EventBus;
import org.junit.Assert;
@@ -56,7 +54,7 @@ import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentat
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertTrue;
public class FileDisplayActivityIT extends AbstractIT {
public class FileDisplayActivityIT extends AbstractOnServerIT {
@Rule public IntentsTestRule<FileDisplayActivity> activityRule = new IntentsTestRule<>(FileDisplayActivity.class,
true,
false);
@@ -66,31 +64,7 @@ public class FileDisplayActivityIT extends AbstractIT {
Manifest.permission.WRITE_EXTERNAL_STORAGE);
@Test
@ScreenshotTest
public void open() {
Activity sut = activityRule.launchActivity(null);
shortSleep();
Screenshot.snapActivity(sut).record();
}
@Test
@ScreenshotTest
public void drawer() {
FileDisplayActivity sut = activityRule.launchActivity(null);
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
waitForIdleSync();
shortSleep();
sut.getListOfFilesFragment().setFabEnabled(false);
Screenshot.snapActivity(sut).record();
}
@Test
@ScreenshotTest
// @ScreenshotTest // todo run without real server
public void showShares() {
assertTrue(new ExistenceCheckRemoteOperation("/shareToAdmin/", true).execute(client).isSuccess());
assertTrue(new CreateFolderRemoteOperation("/shareToAdmin/", true).execute(client).isSuccess());
@@ -151,7 +125,7 @@ public class FileDisplayActivityIT extends AbstractIT {
shortSleep();
shortSleep();
Screenshot.snapActivity(sut).record();
screenshot(sut);
}
@Test
@@ -159,7 +133,7 @@ public class FileDisplayActivityIT extends AbstractIT {
FileDisplayActivity sut = activityRule.launchActivity(null);
// given test folder
assertTrue(new CreateFolderOperation("/test/", account, targetContext)
assertTrue(new CreateFolderOperation("/test/", user, targetContext)
.execute(client, getStorageManager())
.isSuccess());
@@ -3,8 +3,8 @@
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2020 Tobias Kaminsky
* Copyright (C) 2020 Nextcloud GmbH
* Copyright (C) 2019 Tobias Kaminsky
* Copyright (C) 2019 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -25,20 +25,24 @@ package com.nextcloud.client;
import android.Manifest;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.ui.activity.NotificationsActivity;
import com.owncloud.android.R;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.utils.ScreenshotTest;
import org.junit.Rule;
import org.junit.Test;
import androidx.test.espresso.contrib.DrawerActions;
import androidx.test.espresso.intent.rule.IntentsTestRule;
import androidx.test.rule.GrantPermissionRule;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
public class NotificationsActivityIT extends AbstractIT {
@Rule public IntentsTestRule<NotificationsActivity> activityRule = new IntentsTestRule<>(NotificationsActivity.class,
true,
false);
public class FileDisplayActivityScreenshotIT extends AbstractIT {
@Rule public IntentsTestRule<FileDisplayActivity> activityRule = new IntentsTestRule<>(FileDisplayActivity.class,
true,
false);
@Rule
public final GrantPermissionRule permissionRule = GrantPermissionRule.grant(
@@ -46,7 +50,25 @@ public class NotificationsActivityIT extends AbstractIT {
@Test
@ScreenshotTest
public void openDrawer() {
super.openDrawer(activityRule);
public void open() {
FileDisplayActivity sut = activityRule.launchActivity(null);
sut.getListOfFilesFragment().setFabEnabled(false);
sut.getListOfFilesFragment().setEmptyListLoadingMessage();
screenshot(sut);
}
@Test
@ScreenshotTest
public void drawer() {
FileDisplayActivity sut = activityRule.launchActivity(null);
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
sut.getListOfFilesFragment().setFabEnabled(false);
sut.getListOfFilesFragment().setEmptyListLoadingMessage();
screenshot(sut);
}
}
@@ -25,7 +25,6 @@ package com.nextcloud.client;
import android.Manifest;
import android.app.Activity;
import com.facebook.testing.screenshot.Screenshot;
import com.nextcloud.client.onboarding.FirstRunActivity;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.utils.ScreenshotTest;
@@ -51,7 +50,7 @@ public class FirstRunActivityIT extends AbstractIT {
public void open() {
Activity sut = activityRule.launchActivity(null);
Screenshot.snapActivity(sut).record();
screenshot(sut);
}
}
@@ -30,7 +30,7 @@ import org.junit.runners.model.Statement
/**
* C&p from https://stackoverflow.com/questions/45635833/how-can-i-use-flakytest-annotation-now on 18.03.2020
*/
class RetryTestRule(val retryCount: Int = 5) : TestRule {
class RetryTestRule(val retryCount: Int = 1) : TestRule {
companion object {
private val TAG = RetryTestRule::class.java.simpleName
@@ -24,18 +24,29 @@ package com.nextcloud.client;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import com.facebook.testing.screenshot.ScreenshotRunner;
import com.owncloud.android.TestApp;
import com.github.tmurakami.dexopener.DexOpener;
import androidx.test.runner.AndroidJUnitRunner;
public class ScreenshotTestRunner extends AndroidJUnitRunner {
@Override
public Application newApplication(ClassLoader cl, String className, Context context) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
return super.newApplication(cl, TestApp.class.getName(), context);
public Application newApplication(ClassLoader cl, String className, Context context)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
/*
* 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 super.newApplication(cl, className, context);
}
@Override
@@ -25,7 +25,6 @@ package com.nextcloud.client;
import android.Manifest;
import android.app.Activity;
import com.facebook.testing.screenshot.Screenshot;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.ui.activity.SettingsActivity;
import com.owncloud.android.utils.ScreenshotTest;
@@ -49,8 +48,8 @@ public class SettingsActivityIT extends AbstractIT {
@Test
@ScreenshotTest
public void open() {
Activity test = activityRule.launchActivity(null);
Activity sut = activityRule.launchActivity(null);
Screenshot.snapActivity(test).record();
screenshot(sut);
}
}
@@ -23,17 +23,25 @@
package com.nextcloud.client;
import android.Manifest;
import android.content.Intent;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.datamodel.MediaFolderType;
import com.owncloud.android.datamodel.SyncedFolderDisplayItem;
import com.owncloud.android.ui.activity.SyncedFoldersActivity;
import com.owncloud.android.ui.dialog.SyncedFolderPreferencesDialogFragment;
import com.owncloud.android.utils.ScreenshotTest;
import org.junit.Rule;
import org.junit.Test;
import java.util.Objects;
import androidx.test.espresso.intent.rule.IntentsTestRule;
import androidx.test.rule.GrantPermissionRule;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class SyncedFoldersActivityIT extends AbstractIT {
@Rule public IntentsTestRule<SyncedFoldersActivity> activityRule = new IntentsTestRule<>(SyncedFoldersActivity.class,
@@ -49,4 +57,35 @@ public class SyncedFoldersActivityIT extends AbstractIT {
public void openDrawer() {
super.openDrawer(activityRule);
}
@Test
@ScreenshotTest
public void testSyncedFolderDialog() {
SyncedFolderDisplayItem item = new SyncedFolderDisplayItem(1,
"/sdcard/DCIM/",
"/InstantUpload/",
true,
false,
false,
true,
"test@https://server.com",
0,
0,
true,
1000,
"Name",
MediaFolderType.IMAGE,
false);
SyncedFolderPreferencesDialogFragment sut = SyncedFolderPreferencesDialogFragment.newInstance(item, 0);
Intent intent = new Intent(targetContext, SyncedFoldersActivity.class);
SyncedFoldersActivity activity = activityRule.launchActivity(intent);
sut.show(activity.getSupportFragmentManager(), "");
getInstrumentation().waitForIdleSync();
shortSleep();
screenshot(Objects.requireNonNull(sut.requireDialog().getWindow()).getDecorView());
}
}
@@ -0,0 +1,71 @@
/*
* Nextcloud Android client application
*
* @author Chris Narkiewicz <[email protected]>
* Copyright (C) 2020 Chris Narkiewicz
* Copyright (C) 2020 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.account
import android.os.Parcel
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotSame
import org.junit.Assert.assertTrue
import org.junit.Test
class MockUserTest {
private companion object {
const val ACCOUNT_NAME = "test_account_name"
const val ACCOUNT_TYPE = "test_account_type"
}
@Test
fun mock_user_is_parcelable() {
// GIVEN
// mock user instance
val original = MockUser(ACCOUNT_NAME, ACCOUNT_TYPE)
// WHEN
// instance is serialized into Parcel
// instance is retrieved from Parcel
val parcel = Parcel.obtain()
parcel.setDataPosition(0)
parcel.writeParcelable(original, 0)
parcel.setDataPosition(0)
val retrieved = parcel.readParcelable<User>(User::class.java.classLoader)
// THEN
// retrieved instance in distinct
// instances are equal
assertNotSame(original, retrieved)
assertTrue(retrieved is MockUser)
assertEquals(original, retrieved)
}
@Test
fun mock_user_has_platform_account() {
// GIVEN
// mock user instance
val mock = MockUser(ACCOUNT_NAME, ACCOUNT_TYPE)
// THEN
// can convert to platform account
val account = mock.toPlatformAccount()
assertEquals(ACCOUNT_NAME, account.name)
assertEquals(ACCOUNT_TYPE, account.type)
}
}
@@ -34,7 +34,7 @@ import android.accounts.OperationCanceledException;
import android.net.Uri;
import android.os.Bundle;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.AbstractOnServerIT;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientManager;
@@ -48,7 +48,7 @@ import androidx.test.platform.app.InstrumentationRegistry;
import static org.junit.Assert.assertEquals;
public class OwnCloudClientManagerTest extends AbstractIT {
public class OwnCloudClientManagerTest extends AbstractOnServerIT {
/**
* Like on files app we create & store an account in Android's account manager.
@@ -6,7 +6,7 @@ import android.os.Bundle;
import com.nextcloud.client.preferences.AppPreferences;
import com.nextcloud.client.preferences.AppPreferencesImpl;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.AbstractOnServerIT;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import org.junit.Before;
@@ -17,7 +17,7 @@ import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertFalse;
public class UserAccountManagerImplTest extends AbstractIT {
public class UserAccountManagerImplTest extends AbstractOnServerIT {
private AccountManager accountManager;
@@ -41,9 +41,11 @@ class EtmActivityTest : AbstractIT() {
@Before
fun before() {
// tests only on NC 18
Assume.assumeTrue(storageManager
.getCapability(account.name)
.version.compareTo(OwnCloudVersion.nextcloud_18) == 0)
Assume.assumeTrue(
storageManager
.getCapability(account.name)
.version.compareTo(OwnCloudVersion.nextcloud_18) == 0
)
}
@Test
@@ -0,0 +1,235 @@
/**
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* Copyright (C) 2020 Chris Narkiewicz <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.files
import android.net.Uri
import com.nextcloud.client.account.Server
import com.nextcloud.client.account.User
import com.nextcloud.client.account.UserAccountManager
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.whenever
import com.owncloud.android.lib.resources.status.OwnCloudVersion
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertSame
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.junit.runners.Suite
import org.mockito.Mock
import org.mockito.MockitoAnnotations
import java.net.URI
@RunWith(Suite::class)
@Suite.SuiteClasses(
DeepLinkHandlerTest.DeepLinkPattern::class,
DeepLinkHandlerTest.FileDeepLink::class
)
class DeepLinkHandlerTest {
@RunWith(Parameterized::class)
class DeepLinkPattern {
companion object {
val FILE_ID = 1234
val SERVER_BASE_URLS = listOf(
"http://hostname.net",
"https://hostname.net",
"http://hostname.net/subdir1",
"https://hostname.net/subdir1",
"http://hostname.net/subdir1/subdir2",
"https://hostname.net/subdir1/subdir2",
"http://hostname.net/subdir1/subdir2/subdir3",
"https://hostname.net/subdir1/subdir2/subdir3"
)
val INDEX_PHP_PATH = listOf(
"",
"/index.php"
)
@Parameterized.Parameters
@JvmStatic
fun urls(): Array<Array<Any>> {
val testInput = mutableListOf<Array<Any>>()
SERVER_BASE_URLS.forEach { baseUrl ->
INDEX_PHP_PATH.forEach { indexPath ->
val url = "$baseUrl$indexPath/f/$FILE_ID"
testInput.add(arrayOf(baseUrl, indexPath, "$FILE_ID", url))
}
}
return testInput.toTypedArray()
}
}
@Parameterized.Parameter(0)
lateinit var baseUrl: String
@Parameterized.Parameter(1)
lateinit var indexPath: String
@Parameterized.Parameter(2)
lateinit var fileId: String
@Parameterized.Parameter(3)
lateinit var url: String
@Test
fun matches_deep_link_patterns() {
val match = DeepLinkHandler.DEEP_LINK_PATTERN.matchEntire(url)
assertNotNull("Url [$url] does not match pattern", match)
assertEquals(baseUrl, match?.groupValues?.get(DeepLinkHandler.BASE_URL_GROUP_INDEX))
assertEquals(indexPath, match?.groupValues?.get(DeepLinkHandler.INDEX_PATH_GROUP_INDEX))
assertEquals(fileId, match?.groupValues?.get(DeepLinkHandler.FILE_ID_GROUP_INDEX))
}
@Test
fun no_trailing_path_allowed_after_file_id() {
val invalidUrl = "$url/"
val match = DeepLinkHandler.DEEP_LINK_PATTERN.matchEntire(invalidUrl)
assertNull(match)
}
}
class FileDeepLink {
companion object {
const val OTHER_SERVER_BASE_URL = "https://someotherserver.net"
const val SERVER_BASE_URL = "https://server.net"
const val FILE_ID = "1234567890"
val DEEP_LINK = Uri.parse("$SERVER_BASE_URL/index.php/f/$FILE_ID")
fun createMockUser(serverBaseUrl: String): User {
val user = mock<User>()
val uri = URI.create(serverBaseUrl)
val server = Server(uri = uri, version = OwnCloudVersion.nextcloud_19)
whenever(user.server).thenReturn(server)
return user
}
}
@Mock
lateinit var userAccountManager: UserAccountManager
lateinit var allUsers: List<User>
lateinit var handler: DeepLinkHandler
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
whenever(userAccountManager.allUsers).thenAnswer { allUsers }
allUsers = emptyList()
handler = DeepLinkHandler(userAccountManager)
}
@Test
fun no_user_can_open_file() {
// GIVEN
// no user capable of opening the file
allUsers = listOf(
createMockUser(OTHER_SERVER_BASE_URL),
createMockUser(OTHER_SERVER_BASE_URL)
)
// WHEN
// deep link is parsed
val match = handler.parseDeepLink(DEEP_LINK)
// THEN
// link is valid
// no user can open the file
assertNotNull(match)
assertEquals(0, match?.users?.size)
}
@Test
fun single_user_can_open_file() {
// GIVEN
// multiple users registered
// one user capable of opening the link
val matchingUser = createMockUser(SERVER_BASE_URL)
allUsers = listOf(
createMockUser(OTHER_SERVER_BASE_URL),
matchingUser,
createMockUser(OTHER_SERVER_BASE_URL)
)
// WHEN
// deep link is parsed
val match = handler.parseDeepLink(DEEP_LINK)
// THEN
// link can be opened by single user
assertNotNull(match)
assertSame(matchingUser, match?.users?.get(0))
}
@Test
fun multiple_users_can_open_file() {
// GIVEN
// mutltiple users registered
// multiple users capable of opening the link
val matchingUsers = setOf(
createMockUser(SERVER_BASE_URL),
createMockUser(SERVER_BASE_URL)
)
val otherUsers = setOf(
createMockUser(OTHER_SERVER_BASE_URL),
createMockUser(OTHER_SERVER_BASE_URL)
)
allUsers = listOf(matchingUsers, otherUsers).flatten()
// WHEN
// deep link is parsed
val match = handler.parseDeepLink(DEEP_LINK)
// THEN
// link can be opened by multiple matching users
assertNotNull(match)
assertEquals(matchingUsers, match?.users?.toSet())
}
@Test
fun match_contains_extracted_file_id() {
// WHEN
// valid deep file link is parsed
val match = handler.parseDeepLink(DEEP_LINK)
// THEN
// file id is returned
assertEquals(FILE_ID, match?.fileId)
}
@Test
fun no_match_for_invalid_link() {
// GIVEN
// invalid deep link
val invalidLink = Uri.parse("http://www.dodgylink.com/index.php")
// WHEN
// deep link is parsed
val match = handler.parseDeepLink(invalidLink)
// THEN
// no match
assertNull(match)
}
}
}
@@ -0,0 +1,58 @@
/**
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* Copyright (C) 2020 Chris Narkiewicz <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.files.downloader
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import androidx.test.rule.ServiceTestRule
import com.nextcloud.client.account.MockUser
import io.mockk.MockKAnnotations
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
class DownloaderServiceTest {
@get:Rule
val service = ServiceTestRule.withTimeout(3, TimeUnit.SECONDS)
val user = MockUser()
@Before
fun setUp() {
MockKAnnotations.init(this, relaxed = true)
}
@Test(expected = TimeoutException::class)
fun cannot_bind_to_service_without_user() {
val intent = DownloaderService.createBindIntent(getApplicationContext(), user)
intent.removeExtra(DownloaderService.EXTRA_USER)
service.bindService(intent)
}
@Test
fun bind_with_user() {
val intent = DownloaderService.createBindIntent(getApplicationContext(), user)
val binder = service.bindService(intent)
assertTrue(binder is DownloaderService.Binder)
}
}
@@ -0,0 +1,519 @@
/*
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* Copyright (C) 2020 Chris Narkiewicz <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.files.downloader
import com.nextcloud.client.account.User
import com.owncloud.android.datamodel.OCFile
import io.mockk.CapturingSlot
import io.mockk.MockKAnnotations
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.impl.annotations.MockK
import io.mockk.verify
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertSame
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Suite
import java.util.UUID
@RunWith(Suite::class)
@Suite.SuiteClasses(
RegistryTest.Pending::class,
RegistryTest.Start::class,
RegistryTest.Progress::class,
RegistryTest.Complete::class,
RegistryTest.GetTransfers::class,
RegistryTest.IsRunning::class
)
class RegistryTest {
abstract class Base {
companion object {
const val MAX_TRANSFER_THREADS = 4
const val PROGRESS_FULL = 100
const val PROGRESS_HALF = 50
}
@MockK
lateinit var user: User
lateinit var file: OCFile
@MockK
lateinit var onTransferStart: (UUID, Request) -> Unit
@MockK
lateinit var onTransferChanged: (Transfer) -> Unit
internal lateinit var registry: Registry
@Before
fun setUpBase() {
MockKAnnotations.init(this, relaxed = true)
file = OCFile("/test/path")
registry = Registry(onTransferStart, onTransferChanged, MAX_TRANSFER_THREADS)
resetMocks()
}
fun resetMocks() {
clearAllMocks()
every { onTransferStart(any(), any()) } answers {}
every { onTransferChanged(any()) } answers {}
}
}
class Pending : Base() {
@Test
fun inserting_pending_transfer() {
// GIVEN
// registry has no pending transfers
assertEquals(0, registry.pending.size)
// WHEN
// new transfer requests added
val addedTransfersCount = 10
for (i in 0 until addedTransfersCount) {
val request = Request(user, file)
registry.add(request)
}
// THEN
// transfer is added to the pending queue
assertEquals(addedTransfersCount, registry.pending.size)
}
}
class Start : Base() {
companion object {
const val ENQUEUED_REQUESTS_COUNT = 10
}
@Before
fun setUp() {
for (i in 0 until ENQUEUED_REQUESTS_COUNT) {
registry.add(Request(user, file))
}
assertEquals(ENQUEUED_REQUESTS_COUNT, registry.pending.size)
}
@Test
fun starting_transfer() {
// WHEN
// started
registry.startNext()
// THEN
// up to max threads requests are started
// start callback is triggered
// update callback is triggered on transfer transition
// started transfers are in running state
assertEquals(
"Transfers not moved to running queue",
MAX_TRANSFER_THREADS,
registry.running.size
)
assertEquals(
"Transfers not moved from pending queue",
ENQUEUED_REQUESTS_COUNT - MAX_TRANSFER_THREADS,
registry.pending.size
)
verify(exactly = MAX_TRANSFER_THREADS) { onTransferStart(any(), any()) }
val startedTransfers = mutableListOf<Transfer>()
verify(exactly = MAX_TRANSFER_THREADS) { onTransferChanged(capture(startedTransfers)) }
assertEquals(
"Callbacks not invoked for running transfers",
MAX_TRANSFER_THREADS,
startedTransfers.size
)
startedTransfers.forEach {
assertEquals("Transfer not placed into running state", TransferState.RUNNING, it.state)
}
}
@Test
fun start_is_ignored_if_no_more_free_threads() {
// WHEN
// max number of running transfers
registry.startNext()
assertEquals(MAX_TRANSFER_THREADS, registry.running.size)
clearAllMocks()
// WHEN
// starting more transfers
registry.startNext()
// THEN
// no more transfers can be started
assertEquals(MAX_TRANSFER_THREADS, registry.running.size)
verify(exactly = 0) { onTransferStart(any(), any()) }
}
}
class Progress : Base() {
var uuid: UUID = UUID.randomUUID()
@Before
fun setUp() {
val request = Request(user, file)
uuid = registry.add(request)
registry.startNext()
assertEquals(uuid, request.uuid)
assertEquals(1, registry.running.size)
resetMocks()
}
@Test
fun transfer_progress_is_updated() {
// GIVEN
// a transfer is running
// WHEN
// transfer progress is updated
val progressHalf = 50
registry.progress(uuid, progressHalf)
// THEN
// progress is updated
// update callback is invoked
val transfer = mutableListOf<Transfer>()
verify { onTransferChanged(capture(transfer)) }
assertEquals(1, transfer.size)
assertEquals(progressHalf, transfer.first().progress)
}
@Test
fun updates_for_non_running_transfers_are_ignored() {
// GIVEN
// transfer is not running
registry.complete(uuid, true)
assertEquals(0, registry.running.size)
resetMocks()
// WHEN
// progress for a non-running transfer is updated
registry.progress(uuid, PROGRESS_HALF)
// THEN
// progress update is ignored
verify(exactly = 0) { onTransferChanged(any()) }
}
@Test
fun updates_for_non_existing_transfers_are_ignored() {
// GIVEN
// some transfer is running
// WHEN
// progress is updated for non-existing transfer
val nonExistingTransferId = UUID.randomUUID()
registry.progress(nonExistingTransferId, PROGRESS_HALF)
// THEN
// progress uppdate is ignored
verify(exactly = 0) { onTransferChanged(any()) }
}
}
class Complete : Base() {
lateinit var uuid: UUID
@Before
fun setUp() {
uuid = registry.add(Request(user, file))
registry.startNext()
registry.progress(uuid, PROGRESS_FULL)
resetMocks()
}
@Test
fun complete_successful_transfer_with_updated_file() {
// GIVEN
// a transfer is running
// WHEN
// transfer is completed
// file has been updated
val updatedFile = OCFile("/updated/file")
registry.complete(uuid, true, updatedFile)
// THEN
// transfer is completed successfully
// status carries updated file
val slot = CapturingSlot<Transfer>()
verify { onTransferChanged(capture(slot)) }
assertEquals(TransferState.COMPLETED, slot.captured.state)
assertSame(slot.captured.file, updatedFile)
}
@Test
fun complete_successful_transfer() {
// GIVEN
// a transfer is running
// WHEN
// transfer is completed
// file is not updated
registry.complete(uuid = uuid, success = true, file = null)
// THEN
// transfer is completed successfully
// status carries previous file
val slot = CapturingSlot<Transfer>()
verify { onTransferChanged(capture(slot)) }
assertEquals(TransferState.COMPLETED, slot.captured.state)
assertSame(slot.captured.file, file)
}
@Test
fun complete_failed_transfer() {
// GIVEN
// a transfer is running
// WHEN
// transfer is failed
registry.complete(uuid, false)
// THEN
// transfer is completed successfully
val slot = CapturingSlot<Transfer>()
verify { onTransferChanged(capture(slot)) }
assertEquals(TransferState.FAILED, slot.captured.state)
}
}
class GetTransfers : Base() {
val pendingTransferFile = OCFile("/pending")
val runningTransferFile = OCFile("/running")
val completedTransferFile = OCFile("/completed")
lateinit var pendingTransferId: UUID
lateinit var runningTransferId: UUID
lateinit var completedTransferId: UUID
@Before
fun setUp() {
completedTransferId = registry.add(Request(user, completedTransferFile))
registry.startNext()
registry.complete(completedTransferId, true)
runningTransferId = registry.add(Request(user, runningTransferFile))
registry.startNext()
pendingTransferId = registry.add(Request(user, pendingTransferFile))
resetMocks()
assertEquals(1, registry.pending.size)
assertEquals(1, registry.running.size)
assertEquals(1, registry.completed.size)
}
@Test
fun get_by_path_searches_pending_queue() {
// GIVEN
// file transfer is pending
// WHEN
// transfer status is retrieved
val transfer = registry.getTransfer(pendingTransferFile)
// THEN
// transfer from pending queue is returned
assertNotNull(transfer)
assertEquals(pendingTransferId, transfer?.uuid)
}
@Test
fun get_by_id_searches_pending_queue() {
// GIVEN
// file transfer is pending
// WHEN
// transfer status is retrieved
val transfer = registry.getTransfer(pendingTransferId)
// THEN
// transfer from pending queue is returned
assertNotNull(transfer)
assertEquals(pendingTransferId, transfer?.uuid)
}
@Test
fun get_by_path_searches_running_queue() {
// GIVEN
// file transfer is running
// WHEN
// transfer status is retrieved
val transfer = registry.getTransfer(runningTransferFile)
// THEN
// transfer from pending queue is returned
assertNotNull(transfer)
assertEquals(runningTransferId, transfer?.uuid)
}
@Test
fun get_by_id_searches_running_queue() {
// GIVEN
// file transfer is running
// WHEN
// transfer status is retrieved
val transfer = registry.getTransfer(runningTransferId)
// THEN
// transfer from pending queue is returned
assertNotNull(transfer)
assertEquals(runningTransferId, transfer?.uuid)
}
@Test
fun get_by_path_searches_completed_queue() {
// GIVEN
// file transfer is pending
// WHEN
// transfer status is retrieved
val transfer = registry.getTransfer(completedTransferFile)
// THEN
// transfer from pending queue is returned
assertNotNull(transfer)
assertEquals(completedTransferId, transfer?.uuid)
}
@Test
fun get_by_id_searches_completed_queue() {
// GIVEN
// file transfer is pending
// WHEN
// transfer status is retrieved
val transfer = registry.getTransfer(completedTransferId)
// THEN
// transfer from pending queue is returned
assertNotNull(transfer)
assertEquals(completedTransferId, transfer?.uuid)
}
@Test
fun not_found_by_path() {
// GIVEN
// no transfer for a file
val nonExistingTransferFile = OCFile("/non-nexisting/transfer")
// WHEN
// transfer status is retrieved for a file
val transfer = registry.getTransfer(nonExistingTransferFile)
// THEN
// no transfer is found
assertNull(transfer)
}
@Test
fun not_found_by_id() {
// GIVEN
// no transfer for an id
val nonExistingId = UUID.randomUUID()
// WHEN
// transfer status is retrieved for a file
val transfer = registry.getTransfer(nonExistingId)
// THEN
// no transfer is found
assertNull(transfer)
}
}
class IsRunning : Base() {
@Test
fun no_requests() {
// WHEN
// all queues empty
assertEquals(0, registry.pending.size)
assertEquals(0, registry.running.size)
assertEquals(0, registry.completed.size)
// THEN
// not running
assertFalse(registry.isRunning)
}
@Test
fun request_pending() {
// WHEN
// request is enqueued
registry.add(Request(user, OCFile("/path/alpha/1")))
assertEquals(1, registry.pending.size)
assertEquals(0, registry.running.size)
assertEquals(0, registry.completed.size)
// THEN
// is running
assertTrue(registry.isRunning)
}
@Test
fun request_running() {
// WHEN
// request is running
registry.add(Request(user, OCFile("/path/alpha/1")))
registry.startNext()
assertEquals(0, registry.pending.size)
assertEquals(1, registry.running.size)
assertEquals(0, registry.completed.size)
// THEN
// is running
assertTrue(registry.isRunning)
}
@Test
fun request_completed() {
// WHEN
// request is running
val id = registry.add(Request(user, OCFile("/path/alpha/1")))
registry.startNext()
registry.complete(id, true)
assertEquals(0, registry.pending.size)
assertEquals(0, registry.running.size)
assertEquals(1, registry.completed.size)
// THEN
// is not running
assertFalse(registry.isRunning)
}
}
}
@@ -0,0 +1,240 @@
/**
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* Copyright (C) 2020 Chris Narkiewicz <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.files.downloader
import android.content.ComponentName
import android.content.Context
import com.nextcloud.client.account.MockUser
import com.owncloud.android.datamodel.OCFile
import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
import io.mockk.verify
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
class TransferManagerConnectionTest {
lateinit var connection: TransferManagerConnection
@MockK
lateinit var context: Context
@MockK
lateinit var firstDownloadListener: (Transfer) -> Unit
@MockK
lateinit var secondDownloadListener: (Transfer) -> Unit
@MockK
lateinit var firstStatusListener: (TransferManager.Status) -> Unit
@MockK
lateinit var secondStatusListener: (TransferManager.Status) -> Unit
@MockK
lateinit var binder: DownloaderService.Binder
val file get() = OCFile("/path")
val componentName = ComponentName("", DownloaderService::class.java.simpleName)
val user = MockUser()
@Before
fun setUp() {
MockKAnnotations.init(this, relaxed = true)
connection = TransferManagerConnection(context, user)
}
@Test
fun listeners_are_set_after_connection() {
// GIVEN
// not connected
// listener is added
connection.registerTransferListener(firstDownloadListener)
connection.registerTransferListener(secondDownloadListener)
// WHEN
// service is bound
connection.onServiceConnected(componentName, binder)
// THEN
// all listeners are passed to the service
val listeners = mutableListOf<(Transfer) -> Unit>()
verify { binder.registerTransferListener(capture(listeners)) }
assertEquals(listOf(firstDownloadListener, secondDownloadListener), listeners)
}
@Test
fun listeners_are_set_immediately_when_connected() {
// GIVEN
// service is bound
connection.onServiceConnected(componentName, binder)
// WHEN
// listeners are added
connection.registerTransferListener(firstDownloadListener)
// THEN
// listener is forwarded to service
verify { binder.registerTransferListener(firstDownloadListener) }
}
@Test
fun listeners_are_removed_when_unbinding() {
// GIVEN
// service is bound
// service has some listeners
connection.onServiceConnected(componentName, binder)
connection.registerTransferListener(firstDownloadListener)
connection.registerTransferListener(secondDownloadListener)
// WHEN
// service unbound
connection.unbind()
// THEN
// listeners removed from service
verify { binder.removeTransferListener(firstDownloadListener) }
verify { binder.removeTransferListener(secondDownloadListener) }
}
@Test
fun missed_updates_are_delivered_on_connection() {
// GIVEN
// not bound
// has listeners
// download is scheduled and is progressing
connection.registerTransferListener(firstDownloadListener)
connection.registerTransferListener(secondDownloadListener)
val request1 = Request(user, file)
connection.enqueue(request1)
val download1 = Transfer(request1.uuid, TransferState.RUNNING, 50, request1.file, request1)
val request2 = Request(user, file)
connection.enqueue(request2)
val download2 = Transfer(request2.uuid, TransferState.RUNNING, 50, request2.file, request1)
every { binder.getTransfer(request1.uuid) } returns download1
every { binder.getTransfer(request2.uuid) } returns download2
// WHEN
// service is bound
connection.onServiceConnected(componentName, binder)
// THEN
// listeners receive current download state for pending downloads
val firstListenerNotifications = mutableListOf<Transfer>()
verify { firstDownloadListener(capture(firstListenerNotifications)) }
assertEquals(listOf(download1, download2), firstListenerNotifications)
val secondListenerNotifications = mutableListOf<Transfer>()
verify { secondDownloadListener(capture(secondListenerNotifications)) }
assertEquals(listOf(download1, download2), secondListenerNotifications)
}
@Test
fun downloader_status_updates_are_delivered_on_connection() {
// GIVEN
// not bound
// has status listeners
val mockStatus: TransferManager.Status = mockk()
every { binder.status } returns mockStatus
connection.registerStatusListener(firstStatusListener)
connection.registerStatusListener(secondStatusListener)
// WHEN
// service is bound
connection.onServiceConnected(componentName, binder)
// THEN
// downloader status is delivered
verify { firstStatusListener(mockStatus) }
verify { secondStatusListener(mockStatus) }
}
@Test
fun downloader_status_not_requested_if_no_listeners() {
// GIVEN
// not bound
// no status listeners
// WHEN
// service is bound
connection.onServiceConnected(componentName, binder)
// THEN
// downloader status is not requested
verify(exactly = 0) { binder.status }
}
@Test
fun not_running_if_not_connected() {
// GIVEN
// downloader is running
// connection not bound
every { binder.isRunning } returns true
// THEN
// not running
assertFalse(connection.isRunning)
}
@Test
fun is_running_from_binder_if_connected() {
// GIVEN
// service bound
every { binder.isRunning } returns true
connection.onServiceConnected(componentName, binder)
// WHEN
// is runnign flag accessed
val isRunning = connection.isRunning
// THEN
// call delegated to binder
assertTrue(isRunning)
verify(exactly = 1) { binder.isRunning }
}
@Test
fun missed_updates_not_tracked_before_listeners_registered() {
// GIVEN
// not bound
// some downloads requested without listener
val request = Request(user, file)
connection.enqueue(request)
val download = Transfer(request.uuid, TransferState.RUNNING, 50, request.file, request)
connection.registerTransferListener(firstDownloadListener)
every { binder.getTransfer(request.uuid) } returns download
// WHEN
// service is bound
connection.onServiceConnected(componentName, binder)
// THEN
// missed updates not redelivered
verify(exactly = 0) { firstDownloadListener(any()) }
}
}
@@ -0,0 +1,281 @@
/**
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* Copyright (C) 2020 Chris Narkiewicz <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.files.downloader
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.nextcloud.client.account.User
import com.nextcloud.client.core.ManualAsyncRunner
import com.nextcloud.client.core.OnProgressCallback
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.OwnCloudClient
import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.Suite
import org.mockito.MockitoAnnotations
@RunWith(Suite::class)
@Suite.SuiteClasses(
TransferManagerTest.Enqueue::class,
TransferManagerTest.TransferStatusUpdates::class
)
class TransferManagerTest {
abstract class Base {
companion object {
const val MAX_TRANSFER_THREADS = 4
}
@MockK
lateinit var user: User
@MockK
lateinit var client: OwnCloudClient
@MockK
lateinit var mockTaskFactory: DownloadTask.Factory
/**
* All task mock functions created during test run are
* stored here.
*/
lateinit var downloadTaskMocks: MutableList<DownloadTask>
lateinit var runner: ManualAsyncRunner
lateinit var transferManager: TransferManagerImpl
/**
* Response value for all download tasks
*/
var downloadTaskResult: Boolean = true
/**
* Progress values posted by all download task mocks before
* returning result value
*/
var taskProgress = listOf<Int>()
@Before
fun setUpBase() {
MockKAnnotations.init(this, relaxed = true)
MockitoAnnotations.initMocks(this)
downloadTaskMocks = mutableListOf()
runner = ManualAsyncRunner()
transferManager = TransferManagerImpl(
runner = runner,
taskFactory = mockTaskFactory,
threads = MAX_TRANSFER_THREADS
)
downloadTaskResult = true
every { mockTaskFactory.create() } answers { createMockTask() }
}
private fun createMockTask(): DownloadTask {
val task = mockk<DownloadTask>()
every { task.download(any(), any(), any()) } answers {
taskProgress.forEach {
arg<OnProgressCallback<Int>>(1).invoke(it)
}
val request = arg<Request>(0)
DownloadTask.Result(request.file, downloadTaskResult)
}
downloadTaskMocks.add(task)
return task
}
}
class Enqueue : Base() {
@Test
fun enqueued_download_is_started_immediately() {
// GIVEN
// downloader has no running downloads
// WHEN
// download is enqueued
val file = OCFile("/path")
val request = Request(user, file)
transferManager.enqueue(request)
// THEN
// download is started immediately
val download = transferManager.getTransfer(request.uuid)
assertEquals(TransferState.RUNNING, download?.state)
}
@Test
fun enqueued_downloads_are_pending_if_running_queue_is_full() {
// GIVEN
// downloader is downloading max simultaneous files
for (i in 0 until MAX_TRANSFER_THREADS) {
val file = OCFile("/running/download/path/$i")
val request = Request(user, file)
transferManager.enqueue(request)
val runningDownload = transferManager.getTransfer(request.uuid)
assertEquals(runningDownload?.state, TransferState.RUNNING)
}
// WHEN
// another download is enqueued
val file = OCFile("/path")
val request = Request(user, file)
transferManager.enqueue(request)
// THEN
// download is pending
val download = transferManager.getTransfer(request.uuid)
assertEquals(TransferState.PENDING, download?.state)
}
}
class TransferStatusUpdates : Base() {
@get:Rule
val rule = InstantTaskExecutorRule()
val file = OCFile("/path")
@Test
fun download_task_completes() {
// GIVEN
// download is running
// download is being observed
val downloadUpdates = mutableListOf<Transfer>()
transferManager.registerTransferListener { downloadUpdates.add(it) }
transferManager.enqueue(Request(user, file))
// WHEN
// download task finishes successfully
runner.runOne()
// THEN
// listener is notified about status change
assertEquals(TransferState.RUNNING, downloadUpdates[0].state)
assertEquals(TransferState.COMPLETED, downloadUpdates[1].state)
}
@Test
fun download_task_fails() {
// GIVEN
// download is running
// download is being observed
val downloadUpdates = mutableListOf<Transfer>()
transferManager.registerTransferListener { downloadUpdates.add(it) }
transferManager.enqueue(Request(user, file))
// WHEN
// download task fails
downloadTaskResult = false
runner.runOne()
// THEN
// listener is notified about status change
assertEquals(TransferState.RUNNING, downloadUpdates[0].state)
assertEquals(TransferState.FAILED, downloadUpdates[1].state)
}
@Test
fun download_progress_is_updated() {
// GIVEN
// download is running
val downloadUpdates = mutableListOf<Transfer>()
transferManager.registerTransferListener { downloadUpdates.add(it) }
transferManager.enqueue(Request(user, file))
// WHEN
// download progress updated 4 times before completion
taskProgress = listOf(25, 50, 75, 100)
runner.runOne()
// THEN
// listener receives 6 status updates
// transition to running
// 4 progress updates
// completion
assertEquals(6, downloadUpdates.size)
if (downloadUpdates.size >= 6) {
assertEquals(TransferState.RUNNING, downloadUpdates[0].state)
assertEquals(25, downloadUpdates[1].progress)
assertEquals(50, downloadUpdates[2].progress)
assertEquals(75, downloadUpdates[3].progress)
assertEquals(100, downloadUpdates[4].progress)
assertEquals(TransferState.COMPLETED, downloadUpdates[5].state)
}
}
@Test
fun download_task_is_created_only_for_running_downloads() {
// WHEN
// multiple downloads are enqueued
for (i in 0 until MAX_TRANSFER_THREADS * 2) {
transferManager.enqueue(Request(user, file))
}
// THEN
// download task is created only for running downloads
assertEquals(MAX_TRANSFER_THREADS, downloadTaskMocks.size)
}
}
class RunningStatusUpdates : Base() {
@get:Rule
val rule = InstantTaskExecutorRule()
@Test
fun is_running_flag_on_enqueue() {
// WHEN
// download is enqueued
val file = OCFile("/path/to/file")
val request = Request(user, file)
transferManager.enqueue(request)
// THEN
// is running changes
assertTrue(transferManager.isRunning)
}
@Test
fun is_running_flag_on_completion() {
// GIVEN
// a download is in progress
val file = OCFile("/path/to/file")
val request = Request(user, file)
transferManager.enqueue(request)
assertTrue(transferManager.isRunning)
// WHEN
// download is processed
runner.runOne()
// THEN
// downloader is not running
assertFalse(transferManager.isRunning)
}
}
}
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.integration.deck
package com.nextcloud.client.integrations.deck
import android.content.Context
import android.content.Intent
@@ -0,0 +1,96 @@
/*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2020 Tobias Kaminsky
* Copyright (C) 2020 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.jobs
import android.Manifest
import androidx.test.rule.GrantPermissionRule
import androidx.work.WorkManager
import com.nextcloud.client.core.ClockImpl
import com.owncloud.android.AbstractIT
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.operations.DownloadFileOperation
import ezvcard.Ezvcard
import ezvcard.VCard
import junit.framework.Assert.assertEquals
import junit.framework.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import java.io.File
class ContactsBackupIT : AbstractOnServerIT() {
val workmanager = WorkManager.getInstance(targetContext)
private val backgroundJobManager = BackgroundJobManagerImpl(workmanager, ClockImpl())
@get:Rule
val writeContactsRule = GrantPermissionRule.grant(Manifest.permission.WRITE_CONTACTS)
@get:Rule
val readContactsRule = GrantPermissionRule.grant(Manifest.permission.READ_CONTACTS)
private val vcard: String = "vcard.vcf"
@Test
fun importExport() {
val intArray = IntArray(1)
intArray[0] = 0
// import file to local contacts
backgroundJobManager.startImmediateContactsImport(null, null, getFile(vcard).absolutePath, intArray)
shortSleep()
// export contact
backgroundJobManager.startImmediateContactsBackup(user)
longSleep()
val backupFolder: String = targetContext.resources.getString(R.string.contacts_backup_folder) +
OCFile.PATH_SEPARATOR
refreshFolder("/")
longSleep()
refreshFolder(backupFolder)
longSleep()
val backupOCFile = storageManager.getFolderContent(
storageManager.getFileByDecryptedRemotePath(backupFolder),
false
)[0]
assertTrue(DownloadFileOperation(account, backupOCFile, AbstractIT.targetContext).execute(client).isSuccess)
val backupFile = File(backupOCFile.storagePath)
// verify same
val originalCards: ArrayList<VCard> = ArrayList()
originalCards.addAll(Ezvcard.parse(getFile(vcard)).all())
val backupCards: ArrayList<VCard> = ArrayList()
backupCards.addAll(Ezvcard.parse(backupFile).all())
assertEquals(originalCards.size, backupCards.size)
assertEquals(originalCards[0].formattedName.toString(), backupCards[0].formattedName.toString())
}
}
@@ -243,10 +243,7 @@ class MigrationsManagerTest {
// pending migrations
// mandatory migrations are passing
// one migration is optional and fails
assertEquals("Fixture should provide 1 optional, failing migration",
1,
migrations.count { !it.mandatory }
)
assertEquals("Fixture should provide 1 optional, failing migration", 1, migrations.count { !it.mandatory })
val optionalFailingMigration = migrations.first { !it.mandatory }
whenever(optionalFailingMigration.run()).thenThrow(RuntimeException())
@@ -7,17 +7,22 @@ import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import com.facebook.testing.screenshot.Screenshot;
import com.nextcloud.client.RetryTestRule;
import com.facebook.testing.screenshot.internal.TestNameDetector;
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;
import com.nextcloud.client.device.BatteryStatus;
import com.nextcloud.client.device.PowerManagementService;
import com.nextcloud.client.network.Connectivity;
import com.nextcloud.client.network.ConnectivityService;
import com.nextcloud.client.preferences.AppPreferencesImpl;
import com.nextcloud.client.preferences.DarkMode;
import com.nextcloud.java.util.Optional;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.UploadsStorageManager;
@@ -27,24 +32,15 @@ import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.e2ee.ToggleEncryptionRemoteOperation;
import com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation;
import com.owncloud.android.lib.resources.files.RemoveFileRemoteOperation;
import com.owncloud.android.lib.resources.files.model.RemoteFile;
import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.operations.UploadFileOperation;
import com.owncloud.android.utils.FileStorageUtils;
import junit.framework.TestCase;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.io.FileUtils;
import org.jetbrains.annotations.NotNull;
import org.junit.After;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
import java.io.File;
import java.io.FileWriter;
@@ -52,6 +48,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import androidx.annotation.NonNull;
import androidx.test.espresso.contrib.DrawerActions;
import androidx.test.espresso.intent.rule.IntentsTestRule;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -69,13 +66,16 @@ import static org.junit.Assert.assertTrue;
*/
public abstract class AbstractIT {
@Rule public RetryTestRule retryTestRule = new RetryTestRule();
//@Rule public RetryTestRule retryTestRule = new RetryTestRule();
protected static OwnCloudClient client;
protected static Account account;
protected static User user;
protected static Context targetContext;
protected static String DARK_MODE = "";
protected static String COLOR = "";
private Activity currentActivity;
protected Activity currentActivity;
protected FileDataStorageManager fileDataStorageManager =
new FileDataStorageManager(account, targetContext.getContentResolver());
@@ -83,39 +83,32 @@ public abstract class AbstractIT {
@BeforeClass
public static void beforeAll() {
try {
// clean up
targetContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
Bundle arguments = androidx.test.platform.app.InstrumentationRegistry.getArguments();
AccountManager platformAccountManager = AccountManager.get(targetContext);
Uri baseUrl = Uri.parse(arguments.getString("TEST_SERVER_URL"));
String loginName = arguments.getString("TEST_SERVER_USERNAME");
String password = arguments.getString("TEST_SERVER_PASSWORD");
Account temp = new Account(loginName + "@" + baseUrl, MainApp.getAccountType(targetContext));
UserAccountManager accountManager = UserAccountManagerImpl.fromContext(targetContext);
if (!accountManager.exists(temp)) {
AccountManager platformAccountManager = AccountManager.get(targetContext);
platformAccountManager.addAccountExplicitly(temp, password, null);
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_ACCOUNT_VERSION,
Integer.toString(UserAccountManager.ACCOUNT_VERSION));
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_VERSION, "14.0.0.0");
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, baseUrl.toString());
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_USER_ID, loginName); // same as userId
for (Account account : platformAccountManager.getAccounts()) {
if (account.type.equalsIgnoreCase("nextcloud")) {
platformAccountManager.removeAccountExplicitly(account);
}
}
Account temp = new Account("test@https://server.com", MainApp.getAccountType(targetContext));
platformAccountManager.addAccountExplicitly(temp, "password", null);
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://server.com");
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_USER_ID, "test");
final UserAccountManager userAccountManager = UserAccountManagerImpl.fromContext(targetContext);
account = userAccountManager.getAccountByName(loginName + "@" + baseUrl);
account = userAccountManager.getAccountByName("test@https://server.com");
if (account == null) {
throw new ActivityNotFoundException();
}
Optional<User> optionalUser = userAccountManager.getUser(account.name);
user = optionalUser.orElseThrow(IllegalAccessError::new);
client = OwnCloudClientFactory.createOwnCloudClient(account, targetContext);
createDummyFiles();
waitForServer(client, baseUrl);
deleteAllFiles(); // makes sure that no file/folder is in root
} catch (OperationCanceledException e) {
e.printStackTrace();
} catch (AuthenticatorException e) {
@@ -125,37 +118,64 @@ public abstract class AbstractIT {
} catch (AccountUtils.AccountNotFoundException e) {
e.printStackTrace();
}
}
@After
public void after() {
deleteAllFiles();
}
Bundle arguments = androidx.test.platform.app.InstrumentationRegistry.getArguments();
public static void deleteAllFiles() {
RemoteOperationResult result = new ReadFolderRemoteOperation("/").execute(client);
assertTrue(result.getLogMessage(), result.isSuccess());
// color
String colorParameter = arguments.getString("COLOR");
if (!TextUtils.isEmpty(colorParameter)) {
FileDataStorageManager fileDataStorageManager = new FileDataStorageManager(account,
targetContext.getContentResolver());
for (Object object : result.getData()) {
RemoteFile remoteFile = (RemoteFile) object;
String colorHex = null;
COLOR = colorParameter;
switch (colorParameter) {
case "red":
colorHex = "#7c0000";
break;
if (!remoteFile.getRemotePath().equals("/")) {
if (remoteFile.isEncrypted()) {
assertTrue(new ToggleEncryptionRemoteOperation(remoteFile.getLocalId(),
remoteFile.getRemotePath(),
false)
.execute(client)
.isSuccess());
}
case "green":
colorHex = "#00ff00";
break;
assertTrue(new RemoveFileRemoteOperation(remoteFile.getRemotePath())
.execute(client)
.isSuccess()
);
case "white":
colorHex = "#ffffff";
break;
case "black":
colorHex = "#000000";
break;
default:
break;
}
if (colorHex != null) {
OCCapability capability = fileDataStorageManager.getCapability(account.name);
capability.setServerColor(colorHex);
fileDataStorageManager.saveCapabilities(capability);
}
}
}
// dark / light
String darkModeParameter = arguments.getString("DARKMODE");
if (darkModeParameter != null) {
if (darkModeParameter.equalsIgnoreCase("dark")) {
DARK_MODE = "dark";
AppPreferencesImpl.fromContext(targetContext).setDarkThemeMode(DarkMode.DARK);
MainApp.setAppTheme(DarkMode.DARK);
} else {
DARK_MODE = "light";
}
}
if (DARK_MODE.equalsIgnoreCase("light") && COLOR.equalsIgnoreCase("blue")) {
// use already existing names
DARK_MODE = "";
COLOR = "";
}
}
protected FileDataStorageManager getStorageManager() {
return fileDataStorageManager;
@@ -165,16 +185,48 @@ public abstract class AbstractIT {
return AccountManager.get(targetContext).getAccounts();
}
private static void createDummyFiles() throws IOException {
new File(FileStorageUtils.getSavePath(account.name)).mkdirs();
protected static void createDummyFiles() throws IOException {
File tempPath = new File(FileStorageUtils.getTemporalPath(account.name));
if (!tempPath.exists()) {
assertTrue(tempPath.mkdirs());
}
assertTrue(tempPath.exists());
createFile("empty.txt", 0);
createFile("nonEmpty.txt", 100);
createFile("chunkedFile.txt", 500000);
}
public static void createFile(String name, int iteration) throws IOException {
File file = new File(FileStorageUtils.getSavePath(account.name) + File.separator + name);
protected static File getDummyFile(String name) throws IOException {
File file = new File(FileStorageUtils.getTemporalPath(account.name) + File.pathSeparator + name);
if (file.exists()) {
return file;
} else {
switch (name) {
case "empty.txt":
return createFile("empty.txt", 0);
case "nonEmpty.txt":
return createFile("nonEmpty.txt", 100);
case "chunkedFile.txt":
return createFile("chunkedFile.txt", 500000);
default:
return createFile(name, 0);
}
}
}
public static File createFile(String name, int iteration) throws IOException {
File tempPath = new File(FileStorageUtils.getTemporalPath(account.name));
if (!tempPath.exists()) {
assertTrue(tempPath.mkdirs());
}
File file = new File(FileStorageUtils.getTemporalPath(account.name) + File.separator + name);
file.createNewFile();
FileWriter writer = new FileWriter(file);
@@ -184,28 +236,8 @@ public abstract class AbstractIT {
}
writer.flush();
writer.close();
}
private static void waitForServer(OwnCloudClient client, Uri baseUrl) {
GetMethod get = new GetMethod(baseUrl + "/status.php");
try {
int i = 0;
while (client.executeMethod(get) != HttpStatus.SC_OK && i < 3) {
System.out.println("wait…");
Thread.sleep(60 * 1000);
i++;
}
if (i == 3) {
Assert.fail("Server not ready!");
}
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return file;
}
protected File getFile(String filename) throws IOException {
@@ -229,7 +261,7 @@ public abstract class AbstractIT {
waitForIdleSync();
Screenshot.snapActivity(sut).record();
screenshot(sut);
}
protected Activity getCurrentActivity() {
@@ -263,7 +295,7 @@ public abstract class AbstractIT {
}
public OCFile createFolder(String remotePath) {
TestCase.assertTrue(new CreateFolderOperation(remotePath, account, targetContext)
TestCase.assertTrue(new CreateFolderOperation(remotePath, user, targetContext)
.execute(client, getStorageManager())
.isSuccess());
@@ -284,7 +316,7 @@ public abstract class AbstractIT {
};
PowerManagementService powerManagementServiceMock = new PowerManagementService() {
@NotNull
@NonNull
@Override
public BatteryStatus getBattery() {
return new BatteryStatus();
@@ -309,7 +341,7 @@ public abstract class AbstractIT {
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
account,
user,
null,
ocUpload,
FileUploader.NameCollisionPolicy.DEFAULT,
@@ -327,4 +359,26 @@ public abstract class AbstractIT {
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
assertTrue(result.getLogMessage(), result.isSuccess());
}
protected void screenshot(View view) {
Screenshot.snap(view).setName(createName()).record();
}
protected void screenshot(Activity sut) {
Screenshot.snapActivity(sut).setName(createName()).record();
}
private String createName() {
String name = TestNameDetector.getTestClass() + "_" + TestNameDetector.getTestName();
if (!DARK_MODE.isEmpty()) {
name = name + "_" + DARK_MODE;
}
if (!COLOR.isEmpty()) {
name = name + "_" + COLOR;
}
return name;
}
}
@@ -0,0 +1,250 @@
package com.owncloud.android;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
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;
import com.nextcloud.client.device.BatteryStatus;
import com.nextcloud.client.device.PowerManagementService;
import com.nextcloud.client.network.Connectivity;
import com.nextcloud.client.network.ConnectivityService;
import com.nextcloud.java.util.Optional;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.UploadsStorageManager;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.e2ee.ToggleEncryptionRemoteOperation;
import com.owncloud.android.lib.resources.files.ReadFolderRemoteOperation;
import com.owncloud.android.lib.resources.files.RemoveFileRemoteOperation;
import com.owncloud.android.lib.resources.files.model.RemoteFile;
import com.owncloud.android.operations.RefreshFolderOperation;
import com.owncloud.android.operations.UploadFileOperation;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.junit.After;
import org.junit.Assert;
import org.junit.BeforeClass;
import java.io.File;
import java.io.IOException;
import androidx.annotation.NonNull;
import androidx.test.platform.app.InstrumentationRegistry;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* Common base for all integration tests
*/
public abstract class AbstractOnServerIT extends AbstractIT {
@BeforeClass
public static void beforeAll() {
try {
// clean up
targetContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
AccountManager platformAccountManager = AccountManager.get(targetContext);
for (Account account : platformAccountManager.getAccounts()) {
if (account.type.equalsIgnoreCase("nextcloud")) {
platformAccountManager.removeAccountExplicitly(account);
}
}
Bundle arguments = androidx.test.platform.app.InstrumentationRegistry.getArguments();
Uri baseUrl = Uri.parse(arguments.getString("TEST_SERVER_URL"));
String loginName = arguments.getString("TEST_SERVER_USERNAME");
String password = arguments.getString("TEST_SERVER_PASSWORD");
Account temp = new Account(loginName + "@" + baseUrl, MainApp.getAccountType(targetContext));
UserAccountManager accountManager = UserAccountManagerImpl.fromContext(targetContext);
if (!accountManager.exists(temp)) {
platformAccountManager.addAccountExplicitly(temp, password, null);
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_ACCOUNT_VERSION,
Integer.toString(UserAccountManager.ACCOUNT_VERSION));
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_VERSION, "14.0.0.0");
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, baseUrl.toString());
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_USER_ID, loginName); // same as userId
}
final UserAccountManager userAccountManager = UserAccountManagerImpl.fromContext(targetContext);
account = userAccountManager.getAccountByName(loginName + "@" + baseUrl);
if (account == null) {
throw new ActivityNotFoundException();
}
Optional<User> optionalUser = userAccountManager.getUser(account.name);
user = optionalUser.orElseThrow(IllegalAccessError::new);
client = OwnCloudClientFactory.createOwnCloudClient(account, targetContext);
createDummyFiles();
waitForServer(client, baseUrl);
deleteAllFiles(); // makes sure that no file/folder is in root
} catch (OperationCanceledException e) {
e.printStackTrace();
} catch (AuthenticatorException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (AccountUtils.AccountNotFoundException e) {
e.printStackTrace();
}
}
@After
public void after() {
deleteAllFiles();
}
public static void deleteAllFiles() {
RemoteOperationResult result = new ReadFolderRemoteOperation("/").execute(client);
assertTrue(result.getLogMessage(), result.isSuccess());
for (Object object : result.getData()) {
RemoteFile remoteFile = (RemoteFile) object;
if (!remoteFile.getRemotePath().equals("/")) {
if (remoteFile.isEncrypted()) {
assertTrue(new ToggleEncryptionRemoteOperation(remoteFile.getLocalId(),
remoteFile.getRemotePath(),
false)
.execute(client)
.isSuccess());
}
assertTrue(new RemoveFileRemoteOperation(remoteFile.getRemotePath())
.execute(client)
.isSuccess()
);
}
}
}
private static void waitForServer(OwnCloudClient client, Uri baseUrl) {
GetMethod get = new GetMethod(baseUrl + "/status.php");
try {
int i = 0;
while (client.executeMethod(get) != HttpStatus.SC_OK && i < 3) {
System.out.println("wait…");
Thread.sleep(60 * 1000);
i++;
}
if (i == 3) {
Assert.fail("Server not ready!");
}
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public void uploadOCUpload(OCUpload ocUpload) {
uploadOCUpload(ocUpload, FileUploader.LOCAL_BEHAVIOUR_COPY);
}
public void uploadOCUpload(OCUpload ocUpload, int localBehaviour) {
ConnectivityService connectivityServiceMock = new ConnectivityService() {
@Override
public boolean isInternetWalled() {
return false;
}
@Override
public Connectivity getConnectivity() {
return Connectivity.CONNECTED_WIFI;
}
};
PowerManagementService powerManagementServiceMock = new PowerManagementService() {
@NonNull
@Override
public BatteryStatus getBattery() {
return new BatteryStatus();
}
@Override
public boolean isPowerSavingEnabled() {
return false;
}
@Override
public boolean isPowerSavingExclusionAvailable() {
return false;
}
};
UserAccountManager accountManager = UserAccountManagerImpl.fromContext(targetContext);
UploadsStorageManager uploadsStorageManager = new UploadsStorageManager(accountManager,
targetContext.getContentResolver());
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
FileUploader.NameCollisionPolicy.DEFAULT,
localBehaviour,
targetContext,
false,
false
);
newUpload.addRenameUploadListener(() -> {
// dummy
});
newUpload.setRemoteFolderToBeCreated();
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
assertTrue(result.getLogMessage(), result.isSuccess());
OCFile parentFolder = getStorageManager()
.getFileByEncryptedRemotePath(new File(ocUpload.getRemotePath()).getParent() + "/");
String uploadedFileName = new File(ocUpload.getRemotePath()).getName();
OCFile uploadedFile = getStorageManager().
getFileByDecryptedRemotePath(parentFolder.getDecryptedRemotePath() + uploadedFileName);
assertNotNull(uploadedFile.getRemoteId());
if (localBehaviour == FileUploader.LOCAL_BEHAVIOUR_COPY ||
localBehaviour == FileUploader.LOCAL_BEHAVIOUR_MOVE) {
assertTrue(new File(uploadedFile.getStoragePath()).exists());
}
}
protected void refreshFolder(String path) {
assertTrue(new RefreshFolderOperation(getStorageManager().getFileByEncryptedRemotePath(path),
System.currentTimeMillis(),
false,
false,
getStorageManager(),
account,
targetContext
).execute(client).isSuccess());
}
}
@@ -0,0 +1,121 @@
/*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2020 Tobias Kaminsky
* Copyright (C) 2020 Nextcloud GmbH
* Copyright (C) 2020 Chris Narkiewicz <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android;
import android.net.Uri;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.OCUpload;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.operations.DownloadFileOperation;
import com.owncloud.android.operations.RefreshFolderOperation;
import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.utils.FileStorageUtils;
import org.junit.After;
import org.junit.Test;
import java.io.File;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
/**
* Tests related to file uploads
*/
public class DownloadIT extends AbstractOnServerIT {
private static final String FOLDER = "/testUpload/";
@After
public void after() {
RemoteOperationResult result = new RefreshFolderOperation(getStorageManager().getFileByPath("/"),
System.currentTimeMillis() / 1000L,
false,
true,
getStorageManager(),
account,
targetContext)
.execute(client);
// cleanup only if folder exists
if (result.isSuccess() && getStorageManager().getFileByDecryptedRemotePath(FOLDER) != null) {
new RemoveFileOperation(getStorageManager().getFileByDecryptedRemotePath(FOLDER),
false,
account,
false,
targetContext)
.execute(client, getStorageManager());
}
}
@Test
public void verifyDownload() {
OCUpload ocUpload = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt",
FOLDER + "nonEmpty.txt",
account.name);
uploadOCUpload(ocUpload);
OCUpload ocUpload2 = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/nonEmpty.txt",
FOLDER + "nonEmpty2.txt",
account.name);
uploadOCUpload(ocUpload2);
refreshFolder("/");
refreshFolder(FOLDER);
OCFile file1 = fileDataStorageManager.getFileByDecryptedRemotePath(FOLDER + "nonEmpty.txt");
OCFile file2 = fileDataStorageManager.getFileByDecryptedRemotePath(FOLDER + "nonEmpty2.txt");
verifyDownload(file1, file2);
assertTrue(new DownloadFileOperation(account, file1, targetContext).execute(client).isSuccess());
assertTrue(new DownloadFileOperation(account, file2, targetContext).execute(client).isSuccess());
refreshFolder(FOLDER);
file1 = fileDataStorageManager.getFileByDecryptedRemotePath(FOLDER + "nonEmpty.txt");
file2 = fileDataStorageManager.getFileByDecryptedRemotePath(FOLDER + "nonEmpty2.txt");
verifyDownload(file1, file2);
}
private void verifyDownload(OCFile file1, OCFile file2) {
assertNotNull(file1);
assertNotNull(file2);
assertNotSame(file1.getStoragePath(), file2.getStoragePath());
assertTrue(new File(file1.getStoragePath()).exists());
assertTrue(new File(file2.getStoragePath()).exists());
// test against hardcoded path to make sure that it is correct
assertEquals("/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/" +
Uri.encode(account.name, "@") + "/testUpload/nonEmpty.txt",
file1.getStoragePath());
assertEquals("/storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/" +
Uri.encode(account.name, "@") + "/testUpload/nonEmpty2.txt",
file2.getStoragePath());
}
}
@@ -18,7 +18,7 @@ import static org.junit.Assert.assertNull;
* Tests related to file operations
*/
@RunWith(AndroidJUnit4.class)
public class FileIT extends AbstractIT {
public class FileIT extends AbstractOnServerIT {
@Test
public void testCreateFolder() {
@@ -27,7 +27,7 @@ public class FileIT extends AbstractIT {
// folder does not exist yet
assertNull(getStorageManager().getFileByPath(path));
SyncOperation syncOp = new CreateFolderOperation(path, account, targetContext);
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext);
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
assertTrue(result.toString(), result.isSuccess());
@@ -46,7 +46,7 @@ public class FileIT extends AbstractIT {
// folder does not exist yet
assertNull(getStorageManager().getFileByPath(path));
SyncOperation syncOp = new CreateFolderOperation(path, account, targetContext);
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext);
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
assertTrue(result.toString(), result.isSuccess());
@@ -1,68 +0,0 @@
/*
*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2020 Tobias Kaminsky
* Copyright (C) 2020 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.owncloud.android;
import android.content.Context;
import android.net.ConnectivityManager;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.logger.Logger;
import com.nextcloud.client.network.ClientFactory;
import com.nextcloud.client.network.ClientFactoryImpl;
import com.nextcloud.client.network.ConnectivityService;
import com.nextcloud.client.network.ConnectivityServiceImpl;
import com.owncloud.android.lib.common.utils.Log_OC;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
@Module
public class MockedNetworkModule {
@Provides
ConnectivityService connectivityService(ConnectivityManager connectivityManager,
UserAccountManager accountManager,
ClientFactory clientFactory,
Logger logger) {
return new ConnectivityServiceImpl(connectivityManager,
accountManager,
clientFactory,
new ConnectivityServiceImpl.GetRequestBuilder(),
logger);
}
@Provides
@Singleton
ClientFactory clientFactory(Context context) {
Log_OC.d("MOCK", "c");
return new ClientFactoryImpl(context, new MockInterceptor());
}
@Provides
@Singleton
ConnectivityManager connectivityManager(Context context) {
return (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
}
}
@@ -7,6 +7,7 @@ import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.activity.SettingsActivity;
import com.owncloud.android.ui.activity.SyncedFoldersActivity;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -31,7 +32,6 @@ import static androidx.test.espresso.Espresso.onData;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.Espresso.pressBack;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.swipeUp;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.core.AnyOf.anyOf;
@@ -39,7 +39,7 @@ import static org.junit.Assert.assertTrue;
@LargeTest
@RunWith(JUnit4.class)
public class ScreenshotsIT extends AbstractIT {
public class ScreenshotsIT extends AbstractOnServerIT {
@ClassRule
public static final LocaleTestRule localeTestRule = new LocaleTestRule();
@@ -72,8 +72,8 @@ public class ScreenshotsIT extends AbstractIT {
String path = "/Camera/";
// folder does not exist yet
if (getStorageManager().getFileByPath(path) == null) {
SyncOperation syncOp = new CreateFolderOperation(path, account, targetContext);
if (getStorageManager().getFileByEncryptedRemotePath(path) == null) {
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext);
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
assertTrue(result.isSuccess());
@@ -117,11 +117,7 @@ public class ScreenshotsIT extends AbstractIT {
@Test
public void autoUploadScreenshot() {
ActivityScenario.launch(FileDisplayActivity.class);
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(swipeUp());
onView(anyOf(withText(R.string.drawer_synced_folders), withId(R.id.nav_synced_folders))).perform(click());
ActivityScenario.launch(SyncedFoldersActivity.class);
Screengrab.screenshot("05_autoUpload");
Loaded 100 of 439 files, more files were not shown because too many files have changed in this diff. Show more