Compare commits

...
Author SHA1 Message Date
tobiasKaminsky 91cd67dbce revert removing buildTypes 2016-10-19 19:08:45 +02:00
AndyScherzinger 649e3972c3 new version 2016-10-19 18:12:14 +02:00
AndyScherzinger 6954e8af3f Merge branch 'master' of https://github.com/nextcloud/android into beta
# Conflicts:
#	res/xml/preferences.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-10-19 17:22:57 +02:00
AndyScherzinger 90637b7ba2 Merge branch 'accountSwitcherOptimizations' of https://github.com/nextcloud/android into beta
# Conflicts:
#	build.gradle
2016-10-18 16:25:51 +02:00
AndyScherzinger 1b1162e625 fixes after cherry pick 2016-10-17 14:40:24 +02:00
AndyScherzinger a5f2620858 use latest 2.2.1 gradle/Android plugin 2016-10-17 14:33:29 +02:00
David A. Velasco 4b3c122232 Finish action mode when drawer starts to open, recover it when drawer is closed
# Conflicts:
#	build.gradle
#	src/com/owncloud/android/ui/activity/DrawerActivity.java
#	src/com/owncloud/android/ui/fragment/OCFileListFragment.java
2016-10-17 14:31:18 +02:00
AndyScherzinger ad28148acb spacing fix (dp perfect) 2016-10-17 13:44:20 +02:00
AndyScherzinger 987b584604 fixed file headers 2016-10-17 13:44:20 +02:00
AndyScherzinger 9f78f3b65b housekeeping (file_actions and AccountActionsDialog aren't in use anymore due to multi select / account manager capabilities) 2016-10-17 13:44:20 +02:00
AndyScherzinger f03e1c3a2f layout fixes II 2016-10-17 13:44:20 +02:00
AndyScherzinger 1ac7218337 layoutfix 2016-10-17 13:44:19 +02:00
AndyScherzinger 573a729905 optimized layout adding username + account-url 2016-10-17 13:44:19 +02:00
AndyScherzinger 99e675dd18 name and avatr clickable (switching accounts) 2016-10-17 13:44:19 +02:00
AndyScherzinger 8f3de4ff74 highlight currently active user 2016-10-17 13:44:19 +02:00
David A. Velasco 3b118bb7d9 Show a check mark on the current account in the account manager
# Conflicts:
#	res/layout/account_item.xml
#	src/com/owncloud/android/ui/activity/ManageAccountsActivity.java
#	src/com/owncloud/android/ui/adapter/AccountListAdapter.java
2016-10-17 13:44:19 +02:00
AndyScherzinger 29e0dbd14a account switching via list item click 2016-10-17 13:44:18 +02:00
David A. Velasco f6a5466264 Fix exit of the app after not creating account from 'Add account' in navigation drawer 2016-10-17 13:44:18 +02:00
tobiasKaminsky b1e3818c98 update 2016-10-17 09:46:00 +02:00
Tobias Kaminsky 571f3b2a97 Merge pull request #335 from iskradelta/beta
Begin debug logs when build type is debug
2016-10-17 09:40:06 +02:00
Iskra Delta 0eab22268f Begin debug logs always
Previous check was not true hence no logs
being made ever. Also place the logs in
different folder in case user wishes
to debug both apps (or more) at the same
time.
2016-10-16 19:27:12 +00:00
tobiasKaminsky 1cd8c098d8 update 2016-10-12 18:54:31 +02:00
tobiasKaminsky a3aa7b33eb fix wrong merging 2016-10-12 18:50:26 +02:00
tobiasKaminsky b3ba7d104f Merge remote-tracking branch 'remotes/origin/build24' into beta
# Conflicts:
#	AndroidManifest.xml
#	build.gradle
#	res/values/setup.xml
#	src/com/owncloud/android/utils/FileStorageUtils.java
2016-10-12 18:38:59 +02:00
David A. Velasco 5f4275f3b9 Fix crash opening or sending files in Android 7
# Conflicts:
#	res/values/setup.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-10-12 18:38:20 +02:00
Andy Scherzinger aa76b425e2 Revert "reactive instrumented demo test"
This reverts commit f7195a0192.
2016-10-12 18:35:40 +02:00
Andy Scherzinger 1d10f18da0 reactive instrumented demo test 2016-10-12 18:35:40 +02:00
Andy Scherzinger cb0912a9d4 no pre-dexing on travis (performance) 2016-10-12 18:35:20 +02:00
Andy Scherzinger c513d574d5 Update build tools to 24.0.1, java7 compat 2016-10-12 18:34:43 +02:00
Andy Scherzinger 0ffc2372bb rebase/merge 2016-10-12 18:34:14 +02:00
Andy Scherzinger 65c7a53cbf Revert "added jcenter repo"
This reverts commit b54e954c96014babd176d8f50ba6b7a9e44dea38.
2016-10-12 18:33:56 +02:00
Andy Scherzinger 98beb64abe added jcenter repo 2016-10-12 18:33:39 +02:00
Andy Scherzinger 4af64f5249 bump to v24 incl. toolchain, jdk8 etc. 2016-10-12 18:33:39 +02:00
Andy Scherzinger d53ae1bbad cleanup 2016-10-12 18:32:43 +02:00
Andy Scherzinger a8c3311e69 CR 2016-10-12 18:32:43 +02:00
tobiasKaminsky c4eede9f25 save gridColumns on start/stop 2016-10-12 18:30:37 +02:00
tobiasKaminsky 8920afe054 wip 2016-10-12 18:27:58 +02:00
Jubril Edu 78da832560 Incorporated Checkstyle, findbugs, pmd and lint 2016-10-12 18:27:03 +02:00
AndyScherzinger a1d6aa730e Merge branch 'accountSwitcherOptimizations' of https://github.com/nextcloud/android into beta 2016-10-12 16:59:27 +02:00
AndyScherzinger b96e4719ab spacing fix (dp perfect) 2016-10-12 16:58:31 +02:00
AndyScherzinger 7d4f1d4ac0 fixed file headers 2016-10-12 16:51:40 +02:00
AndyScherzinger b499e31051 housekeeping (file_actions and AccountActionsDialog aren't in use anymore due to multi select / account manager capabilities) 2016-10-12 16:51:24 +02:00
AndyScherzinger 598bd5f9ce Merge branch 'accountSwitcherOptimizations' of https://github.com/nextcloud/android into beta
# Conflicts:
#	res/layout/account_item.xml
2016-10-12 15:01:55 +02:00
AndyScherzinger 85f7e0e44f layout fixes II 2016-10-12 15:00:43 +02:00
AndyScherzinger b4552df41b layoutfix 2016-10-12 13:20:58 +02:00
AndyScherzinger 09b57dfb1a optimized layout adding username + account-url 2016-10-12 12:18:27 +02:00
AndyScherzinger 09b82393f0 name and avatr clickable (switching accounts) 2016-10-12 12:18:27 +02:00
AndyScherzinger 7637604ba2 highlight currently active user 2016-10-12 12:18:27 +02:00
David A. Velasco 9c543986ef Show a check mark on the current account in the account manager
# Conflicts:
#	res/layout/account_item.xml
#	src/com/owncloud/android/ui/activity/ManageAccountsActivity.java
#	src/com/owncloud/android/ui/adapter/AccountListAdapter.java
2016-10-12 12:18:26 +02:00
AndyScherzinger b75e04207e account switching via list item click 2016-10-12 12:18:26 +02:00
David A. Velasco 33e1b0c0b1 Fix exit of the app after not creating account from 'Add account' in navigation drawer 2016-10-12 12:18:23 +02:00
AndyScherzinger 490fa936eb Fixes after pulls, bumping version code, latest gradle plugin 2016-10-12 11:24:14 +02:00
AndyScherzinger 52c39b3da2 Merge branch 'MimeUtilsHousekeeping' of https://github.com/nextcloud/android into beta
# Conflicts:
#	src/com/owncloud/android/datamodel/OCFile.java
#	src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
#	src/com/owncloud/android/ui/adapter/FileListListAdapter.java
2016-10-12 10:55:10 +02:00
AndyScherzinger 61e773968c Merge branch 'accountSwitcherOptimizations' of https://github.com/nextcloud/android into beta 2016-10-12 10:53:47 +02:00
AndyScherzinger 3bc6f48c14 Merge branch 'master' of https://github.com/nextcloud/android into beta 2016-10-12 10:52:56 +02:00
AndyScherzinger 720b5bbf26 optimized layout adding username + account-url 2016-10-11 16:07:20 +02:00
AndyScherzinger 3443a892ef name and avatr clickable (switching accounts) 2016-10-11 15:20:16 +02:00
AndyScherzinger bcb2b8e358 highlight currently active user 2016-10-11 15:08:41 +02:00
David A. Velasco b80d3ab772 Show a check mark on the current account in the account manager
# Conflicts:
#	res/layout/account_item.xml
#	src/com/owncloud/android/ui/activity/ManageAccountsActivity.java
#	src/com/owncloud/android/ui/adapter/AccountListAdapter.java
2016-10-11 14:08:27 +02:00
AndyScherzinger 5daff9a7e3 account switching via list item click 2016-10-11 13:24:05 +02:00
David A. Velasco 867ceb1574 Fix exit of the app after not creating account from 'Add account' in navigation drawer 2016-10-11 13:11:58 +02:00
AndyScherzinger 997bc22d94 rename 2/2 2016-10-10 18:32:00 +02:00
AndyScherzinger bcb7819592 rename 1/2 2016-10-10 18:31:32 +02:00
AndyScherzinger d7995cbf30 Move all file type (as in mime type) checks to MimeTypeUtil 2016-10-10 15:29:20 +02:00
AndyScherzinger 87549920d7 Merge branch 'beta' of https://github.com/nextcloud/android into beta 2016-10-06 22:45:00 +02:00
AndyScherzinger bbc2d14b37 Merge branch 'master' of https://github.com/nextcloud/android into beta 2016-10-06 22:44:14 +02:00
tobiasKaminsky 47e92e8360 new version 2016-10-06 19:34:12 +02:00
tobiasKaminsky b963ca650c Merge remote-tracking branch 'origin/descendIntoFolder' into beta 2016-10-06 19:31:43 +02:00
tobiasKaminsky 78bc2f3391 Merge remote-tracking branch 'origin/master' into beta 2016-10-06 19:31:01 +02:00
AndyScherzinger fe21d590e9 version bump + CHANGELOG.md 2016-10-06 10:11:38 +02:00
AndyScherzinger cd46d2b964 Merge branch 'build24' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	build.gradle
#	res/values/setup.xml
#	src/com/owncloud/android/ui/helpers/FileOperationsHelper.java
#	src/com/owncloud/android/utils/FileStorageUtils.java
2016-10-06 09:57:19 +02:00
AndyScherzinger a142711031 Merge branch 'master' of https://github.com/nextcloud/android into beta
# Conflicts:
#	src/com/owncloud/android/ui/helpers/FileOperationsHelper.java
#	src/com/owncloud/android/utils/FileStorageUtils.java
2016-10-06 09:54:40 +02:00
AndyScherzinger b33445d17e fix after rebase 2016-10-06 09:39:54 +02:00
AndyScherzinger 4d2a43aabd update support library 2016-10-06 09:14:59 +02:00
Andy Scherzinger e7be185502 fix android-lib reference 2016-10-06 09:14:59 +02:00
Andy Scherzinger cd755699e3 fixes 2016-10-06 09:14:58 +02:00
David A. Velasco fc27def747 Fix crash opening or sending files in Android 7
# Conflicts:
#	res/values/setup.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-10-06 09:14:58 +02:00
Andy Scherzinger 3c52abe2d8 Revert "reactive instrumented demo test"
This reverts commit f7195a0192.
2016-10-06 09:10:56 +02:00
Andy Scherzinger 0c1c791f7f reactive instrumented demo test 2016-10-06 09:10:56 +02:00
Andy Scherzinger 25ef4d941d change emulator ready detection again, disable running sample instrumented unit test (failing at the moment)
updated wait_for_emulator.sh for actual travis cookbook revision https://github.com/travis-ci/travis-cookbooks/blob/62039b204699adcdf4b3365fac42d81246cb57fe/ci_environment/android-sdk/files/default/android-wait-for-emulator

try emulator 24

bump support lib to 24.2.0
2016-10-06 09:10:56 +02:00
Andy Scherzinger a942fc7fc0 bump Android SDK Build-Tools to 24.0.2 2016-10-06 09:10:56 +02:00
Andy Scherzinger 1ba8dccc22 no pre-dexing on travis (performance) 2016-10-06 09:10:56 +02:00
Andy Scherzinger 90df2299f6 Update build tools to 24.0.1, java7 compat 2016-10-06 09:10:55 +02:00
Andy Scherzinger e4ab7a812c rebase/merge 2016-10-06 09:10:55 +02:00
Andy Scherzinger 89094c1f10 lib1.0.4 2016-10-06 09:10:55 +02:00
Andy Scherzinger 919478723c Revert "added jcenter repo"
This reverts commit b54e954c96014babd176d8f50ba6b7a9e44dea38.
2016-10-06 09:10:55 +02:00
Andy Scherzinger 8254baf187 link to v24 version of the Nc lib 2016-10-06 09:10:55 +02:00
Andy Scherzinger 12d9bdd6f8 added jcenter repo 2016-10-06 09:10:55 +02:00
Andy Scherzinger 40c3e17ea9 bump to v24 incl. toolchain, jdk8 etc. 2016-10-06 09:10:54 +02:00
tobiasKaminsky c2225dda46 add change to subfolder 2016-10-05 20:24:13 +02:00
AndyScherzinger 46c81972ec merge fix 2016-10-05 01:31:51 +02:00
AndyScherzinger 0edcf3a45a Merge branch 'build24' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	build.gradle
#	res/values/setup.xml
#	src/com/owncloud/android/utils/FileStorageUtils.java
2016-10-05 01:07:02 +02:00
AndyScherzinger 3f70de3579 update support library 2016-10-05 00:58:04 +02:00
AndyScherzinger 09d0637c8b Merge branch 'fixDroneLink' of https://github.com/nextcloud/android into beta 2016-10-05 00:33:11 +02:00
AndyScherzinger 7470d6f3eb further pulls/changes 2016-10-05 00:32:36 +02:00
AndyScherzinger ba99684909 Merge branch 'wordingDavdroid' of https://github.com/nextcloud/android into beta 2016-10-05 00:31:20 +02:00
AndyScherzinger abcb8e8161 Merge branch 'cursorFix' of https://github.com/nextcloud/android into beta 2016-10-05 00:29:47 +02:00
AndyScherzinger 59355d38d5 log result code for error without exceptions 2016-10-05 00:15:34 +02:00
AndyScherzinger 852c11e11c distinguish exception for error and canceled 2016-10-05 00:09:04 +02:00
AndyScherzinger 70085c09ea Merge branch 'master' of https://github.com/nextcloud/android into beta 2016-10-04 23:49:28 +02:00
tobiasKaminsky 4ef6a9863a descend into folder after creating it in uploader 2016-10-04 13:52:41 +02:00
Andy Scherzinger 27e396501c fix android-lib reference 2016-10-04 13:44:55 +02:00
Andy Scherzinger 1074f20f9c fixes 2016-10-04 13:44:55 +02:00
David A. Velasco 9d5482a0c7 Fix crash opening or sending files in Android 7
# Conflicts:
#	res/values/setup.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-10-04 13:44:54 +02:00
Andy Scherzinger c7574a3d73 Revert "reactive instrumented demo test"
This reverts commit f7195a0192.
2016-10-04 13:44:54 +02:00
Andy Scherzinger 03e3684865 reactive instrumented demo test 2016-10-04 13:44:54 +02:00
Andy Scherzinger 9ee7909eb0 change emulator ready detection again, disable running sample instrumented unit test (failing at the moment)
updated wait_for_emulator.sh for actual travis cookbook revision https://github.com/travis-ci/travis-cookbooks/blob/62039b204699adcdf4b3365fac42d81246cb57fe/ci_environment/android-sdk/files/default/android-wait-for-emulator

try emulator 24

bump support lib to 24.2.0
2016-10-04 13:44:54 +02:00
Andy Scherzinger e7d577fe17 bump Android SDK Build-Tools to 24.0.2 2016-10-04 13:44:54 +02:00
Andy Scherzinger 0805bf6456 no pre-dexing on travis (performance) 2016-10-04 13:44:53 +02:00
Andy Scherzinger 7fcb2c4cb0 Update build tools to 24.0.1, java7 compat 2016-10-04 13:44:53 +02:00
Andy Scherzinger a7aa45a891 rebase/merge 2016-10-04 13:44:53 +02:00
Andy Scherzinger 239140d5e6 lib1.0.4 2016-10-04 13:44:53 +02:00
Andy Scherzinger 25e896a096 Revert "added jcenter repo"
This reverts commit b54e954c96014babd176d8f50ba6b7a9e44dea38.
2016-10-04 13:44:53 +02:00
Andy Scherzinger 829c5b9a35 link to v24 version of the Nc lib 2016-10-04 13:44:52 +02:00
Andy Scherzinger 8ae9670250 added jcenter repo 2016-10-04 13:44:52 +02:00
Andy Scherzinger 56453266a6 bump to v24 incl. toolchain, jdk8 etc. 2016-10-04 13:44:49 +02:00
Andy Scherzinger 5c42d96259 Merge branch '201_fixExpandableUploadListAdapter' of https://github.com/nextcloud/android into beta 2016-09-26 17:53:11 +02:00
Andy Scherzinger 7efae88a5d bugfix for NPE #201 2016-09-26 17:49:45 +02:00
Andy Scherzinger 515c6fe943 Merge branch 'beta' of https://github.com/nextcloud/android into beta
# Conflicts:
#	build.gradle
2016-09-26 17:32:34 +02:00
Andy Scherzinger 763df858de fix setup.xml after branch pulls 2016-09-26 17:29:42 +02:00
Andy Scherzinger 76cb95cd07 Merge branch 'dismissDialogFragment' of https://github.com/nextcloud/android into beta 2016-09-26 17:25:10 +02:00
Andy Scherzinger 31a120ea9a Merge branch 'build24' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	build.gradle
#	res/values/setup.xml
#	src/com/owncloud/android/utils/FileStorageUtils.java
2016-09-26 17:23:27 +02:00
Andy Scherzinger a349d6934d Merge branch 'master' of https://github.com/nextcloud/android into beta
# Conflicts:
#	wait_for_emulator.sh
2016-09-26 17:19:37 +02:00
Andy Scherzinger 7e964795b5 fix android-lib reference 2016-09-26 16:40:38 +02:00
Andy Scherzinger 723334a1c1 fixes 2016-09-26 16:40:38 +02:00
David A. Velasco 5a37719111 Fix crash opening or sending files in Android 7
# Conflicts:
#	res/values/setup.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-09-26 16:40:38 +02:00
Andy Scherzinger d8d803ab8c Revert "reactive instrumented demo test"
This reverts commit f7195a0192.
2016-09-26 16:40:38 +02:00
Andy Scherzinger 313fde0bc6 reactive instrumented demo test 2016-09-26 16:40:38 +02:00
Andy Scherzinger d0b691cafb change emulator ready detection again, disable running sample instrumented unit test (failing at the moment)
updated wait_for_emulator.sh for actual travis cookbook revision https://github.com/travis-ci/travis-cookbooks/blob/62039b204699adcdf4b3365fac42d81246cb57fe/ci_environment/android-sdk/files/default/android-wait-for-emulator

try emulator 24

bump support lib to 24.2.0
2016-09-26 16:40:38 +02:00
Andy Scherzinger ed04da30dc bump Android SDK Build-Tools to 24.0.2 2016-09-26 16:40:00 +02:00
Andy Scherzinger 0e45eed32a no pre-dexing on travis (performance) 2016-09-26 16:40:00 +02:00
Andy Scherzinger 979b14bfae Update build tools to 24.0.1, java7 compat 2016-09-26 16:40:00 +02:00
Andy Scherzinger 0fa105e781 rebase/merge 2016-09-26 16:40:00 +02:00
Andy Scherzinger b3c8abd0d8 lib1.0.4 2016-09-26 16:40:00 +02:00
Andy Scherzinger 5c095bb00b Revert "added jcenter repo"
This reverts commit b54e954c96014babd176d8f50ba6b7a9e44dea38.
2016-09-26 16:40:00 +02:00
Andy Scherzinger bad15df75d link to v24 version of the Nc lib 2016-09-26 16:40:00 +02:00
Andy Scherzinger dfeae52619 added jcenter repo 2016-09-26 16:40:00 +02:00
Andy Scherzinger 795d695300 bump to v24 incl. toolchain, jdk8 etc. 2016-09-26 16:40:00 +02:00
Andy Scherzinger 200fe5ab64 fix crash in dismissLoadingDialog #279 2016-09-26 16:30:53 +02:00
Andy Scherzinger dd5894d690 fix crash in dismissLoadingDialog #279 2016-09-26 16:28:24 +02:00
tobiasKaminsky 1c1c464165 update 2016-09-22 20:15:43 +02:00
tobiasKaminsky 655324e179 Merge remote-tracking branch 'origin/beta' into beta
# Conflicts:
#	AndroidManifest.xml
#	CHANGELOG.md
#	res/values/strings.xml
2016-09-21 19:43:18 +02:00
tobiasKaminsky 5b0aa52d93 Merge remote-tracking branch 'remotes/origin/whatsNew' into beta 2016-09-21 19:40:51 +02:00
tobiasKaminsky a4a2cb9721 removed 5. screen
avoid duplicate whats new
2016-09-21 19:40:27 +02:00
tobiasKaminsky 881063e9fb Merge remote-tracking branch 'remotes/origin/whatsNew' into beta 2016-09-21 19:35:40 +02:00
tobiasKaminsky 63fe98d8ac Merge remote-tracking branch 'origin/whatsNew' into whatsNew 2016-09-21 17:29:09 +02:00
Andy Scherzinger 08b4e9c709 Merge branch 'logSendCrash' of https://github.com/nextcloud/android into beta 2016-09-21 12:01:59 +02:00
Andy Scherzinger 41861a8d1f IndexOutOfBounds check #283 2016-09-21 11:56:38 +02:00
Andy Scherzinger 5feacb3b69 2016-09-21 2016-09-21 01:58:18 +02:00
Andy Scherzinger 6325d56864 Merge branch 'LukeOwncloud-patch-remove-failed' of https://github.com/nextcloud/android into beta 2016-09-21 01:56:01 +02:00
Andy Scherzinger a811f49f58 Merge branch 'magicUrl' of https://github.com/nextcloud/android into beta 2016-09-21 01:54:59 +02:00
Andy Scherzinger bd883c53d2 Merge branch 'dismissDialogFragment' of https://github.com/nextcloud/android into beta 2016-09-21 01:54:11 +02:00
Andy Scherzinger fb71c3e1ce Merge branch 'whatsNew' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	res/layout/whats_new_activity.xml
#	res/layout/whats_new_element.xml
#	res/values/strings.xml
#	src/com/owncloud/android/MainApp.java
#	src/com/owncloud/android/ui/activity/WhatsNewActivity.java
2016-09-21 01:33:08 +02:00
Andy Scherzinger b415a9a598 Merge branch 'master' of https://github.com/nextcloud/android into beta
# Conflicts:
#	.travis.yml
#	AndroidManifest.xml
#	CHANGELOG.md
2016-09-21 01:30:09 +02:00
Andy Scherzinger b5ee31bad3 removed unnecessary else part 2016-09-21 00:20:41 +02:00
LukeOwncloud af5f521454 return false if remove failed
if OCFile is null --> cannot delete ==> return false.
2016-09-21 00:20:41 +02:00
Andy Scherzinger 0761bff179 fix crash in dismissLoadingDialog #279 2016-09-21 00:19:35 +02:00
Andy Scherzinger 2a5d777219 code review changes 2016-09-21 00:18:17 +02:00
Andy Scherzinger 6244502d87 downgrade to only support cloud://login 2016-09-21 00:18:17 +02:00
Andy Scherzinger 4cb527795c move connection (re) init from start to onResume and restore server checked flag 2016-09-21 00:18:17 +02:00
Andy Scherzinger a4361a447c wip server check 2016-09-21 00:18:17 +02:00
Andy Scherzinger 4b77f648dd focus check 2016-09-21 00:18:17 +02:00
Andy Scherzinger 0a224c442b fix url mapping 2016-09-21 00:18:17 +02:00
Andy Scherzinger 17d5683d98 MagicUrls for Login + Unit tests for the parser 2016-09-21 00:18:17 +02:00
Andy Scherzinger 8bdb9d72a9 resized font sizes 2016-09-21 00:11:24 +02:00
Andy Scherzinger 31ffb0a2a1 fixed arrow icon color 2016-09-21 00:11:24 +02:00
Andy Scherzinger 8d49161b39 fixed arrow color, images and logos 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 9281a3acae Code review fixes 2016-09-21 00:11:24 +02:00
Bartosz Przybylski e0aa06cbc9 tabs to spaces 2016-09-21 00:11:24 +02:00
Bartosz Przybylski be9f000aad tabs to spaces 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 6094f5fcb7 Show whats new only once on first run 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 0f30fa0bc5 Change the way of displaying progress indicator 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 3b665c28e3 Use ViewPager instead of custom dragging mechanism 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 55f41a12d7 Add parameter to allow showing whats new in beta 2016-09-21 00:11:24 +02:00
Andy Scherzinger b980363b7c use the standard dp margin & padding references 2016-09-21 00:11:24 +02:00
Andy Scherzinger 1f7df2fd9b rework icons to not break ANT builds 2016-09-21 00:11:24 +02:00
Bartosz Przybylski c02370145e Till java7 won't be used on ant project use old diamond notation 2016-09-21 00:11:24 +02:00
Andy Scherzinger ee4ae35eb9 small design changes, adding arrow as vector (thus bumping gradle plugin to 1.5.0!), changing check icon and adding circle background for finish action 2016-09-21 00:11:24 +02:00
Andy Scherzinger 33bcc4ba1c changes indicator to more material like style 2016-09-21 00:11:24 +02:00
Andy Scherzinger 67c5b57cfd added iOS images for the whats new screens 2016-09-21 00:11:24 +02:00
Bartosz Przybylski a5e2d7d239 Use global method to get version code 2016-09-21 00:11:24 +02:00
Bartosz Przybylski c4406f4141 Show done button when only single news is available 2016-09-21 00:11:24 +02:00
Bartosz Przybylski e8309e2431 Insert type in diamond operator, but this is just a hack to support old comiler 2016-09-21 00:11:24 +02:00
Bartosz Przybylski c1ca971823 Implement left/right swipe in whats new view 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 5bb9620aa1 Another small cleanup 2016-09-21 00:11:24 +02:00
Bartosz Przybylski 8c2cfe9ab4 Remove testing stuff 2016-09-21 00:11:24 +02:00
Bartosz Przybylski a962e2aca5 Put FeatureList to separate file for cleaner code 2016-09-21 00:11:24 +02:00
Bartosz Przybylski c5b8bbe0f4 Small code cleanup in WhatsNewActivity 2016-09-21 00:11:24 +02:00
Bartosz Przybylski e2ad7cbe2b Add Whats new activity and embed it into project 2016-09-21 00:11:24 +02:00
tobiasKaminsky 60aeedd80e Merge remote-tracking branch 'remotes/origin/whatsNew' into beta 2016-09-18 17:55:06 +02:00
Andy Scherzinger e8d7fd0953 resized font sizes 2016-09-18 17:50:40 +02:00
Andy Scherzinger 18222b2467 fixed arrow icon color 2016-09-18 17:50:40 +02:00
Andy Scherzinger 84d8695677 fixed arrow color, images and logos 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 24c2dd49ff Code review fixes 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 5980af1caa tabs to spaces 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 91b9ccdb19 tabs to spaces 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 457a5d934a Show whats new only once on first run 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 3d86e32eb5 Change the way of displaying progress indicator 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 48db65b178 Use ViewPager instead of custom dragging mechanism 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 6854dc5b02 Add parameter to allow showing whats new in beta 2016-09-18 17:50:40 +02:00
Andy Scherzinger c6f970b52a use the standard dp margin & padding references 2016-09-18 17:50:40 +02:00
Andy Scherzinger b2171f2e8f rework icons to not break ANT builds 2016-09-18 17:50:40 +02:00
Bartosz Przybylski cc757729bd Till java7 won't be used on ant project use old diamond notation 2016-09-18 17:50:40 +02:00
Andy Scherzinger f6c5c63c0d small design changes, adding arrow as vector (thus bumping gradle plugin to 1.5.0!), changing check icon and adding circle background for finish action 2016-09-18 17:50:40 +02:00
Andy Scherzinger 871607b89c changes indicator to more material like style 2016-09-18 17:50:40 +02:00
Andy Scherzinger 6b462c9895 added iOS images for the whats new screens 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 1c258946c2 Use global method to get version code 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 97acb9d4e4 Show done button when only single news is available 2016-09-18 17:50:40 +02:00
Bartosz Przybylski e410a6f7ac Insert type in diamond operator, but this is just a hack to support old comiler 2016-09-18 17:50:40 +02:00
Bartosz Przybylski f33e985b84 Implement left/right swipe in whats new view 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 2bf7b49774 Another small cleanup 2016-09-18 17:50:40 +02:00
Bartosz Przybylski c65d78ff20 Remove testing stuff 2016-09-18 17:50:40 +02:00
Bartosz Przybylski c91b7f7442 Put FeatureList to separate file for cleaner code 2016-09-18 17:50:40 +02:00
Bartosz Przybylski a6c74539f8 Small code cleanup in WhatsNewActivity 2016-09-18 17:50:40 +02:00
Bartosz Przybylski 9e85786f00 Add Whats new activity and embed it into project 2016-09-18 17:50:40 +02:00
tobiasKaminsky 2d0c73fef1 Merge remote-tracking branch 'remotes/origin/whatsNew' into beta 2016-09-18 17:49:24 +02:00
tobiasKaminsky c549385e96 prevent showing what's new screen twice 2016-09-18 14:48:48 +02:00
tobiasKaminsky ffbe691085 Merge remote-tracking branch 'origin/beta' into beta 2016-09-18 09:12:41 +02:00
tobiasKaminsky 6c1c723d50 Merge remote-tracking branch 'remotes/origin/master' into beta 2016-09-18 09:11:38 +02:00
Andy Scherzinger d92ddc061c Merge branch 'master' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	CHANGELOG.md
2016-09-18 01:28:36 +02:00
Andy Scherzinger ea86870d7f Merge branch 'whatsNew' of https://github.com/nextcloud/android into beta 2016-09-15 15:19:52 +02:00
Andy Scherzinger 1084f97927 fixed arrow icon color 2016-09-15 15:19:20 +02:00
Andy Scherzinger 3504a08163 Merge branch 'whatsNew' of https://github.com/nextcloud/android into beta
# Conflicts:
#	res/drawable-hdpi/whats_new_accounts.png
2016-09-15 15:12:16 +02:00
Andy Scherzinger ddf2e9f717 fixed arrow color, images and logos 2016-09-15 15:08:43 +02:00
Andy Scherzinger e6bc6591d8 Merge branch 'whatsNew' of https://github.com/nextcloud/android into beta
# Conflicts:
#	res/values/strings.xml
#	src/com/owncloud/android/MainApp.java
2016-09-15 14:37:56 +02:00
Andy Scherzinger 4cda211590 fixed logos 2016-09-15 13:30:28 +02:00
Bartosz Przybylski 8a8c82301d Code review fixes 2016-09-15 11:35:43 +02:00
Bartosz Przybylski b78ce68baf tabs to spaces 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 814d147ad4 tabs to spaces 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 287089922b Show whats new only once on first run 2016-09-15 11:35:43 +02:00
Bartosz Przybylski e4552b6da6 Change the way of displaying progress indicator 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 29079e5fd2 Use ViewPager instead of custom dragging mechanism 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 1a57ddef9a Add parameter to allow showing whats new in beta 2016-09-15 11:35:43 +02:00
Andy Scherzinger 0eae7c59a9 use the standard dp margin & padding references 2016-09-15 11:35:43 +02:00
Andy Scherzinger 9180481515 rework icons to not break ANT builds 2016-09-15 11:35:43 +02:00
Bartosz Przybylski b1f8f084b8 Till java7 won't be used on ant project use old diamond notation 2016-09-15 11:35:43 +02:00
Andy Scherzinger b2f816eb31 small design changes, adding arrow as vector (thus bumping gradle plugin to 1.5.0!), changing check icon and adding circle background for finish action 2016-09-15 11:35:43 +02:00
Andy Scherzinger a34488e47e changes indicator to more material like style 2016-09-15 11:35:43 +02:00
Andy Scherzinger afdfc62ee7 added iOS images for the whats new screens 2016-09-15 11:35:43 +02:00
Bartosz Przybylski b8d796c19e Use global method to get version code 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 255bcb1a99 Show done button when only single news is available 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 57302403b6 Insert type in diamond operator, but this is just a hack to support old comiler 2016-09-15 11:35:43 +02:00
Bartosz Przybylski ba44bfbe02 Implement left/right swipe in whats new view 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 6bf4a37019 Another small cleanup 2016-09-15 11:35:43 +02:00
Bartosz Przybylski afce75826e Remove testing stuff 2016-09-15 11:35:43 +02:00
Bartosz Przybylski 30ceace544 Put FeatureList to separate file for cleaner code 2016-09-15 11:35:43 +02:00
Bartosz Przybylski f3417a1f3b Small code cleanup in WhatsNewActivity 2016-09-15 11:35:43 +02:00
Bartosz Przybylski c6f306af49 Add Whats new activity and embed it into project 2016-09-15 11:35:43 +02:00
Andy Scherzinger aab9c087bf Merge branch 'master' of https://github.com/nextcloud/android into beta
# Conflicts:
#	CHANGELOG.md
#	res/xml/preferences.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-09-12 22:39:16 +02:00
Andy Scherzinger d584f806f0 Merge branch '130rcBugfix' of https://github.com/nextcloud/android into beta 2016-09-08 13:38:45 +02:00
Andy Scherzinger 0b1b893740 Merge branch '130rcBugfix' of https://github.com/nextcloud/android into beta 2016-09-08 13:35:30 +02:00
Andy Scherzinger 7c9e3dab4f Merge branch '130rcBugfix' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	res/layout/participate_layout.xml
#	res/values/strings.xml
2016-09-08 10:36:32 +02:00
tobiasKaminsky a6b46eef90 update changelod 2016-09-07 21:49:44 +02:00
tobiasKaminsky d51825c98d update to rc2 2016-09-07 21:44:18 +02:00
Andy Scherzinger 598458f759 bugfix incorrect merge 2016-09-07 19:18:40 +02:00
Andy Scherzinger 3de7eb134d updated CHANGELOG.md 2016-09-07 18:50:15 +02:00
Andy Scherzinger e89f2d5808 Merge branch '130rcBugfix' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
2016-09-07 18:47:31 +02:00
Andy Scherzinger 5136870879 compile fixes after merge 2016-09-07 18:43:30 +02:00
Andy Scherzinger 06f5ffe296 Merge branch 'davAppIntegration' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	CHANGELOG.md
#	build.gradle
#	oc_jb_workaround/build.gradle
#	res/layout/participate_layout.xml
#	res/layout/share_file_layout.xml
#	res/layout/upload_files_layout.xml
#	res/menu/drawer_menu.xml
#	res/values/attrs.xml
#	res/values/setup.xml
#	res/values/strings.xml
#	res/xml/preferences.xml
#	src/com/owncloud/android/ui/activity/ParticipateActivity.java
#	src/com/owncloud/android/ui/activity/Preferences.java
#	src/com/owncloud/android/ui/activity/UploadFilesActivity.java
#	src/com/owncloud/android/ui/fragment/ShareFileFragment.java
#	src/com/owncloud/android/ui/helpers/FileOperationsHelper.java
2016-09-07 18:38:42 +02:00
Andy Scherzinger f3a41dc260 consistent wording for upload options --> folder 2016-09-07 18:29:14 +02:00
Andy Scherzinger 65fa8c4c20 show toast if davdroid sync has been setup successfully 2016-09-07 17:52:12 +02:00
Andy Scherzinger 91919d9246 move setup call to settings screen 2016-09-07 17:37:33 +02:00
Andy Scherzinger eb267862b7 wip davdroid login launch 2016-09-07 15:46:47 +02:00
Andy Scherzinger dcb0bd26f3 improve layouting and texts for upload behavior #26 2016-09-07 15:21:24 +02:00
Andy Scherzinger e6b99c96e7 bugfix layouting and issue reporting button click 2016-09-07 15:08:02 +02:00
Andy Scherzinger efe9692ee4 1.3.0 RC2 versioning 2016-09-07 14:46:59 +02:00
Andy Scherzinger dba4dd513a Bugfix report GH issue button click 2016-09-07 14:46:44 +02:00
Andy Scherzinger 92b58b654e Merge branch 'mixSortByDate' of https://github.com/nextcloud/android into beta 2016-09-04 21:41:48 +02:00
Andy Scherzinger 4198991338 Merge branch 'participate' of https://github.com/nextcloud/android into beta
# Conflicts:
#	build.gradle
#	res/layout/participate_layout.xml
#	res/menu/drawer_menu.xml
#	res/values/setup.xml
#	src/com/owncloud/android/ui/activity/ParticipateActivity.java
#	src/com/owncloud/android/utils/ConnectivityUtils.java
2016-09-04 21:31:37 +02:00
Andy Scherzinger a80b2216ce don't show the currently active account in the account chooser (since it is already active and displayer in the drawer header)
- don't show information twice
2016-09-04 21:20:35 +02:00
Andy Scherzinger 6102f78552 fix for triggering the main drawer menu items from "participate", changed participate icon and checkable behavior, don't show settings etc when showing accounts 2016-09-04 21:12:03 +02:00
Andy Scherzinger 330883cc81 participate icon 2016-09-04 20:35:52 +02:00
Andy Scherzinger 0b2162d70c slight whitespace optimizations in accordance with material design guidelines 2016-09-04 20:26:11 +02:00
tobiasKaminsky 013ddc4bf1 fix wrong new line 2016-09-04 20:06:07 +02:00
tobiasKaminsky c09979389d links are now extracted to setup.xml 2016-09-04 20:06:07 +02:00
tobiasKaminsky 13e37493c9 wip 2016-09-04 20:06:07 +02:00
tobiasKaminsky fc1ba3c384 Merge remote-tracking branch 'remotes/origin/participate' into beta 2016-09-04 15:37:27 +02:00
tobiasKaminsky 19b65e6afd fix wrong new line 2016-09-04 15:36:33 +02:00
tobiasKaminsky 716d1554b5 Merge remote-tracking branch 'remotes/origin/instant_upload_multi_account' into beta 2016-09-04 12:00:46 +02:00
tobiasKaminsky 83b8c5cc0a if no account is set the current account is used for instant upload 2016-09-04 11:40:24 +02:00
tobiasKaminsky fd428095d7 Merge remote-tracking branch 'origin/instant_upload_multi_account' into instant_upload_multi_account 2016-09-04 11:21:49 +02:00
tobiasKaminsky f83ecc83c8 Merge remote-tracking branch 'origin/beta' into beta 2016-09-04 11:08:36 +02:00
tobiasKaminsky b64569db57 Merge remote-tracking branch 'remotes/origin/mixSortByDate' into beta 2016-09-04 11:08:16 +02:00
tobiasKaminsky c56cd56645 Merge remote-tracking branch 'remotes/origin/pinchZoom' into beta 2016-09-04 11:08:04 +02:00
tobiasKaminsky 604eccb185 Merge remote-tracking branch 'remotes/origin/resizeCache' into beta 2016-09-04 11:04:49 +02:00
tobiasKaminsky 5fde328016 Merge remote-tracking branch 'remotes/origin/fixPublicLink' into beta 2016-09-04 11:01:10 +02:00
tobiasKaminsky 8bc3935130 Merge remote-tracking branch 'remotes/origin/descendIntoFolder' into beta 2016-09-04 11:00:58 +02:00
tobiasKaminsky 80e610ea41 Merge remote-tracking branch 'remotes/origin/participate' into beta 2016-09-04 11:00:36 +02:00
tobiasKaminsky caba790774 Merge remote-tracking branch 'remotes/origin/filesDrop' into beta 2016-09-04 11:00:04 +02:00
tobiasKaminsky 1161c3f19e links are now extracted to setup.xml 2016-09-04 10:52:32 +02:00
tobiasKaminsky 4be92d4650 wip 2016-09-03 23:13:34 +02:00
Andy Scherzinger 411022175c sizeScale 1 for MB, code removed for unsupported legacy Android versions
# Conflicts:
#	src/com/owncloud/android/utils/DisplayUtils.java
2016-09-03 17:56:49 +02:00
tobiasKaminsky f5218d53e0 update 2016-09-03 12:59:06 +02:00
tobiasKaminsky 2ba7087953 fix bug: resized image was always used indepentent of download state 2016-09-03 12:14:00 +02:00
tobiasKaminsky 911e4072f4 fix wrong merge resolve: thumbnails are now generated during upload again 2016-09-03 09:12:49 +02:00
tobiasKaminsky 9809e88ec0 Merge remote-tracking branch 'origin/beta' into beta 2016-09-03 07:55:16 +02:00
tobiasKaminsky 0c7c92c40b Merge remote-tracking branch 'remotes/origin/quotaDisplay' into beta 2016-09-03 07:49:56 +02:00
Andy Scherzinger bc2c96b284 organize imports 2016-09-01 16:26:39 +02:00
Andy Scherzinger 2da70e914c cleanup 2016-09-01 16:26:39 +02:00
Andy Scherzinger 3baa5ab208 CR 2016-09-01 16:26:39 +02:00
tobiasKaminsky 6044010ffe show filenames only if column size < 4 2016-09-01 16:26:39 +02:00
tobiasKaminsky 56e3129f52 use local context 2016-09-01 16:26:39 +02:00
tobiasKaminsky 580ab151f1 changes due to CR 2016-09-01 16:26:39 +02:00
tobiasKaminsky 2ccd0167f3 changes according to CR 2016-09-01 16:26:39 +02:00
tobiasKaminsky 01961b4db6 save gridColumns on start/stop 2016-09-01 16:26:39 +02:00
tobiasKaminsky db37d4f680 after pinching grid is updated correctly 2016-09-01 16:26:39 +02:00
tobiasKaminsky b44178b0ad wip 2016-09-01 16:26:39 +02:00
Andy Scherzinger b1e364efb6 fixed copyright 2016-09-01 16:20:02 +02:00
Andy Scherzinger 48e90501c0 code cleanup 2016-09-01 16:20:02 +02:00
Andy Scherzinger 0b87d80f08 beatified info rendereing for active account/path for uploads 2016-09-01 16:20:02 +02:00
Andy Scherzinger 54d1c42ea7 fix AccountUtils calls 2016-09-01 16:20:02 +02:00
Andy Scherzinger 7e84c2a934 CR changes 2016-09-01 16:20:02 +02:00
Andy Scherzinger 8ae25feaee cleanup code for preference loading 2016-09-01 16:20:02 +02:00
Luke Owncloud c99ef87a5f configure account for instant upload 2016-09-01 16:20:02 +02:00
Andy Scherzinger 72c96f7054 minor cleanups after rebase 2016-09-01 16:15:45 +02:00
tobiasKaminsky b4e068af38 fix wrong cast of cache size 2016-09-01 16:15:45 +02:00
tobiasKaminsky 85ae0ef010 show cache size in mb 2016-09-01 16:15:45 +02:00
tobiasKaminsky 6e4913ade8 fixed according to andys comments 2016-09-01 16:15:45 +02:00
tobiasKaminsky 1787cd4ea2 cache size is read from cache on preference start 2016-09-01 16:15:45 +02:00
tobiasKaminsky a731e87267 cache resize 2016-09-01 16:15:45 +02:00
tobiasKaminsky 007f9a3696 add preference for cache size 2016-09-01 16:15:45 +02:00
tobiasKaminsky 08bddb3dcf descend into folder after creating it in uploader 2016-09-01 16:12:59 +02:00
Andy Scherzinger a638f3c31b CHANGELOG.md 2016-09-01 14:56:53 +02:00
Andy Scherzinger d2c6f0c0a7 Merge branch 'fixRemoteFolderSize' of https://github.com/nextcloud/android into beta 2016-09-01 14:55:52 +02:00
tobiasKaminsky 6e7645b4f4 mix folders and files on sort by date 2016-09-01 11:32:01 +02:00
Andy Scherzinger 2d05f45a6d minor formattings 2016-09-01 11:26:09 +02:00
Andy Scherzinger b64e41f1cb hide file listing switch visibility fix when share link gets deactivated 2016-09-01 11:26:09 +02:00
tobiasKaminsky 738c491800 wip 2016-09-01 11:26:09 +02:00
tobiasKaminsky fe13a0ef23 wip 2016-09-01 11:26:09 +02:00
tobiasKaminsky 3ab681415b wip 2016-09-01 11:26:09 +02:00
tobiasKaminsky bf213bc11f wip 2016-09-01 11:26:09 +02:00
tobiasKaminsky 946d2a1d5e wip 2016-09-01 11:26:09 +02:00
Andy Scherzinger a44441bdda Merge branch 'quotaDisplay' of https://github.com/nextcloud/android into beta 2016-09-01 10:12:41 +02:00
Andy Scherzinger c6d71c4c14 CHANGELOG.md 2016-08-31 19:35:43 +02:00
Andy Scherzinger fc06e1b91e Merge branch 'build24' of https://github.com/nextcloud/android into beta
# Conflicts:
#	AndroidManifest.xml
#	res/values/setup.xml
#	src/com/owncloud/android/utils/FileStorageUtils.java
2016-08-31 19:34:30 +02:00
Andy Scherzinger e73f9970ee fixes 2016-08-31 19:27:38 +02:00
David A. Velasco 4c4d6948cc Fix crash opening or sending files in Android 7
# Conflicts:
#	res/values/setup.xml
#	src/com/owncloud/android/ui/activity/Preferences.java
2016-08-31 19:23:42 +02:00
Andy Scherzinger 054717cc65 Merge branch 'quotaDisplay' of https://github.com/nextcloud/android into beta
# Conflicts:
#	build.gradle
2016-08-31 19:18:40 +02:00
Andy Scherzinger 58652a5522 Revert "reactive instrumented demo test"
This reverts commit f7195a0192.
2016-08-30 23:29:49 +02:00
Andy Scherzinger f7195a0192 reactive instrumented demo test 2016-08-30 19:12:29 +02:00
Andy Scherzinger 6a6fb1dab7 Merge branch 'build24' of https://github.com/nextcloud/android into beta 2016-08-30 18:46:58 +02:00
Andy Scherzinger 70c1cef829 atm we only need the emulator version since it is also the targeted version 2016-08-30 18:25:34 +02:00
Andy Scherzinger 753399fdc7 Updated CHANGELOG.md 2016-08-30 18:20:46 +02:00
Andy Scherzinger 0a463042e5 Merge branch 'build24' of https://github.com/nextcloud/android into beta
# Conflicts:
#	build.gradle
2016-08-30 18:15:57 +02:00
Andy Scherzinger 30e5ad14ae Merge branch 'fixEmptyLocalUploadFolder' of https://github.com/nextcloud/android into beta
# Conflicts:
#	build.gradle
#	src/com/owncloud/android/MainApp.java
#	src/com/owncloud/android/ui/activity/FileDisplayActivity.java
2016-08-30 18:06:05 +02:00
Andy Scherzinger 1b7ffa00bf bugfix showing empty local folders as empty and not showing the parent folder in an empty folder 2016-08-30 17:56:28 +02:00
Andy Scherzinger f606d14b6d change emulator ready detection again, disable running sample instrumented unit test (failing at the moment)
updated wait_for_emulator.sh for actual travis cookbook revision https://github.com/travis-ci/travis-cookbooks/blob/62039b204699adcdf4b3365fac42d81246cb57fe/ci_environment/android-sdk/files/default/android-wait-for-emulator

try emulator 24

bump support lib to 24.2.0
2016-08-30 15:16:47 +02:00
Andy Scherzinger 644a9ee978 bump Android SDK Build-Tools to 24.0.2 2016-08-29 17:58:55 +02:00
Andy Scherzinger 0b88b6e144 changed matrix variables to better support different target and emulator API-level 2016-08-18 15:53:46 +02:00
Andy Scherzinger 99434be7c4 no pre-dexing on travis (performance) 2016-08-18 15:53:46 +02:00
Andy Scherzinger 68c8ce6010 try v23 emulator 2016-08-18 15:53:46 +02:00
Andy Scherzinger 9fe0c6f364 Update build tools to 24.0.1, java7 compat 2016-08-18 15:53:46 +02:00
Andy Scherzinger 3a4d516c24 rebase/merge 2016-08-18 15:53:46 +02:00
Andy Scherzinger a724993861 lib1.0.4 2016-08-18 15:53:46 +02:00
Andy Scherzinger 38f0266ecf Revert "added jcenter repo"
This reverts commit b54e954c96014babd176d8f50ba6b7a9e44dea38.
2016-08-18 15:53:46 +02:00
Andy Scherzinger 7a539ef071 link to v24 version of the Nc lib 2016-08-18 15:53:46 +02:00
Andy Scherzinger c4c9fac34a added jcenter repo 2016-08-18 15:53:46 +02:00
Andy Scherzinger 49a125ebd6 bump to v24 incl. toolchain, jdk8 etc. 2016-08-18 15:53:46 +02:00
Andy Scherzinger 649c5cfe0c fixed the background color 2016-08-14 20:26:08 +02:00
Andy Scherzinger beb3abb7f3 CR changes 2016-08-14 20:18:32 +02:00
Andy Scherzinger 32aa5113b5 colorize quota progress bar depending on thresholds met, reformattings 2016-08-14 20:18:32 +02:00
Andy Scherzinger ff7bb22903 minor code refactoring extracting setup code into dedicated methods 2016-08-14 20:18:32 +02:00
Andy Scherzinger c117f1eb60 get and show quota information 2016-08-14 20:18:32 +02:00
Andy Scherzinger 1b1e20bee7 update to Nc Android library 1.0.4 2016-08-14 20:14:52 +02:00
Andy Scherzinger d5f143c4cc view elements fix 2016-08-14 20:14:26 +02:00
Andy Scherzinger 9e3499707c initial quota display implementation 2016-08-14 20:14:26 +02:00
Andy Scherzinger 1b279acca8 initial layout changes for in drawer quota display 2016-08-14 20:14:26 +02:00
tobiasKaminsky 831813fd81 update 2016-08-09 22:04:03 +02:00
tobiasKaminsky 44e91d4d9d fix wrong beta lookup url 2016-08-09 21:11:34 +02:00
tobiasKaminsky 7df332b2dc update 2016-08-08 20:28:02 +02:00
tobiasKaminsky 50a565f11d Merge remote-tracking branch 'remotes/origin/externalSD2' into beta 2016-08-08 20:21:03 +02:00
tobiasKaminsky 430872629d Merge remote-tracking branch 'remotes/origin/updateCopyMove' into beta 2016-08-08 19:53:39 +02:00
tobiasKaminsky 79650fbcb9 Merge remote-tracking branch 'remotes/origin/filesDrop' into beta 2016-08-08 19:52:38 +02:00
tobiasKaminsky 7fb56cd467 Merge remote-tracking branch 'remotes/origin/fixNPEinUploadFile' into beta 2016-08-08 19:45:44 +02:00
tobiasKaminsky a524d9083f Merge remote-tracking branch 'remotes/origin/fixUploadComparator' into beta 2016-08-08 19:45:00 +02:00
tobiasKaminsky e7d190adf4 "move upload" is first default when on first startup 2016-08-08 10:51:41 +02:00
tobiasKaminsky f5e32fb333 move / copy updated 2016-08-08 10:51:41 +02:00
Andy Scherzinger 3d1ba53339 fix chunked upload constructor call 2016-08-08 10:32:49 +02:00
Andy Scherzinger d0857dd009 extract/pre-compile the pattern 2016-08-08 10:32:49 +02:00
Andy Scherzinger 4567ce5496 further CR fixes, fixed comment in layout/migration_layout.xml 2016-08-08 10:32:49 +02:00
Andy Scherzinger 37f99a7fa2 CR, GPLv3 2016-08-08 10:32:49 +02:00
Andy Scherzinger 4feff15973 lib version 1.0.2, organizes imports in FileStorageUtils 2016-08-08 10:32:49 +02:00
Andy Scherzinger 25d7f4149e fixed strings (oC->Nc and ... --> &#8230;) 2016-08-08 10:32:49 +02:00
Andy Scherzinger aa081f0080 temporary gradle link to branch/snapshot of the library until it is merged, so the build works again 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 278da5520a rebase fixes 2016-08-08 10:32:49 +02:00
tobiasKaminsky eba09158c3 use lollipop external storage system 2016-08-08 10:32:49 +02:00
Bartosz Przybylski eaf0265866 Because of multiple underlying implementation of storage mount points introduce a mechanism which is querying multiple solutions and lists them to the user 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 42ca74cbb0 Handle case of migration of empty src directory 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 64eeacb829 Change the way of fetching mounted resources, use system tools and parse results 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 3eea52f5f3 Use progress dialog instead of alert dialog, for better UX 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 3c0087da97 Tabs to spaces 2016-08-08 10:32:49 +02:00
Bartosz Przybylski bb86f57628 Small code cleanups 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 57c93d37c2 Simplify storage selection process 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 5326351378 Add DataStorageUtils to detect connected SD cards 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 52e69cf25b For more reliability delete old files recursively in migration cleanup 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 3a214db461 Fix after rebase 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 54d82af9ff Soften requirement on cleanup step failures 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 23b02079d3 Stop and start logging on migration 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 2f6192a6e5 Code cleanups 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 3f0df0a5c9 Add cleanup and rollback step when migrating. Correctly set progress during migration. 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 7f3543e802 Add more migration stuff. cleanup step is still missing 2016-08-08 10:32:49 +02:00
Bartosz Przybylski 017e68b79c Add unfinished local directories browser for storage target. Add migration activity stub. Adjust some parts of app to prepare it for storage migration 2016-08-08 10:32:49 +02:00
tobiasKaminsky 1e968d6ab1 Prepare preferences and project to use user defined storage path 2016-08-08 10:32:49 +02:00
Andy Scherzinger 20e9b8e94f minor formattings 2016-08-08 10:28:16 +02:00
Andy Scherzinger e71ae2e532 hide file listing switch visibility fix when share link gets deactivated 2016-08-08 10:28:16 +02:00
tobiasKaminsky 45ade381de wip 2016-08-08 10:28:16 +02:00
tobiasKaminsky 30c18fd1ea wip 2016-08-08 10:28:16 +02:00
tobiasKaminsky 65d16da98b wip 2016-08-08 10:28:16 +02:00
tobiasKaminsky 1e6a090810 wip 2016-08-08 10:28:16 +02:00
tobiasKaminsky f402dd9692 wip 2016-08-08 10:28:16 +02:00
tobiasKaminsky f83bf524a8 Merge remote-tracking branch 'remotes/origin/updateCopyMove' into beta 2016-08-08 10:17:31 +02:00
tobiasKaminsky ad2c8fc08e update 2016-08-08 10:11:08 +02:00
tobiasKaminsky 492cf00064 Merge remote-tracking branch 'remotes/origin/fixPublicLink' into beta 2016-08-08 10:09:16 +02:00
tobiasKaminsky e29cfabfe9 allow apk to git 2016-08-04 18:28:54 +02:00
tobiasKaminsky 0b59dd9e2a "move upload" is first default when on first startup 2016-08-04 10:51:55 +02:00
tobiasKaminsky ee17b00288 move / copy updated 2016-08-04 10:51:55 +02:00
tobiasKaminsky 728db354f9 Merge remote-tracking branch 'remotes/origin/resizedImages' into beta 2016-08-03 17:50:50 +02:00
tobiasKaminsky 1df99748ef Merge remote-tracking branch 'remotes/origin/protect_password_field_agains_autocompletion_suggestions' into beta 2016-08-03 17:50:39 +02:00
tobiasKaminsky 452b23cc39 Merge remote-tracking branch 'remotes/origin/meteredWiFi' into beta 2016-08-03 17:50:27 +02:00
tobiasKaminsky 773a8d6a63 Merge remote-tracking branch 'remotes/origin/instant_upload_multi_account' into beta 2016-08-03 17:49:36 +02:00
tobiasKaminsky a2f836bb66 Merge remote-tracking branch 'remotes/origin/filter' into beta 2016-08-03 17:46:17 +02:00
tobiasKaminsky 1aacc2b45f Merge remote-tracking branch 'remotes/origin/filesDrop' into beta 2016-08-03 17:45:00 +02:00
tobiasKaminsky 9562e70450 Merge remote-tracking branch 'remotes/origin/externalSD2' into beta 2016-08-03 17:43:07 +02:00
tobiasKaminsky 7fece371ad Merge remote-tracking branch 'remotes/origin/resumeChunkedUploads' into beta 2016-08-03 17:17:00 +02:00
tobiasKaminsky 94a6c44012 Merge remote-tracking branch 'remotes/origin/uploadWhenCharging' into beta 2016-08-03 17:16:07 +02:00
tobiasKaminsky b4775d52ed update 2016-08-02 22:15:49 +02:00
tobiasKaminsky 37427304fd Merge remote-tracking branch 'remotes/origin/updateCopyMove' into beta 2016-08-02 21:39:33 +02:00
tobiasKaminsky 47edebde38 Merge remote-tracking branch 'origin/beta' into beta 2016-08-02 21:39:12 +02:00
tobiasKaminsky 1ce514972b "move upload" is first default when on first startup 2016-08-02 21:36:11 +02:00
Andy Scherzinger 6b36468d19 fixed copyright 2016-08-02 19:42:08 +02:00
Andy Scherzinger 35e9301a6d code cleanup 2016-08-02 19:42:08 +02:00
Andy Scherzinger d933e88f64 beatified info rendereing for active account/path for uploads 2016-08-02 19:42:08 +02:00
Andy Scherzinger 7549a547de fix AccountUtils calls 2016-08-02 19:41:31 +02:00
Andy Scherzinger 51e02f9591 CR changes 2016-08-02 19:41:31 +02:00
Andy Scherzinger 2d6184ccfc cleanup code for preference loading 2016-08-02 19:41:31 +02:00
Luke Owncloud 4752d2741e configure account for instant upload 2016-08-02 19:41:31 +02:00
Andy Scherzinger ae947a5ca4 minor formattings 2016-08-02 17:55:30 +02:00
Andy Scherzinger 6ab0506c9a hide file listing switch visibility fix when share link gets deactivated 2016-08-02 17:18:46 +02:00
Andy Scherzinger 0faa786b2e hide file listing switch visibility fix when share link gets deactivated 2016-08-02 17:17:20 +02:00
tobiasKaminsky 824be9278c wip 2016-08-02 15:44:18 +02:00
tobiasKaminsky aa00ad74b2 wip 2016-08-02 15:44:18 +02:00
tobiasKaminsky c1e2b2dee5 wip 2016-08-02 15:44:18 +02:00
tobiasKaminsky 229ff7c38b wip 2016-08-02 15:44:18 +02:00
tobiasKaminsky e78b0fb447 wip 2016-08-02 15:44:18 +02:00
Andy Scherzinger 956cfa5d7b proper show hide during drawer open/close, also for filter-menu-item 2016-08-02 15:28:44 +02:00
Andy Scherzinger 70abde93de GPLv3 2016-08-02 15:28:44 +02:00
Andy Scherzinger 69b368e111 hide non-primary action menu items in overflow menu 2016-08-02 15:28:44 +02:00
Andy Scherzinger 3019c540a1 added description and went for ifRoom 2016-08-02 15:28:44 +02:00
Andy Scherzinger eef9e38065 fix UI behavior for filtering in upload view 2016-08-02 15:28:44 +02:00
Andy Scherzinger 422d432712 fixed license version 2016-08-02 15:28:44 +02:00
Andy Scherzinger 74e117191e correct search view UI-behavior 2016-08-02 15:28:44 +02:00
tobiasKaminsky 7e6162815f filter for oc file list and local file list 2016-08-02 15:28:44 +02:00
Andy Scherzinger 984d0fe93c fixed parameter order 2016-08-02 11:50:02 +02:00
Andy Scherzinger 4bb1071e1a fix chunked upload constructor call 2016-08-02 11:35:51 +02:00
Andy Scherzinger 2769d9389a extract/pre-compile the pattern 2016-08-02 11:18:49 +02:00
Andy Scherzinger 6417c93517 further CR fixes, fixed comment in layout/migration_layout.xml 2016-08-02 11:12:25 +02:00
Andy Scherzinger 4f0b0b9116 CR, GPLv3 2016-08-02 10:59:31 +02:00
Andy Scherzinger 39745e49e7 lib version 1.0.2, organizes imports in FileStorageUtils 2016-08-02 10:37:35 +02:00
Andy Scherzinger cfb25da11f fixed strings (oC->Nc and ... --> &#8230;) 2016-08-02 10:34:26 +02:00
Andy Scherzinger b57414a759 temporary gradle link to branch/snapshot of the library until it is merged, so the build works again 2016-08-02 10:34:26 +02:00
Bartosz Przybylski e884640785 rebase fixes 2016-08-02 10:34:26 +02:00
tobiasKaminsky 351905fc48 use lollipop external storage system 2016-08-02 10:34:26 +02:00
Bartosz Przybylski 648d3f5292 Because of multiple underlying implementation of storage mount points introduce a mechanism which is querying multiple solutions and lists them to the user 2016-08-02 10:34:26 +02:00
Bartosz Przybylski 845a6b2f68 Handle case of migration of empty src directory 2016-08-02 10:34:26 +02:00
Bartosz Przybylski ebe6c2bca7 Change the way of fetching mounted resources, use system tools and parse results 2016-08-02 10:34:26 +02:00
Bartosz Przybylski 769430b8f0 Use progress dialog instead of alert dialog, for better UX 2016-08-02 10:34:26 +02:00
Bartosz Przybylski 393c9b4072 Tabs to spaces 2016-08-02 10:34:26 +02:00
Bartosz Przybylski ab3d19d29e Small code cleanups 2016-08-02 10:34:26 +02:00
Bartosz Przybylski e94220a906 Simplify storage selection process 2016-08-02 10:34:03 +02:00
Bartosz Przybylski c568af347c Add DataStorageUtils to detect connected SD cards 2016-08-02 10:34:03 +02:00
Bartosz Przybylski 5c1b4ba796 For more reliability delete old files recursively in migration cleanup 2016-08-02 10:34:03 +02:00
Bartosz Przybylski e13ad5ff26 Fix after rebase 2016-08-02 10:34:03 +02:00
Bartosz Przybylski 5166231481 Soften requirement on cleanup step failures 2016-08-02 10:34:03 +02:00
Bartosz Przybylski 25300cc0e9 Stop and start logging on migration 2016-08-02 10:34:03 +02:00
Bartosz Przybylski b637679083 Code cleanups 2016-08-02 10:34:03 +02:00
Bartosz Przybylski c928224b55 Add cleanup and rollback step when migrating. Correctly set progress during migration. 2016-08-02 10:32:41 +02:00
Bartosz Przybylski 83378f60c3 Add more migration stuff. cleanup step is still missing 2016-08-02 10:32:41 +02:00
Bartosz Przybylski 237b26ae79 Add unfinished local directories browser for storage target. Add migration activity stub. Adjust some parts of app to prepare it for storage migration 2016-08-02 10:32:41 +02:00
tobiasKaminsky e393a6db27 Prepare preferences and project to use user defined storage path 2016-08-02 10:32:41 +02:00
tobiasKaminsky df45b5543b Merge remote-tracking branch 'remotes/origin/filter' into beta 2016-08-01 21:57:58 +02:00
tobiasKaminsky 9f86064b81 Merge remote-tracking branch 'origin/resizedImages' into resizedImages 2016-08-01 21:56:21 +02:00
tobiasKaminsky 73da2a1d14 added second parameter to thumbnail generation task 2016-08-01 21:43:18 +02:00
tobiasKaminsky 26683f5c61 added second parameter to thumbnail generation task 2016-08-01 21:42:11 +02:00
tobiasKaminsky 56572a09ef allow apk to be uploaded 2016-08-01 21:18:58 +02:00
Andy Scherzinger 7b58b8c328 update to Nc Android lib 1.0.2 2016-08-01 16:51:42 +02:00
Andy Scherzinger 30b66dcd27 bump Nc Android lib version 2016-08-01 16:25:23 +02:00
tobiasKaminsky 26e0dab381 resume chunked uploads 2016-08-01 16:22:32 +02:00
Andy Scherzinger 93bb169c6c GPLv3 2016-08-01 11:31:37 +02:00
Andy Scherzinger 4e03fb3894 GPLv3 2016-08-01 11:29:08 +02:00
tobiasKaminsky 4d9d895b57 add apks ;) 2016-07-31 13:18:15 +02:00
tobiasKaminsky 9fae39b45f update beta 2016-07-31 12:56:38 +02:00
tobiasKaminsky e2cce3957e fix merging error 2016-07-31 12:55:03 +02:00
tobiasKaminsky 6bdde0e59a Merge remote-tracking branch 'remotes/origin/updateCopyMove' into beta 2016-07-31 12:46:36 +02:00
tobiasKaminsky 1e5a2583df Merge remote-tracking branch 'remotes/origin/NPEonEmptyLocalFolder' into beta 2016-07-31 12:40:02 +02:00
tobiasKaminsky b5c3d07ab3 update changelog 2016-07-31 12:22:25 +02:00
tobiasKaminsky 705d942124 move / copy updated 2016-07-31 12:14:33 +02:00
tobiasKaminsky 40a68482fe Merge remote-tracking branch 'remotes/origin/externalSD2' into beta 2016-07-31 10:27:53 +02:00
tobiasKaminsky 4d27d9c0a9 add only upload when charging 2016-07-30 19:31:03 +02:00
tobiasKaminsky 955cf86f05 update changelog 2016-07-30 19:29:23 +02:00
tobiasKaminsky b1dd34e18c Merge remote-tracking branch 'remotes/origin/uploadWhenCharging' into beta 2016-07-30 18:58:26 +02:00
tobiasKaminsky 2ea5eaca4c finally a beta update :) 2016-07-28 21:42:08 +02:00
tobiasKaminsky a92e749c9f fix sharing for beta 2016-07-28 21:22:47 +02:00
tobiasKaminsky 8a988a9e84 wip 2016-07-28 20:57:26 +02:00
tobiasKaminsky 8d1864d0cf update beta 2016-07-28 20:38:00 +02:00
tobiasKaminsky 4015763df6 Merge remote-tracking branch 'remotes/origin/resumeChunkedUploads' into beta 2016-07-28 20:02:07 +02:00
tobiasKaminsky f720c186c3 Merge remote-tracking branch 'remotes/origin/protect_password_field_agains_autocompletion_suggestions' into beta 2016-07-28 19:57:48 +02:00
tobiasKaminsky 75949fb5ca Merge remote-tracking branch 'remotes/origin/refresh_folders_startup' into beta 2016-07-28 19:55:36 +02:00
tobiasKaminsky 033bc352f4 Merge remote-tracking branch 'remotes/origin/renameInstantUploadPath' into beta 2016-07-28 19:54:55 +02:00
tobiasKaminsky 9e8c3f2192 Merge remote-tracking branch 'remotes/origin/meteredWiFi' into beta 2016-07-28 19:53:48 +02:00
tobiasKaminsky 39cb69737c Merge remote-tracking branch 'remotes/origin/djvu' into beta 2016-07-28 19:53:31 +02:00
tobiasKaminsky 106d02f4ee Merge remote-tracking branch 'remotes/origin/filter' into beta 2016-07-28 19:53:08 +02:00
tobiasKaminsky 6fbfd0c6ce Merge remote-tracking branch 'remotes/origin/resizeCache' into beta 2016-07-28 19:50:58 +02:00
tobiasKaminsky 962f9413bf Merge remote-tracking branch 'remotes/origin/pinchZoom' into beta 2016-07-28 19:49:43 +02:00
tobiasKaminsky 092704a1e1 Merge remote-tracking branch 'remotes/origin/textFile' into beta 2016-07-28 19:49:28 +02:00
tobiasKaminsky 69f0edec74 Merge remote-tracking branch 'remotes/origin/filesDrop' into beta 2016-07-28 19:49:12 +02:00
tobiasKaminsky ae7247b008 Merge remote-tracking branch 'remotes/origin/mixSortByDate' into beta 2016-07-28 19:48:49 +02:00
tobiasKaminsky 08706b4813 Merge remote-tracking branch 'remotes/origin/instant_upload_multi_account' into beta 2016-07-28 19:48:23 +02:00
tobiasKaminsky a9b587b1cd Merge remote-tracking branch 'remotes/origin/resizedImages' into beta 2016-07-28 19:47:39 +02:00
Andy Scherzinger 5b806394b6 reformetted two lines 2016-07-28 19:04:52 +02:00
tobiasKaminsky 5170f029b2 changes due to CR 2016-07-28 19:04:52 +02:00
Andy Scherzinger 999ec8202e textfile --> text file 2016-07-28 19:04:52 +02:00
tobiasKaminsky 658371336e finish 2016-07-28 19:04:52 +02:00
tobiasKaminsky 447c2f9d52 wip 2016-07-28 19:04:52 +02:00
tobiasKaminsky c7dafff817 djvu is not an image 2016-07-28 19:00:30 +02:00
tobiasKaminsky d238c8a7fb resume chunked uploads 2016-07-28 18:29:49 +02:00
Andy Scherzinger 88b49880e1 Changed the delay to execute the runnable in startSyncFolderOperation, adding 350 ms. 2016-07-28 18:03:44 +02:00
David A. Velasco 6cf396f0d4 Add flag to disable suggestions in password field, no matter if visible or not 2016-07-28 18:00:03 +02:00
Andy Scherzinger ac9aedecec hide non-primary action menu items in overflow menu 2016-07-28 17:46:51 +02:00
Andy Scherzinger b535fe2926 added description and went for ifRoom 2016-07-28 17:46:51 +02:00
Andy Scherzinger c8fba79f9f fix UI behavior for filtering in upload view 2016-07-28 17:46:51 +02:00
Andy Scherzinger 8f941939e2 fixed license version 2016-07-28 17:46:51 +02:00
Andy Scherzinger 75d3236fa7 correct search view UI-behavior 2016-07-28 17:46:51 +02:00
tobiasKaminsky 6a3903afbe filter for oc file list and local file list 2016-07-28 17:46:51 +02:00
Andy Scherzinger aeb9ea9871 fixed copyright 2016-07-27 17:31:01 +02:00
Andy Scherzinger 7712e694b1 code cleanup 2016-07-27 17:31:01 +02:00
Andy Scherzinger 04ff966d63 beatified info rendereing for active account/path for uploads 2016-07-27 17:31:01 +02:00
Andy Scherzinger a99032ccf4 fix AccountUtils calls 2016-07-27 17:31:01 +02:00
Andy Scherzinger 953b5c637e CR changes 2016-07-27 17:31:01 +02:00
Andy Scherzinger 2f4aef8fb2 cleanup code for preference loading 2016-07-27 17:31:01 +02:00
Luke Owncloud 53cfb1196d configure account for instant upload 2016-07-27 17:31:01 +02:00
tobiasKaminsky c7555938a5 delay instant upload when metered wifi is used 2016-07-26 19:52:49 +02:00
tobiasKaminsky cf1e7013f4 minor code enhancements 2016-07-23 10:23:54 +02:00
tobiasKaminsky 8258843ae1 Merge remote-tracking branch 'remotes/origin/resizedImages' into resizedImages2 2016-07-23 10:15:50 +02:00
tobiasKaminsky 67baae4441 Merge remote-tracking branch 'remotes/origin/master' into resizedImages2 2016-07-23 10:12:39 +02:00
tobiasKaminsky a5509797bc resized images are now fetched via gallery app 2016-07-23 09:46:59 +02:00
tobiasKaminsky 3ff2d58a25 Merge remote-tracking branch 'remotes/origin/master' into storeResizedImagesOnDeletion 2016-07-21 20:25:31 +02:00
tobiasKaminsky e7e02837e6 update 2016-07-21 20:02:23 +02:00
tobiasKaminsky eaed9886cf Merge remote-tracking branch 'remotes/origin/master' into resizeCache 2016-07-21 19:58:36 +02:00
tobiasKaminsky cb9c6fc8f6 show filenames only if column size < 4 2016-07-21 19:44:22 +02:00
tobiasKaminsky b4136568e5 Merge remote-tracking branch 'remotes/origin/master' into pinchZoom 2016-07-21 19:24:15 +02:00
tobiasKaminsky 8bb465f1e7 wip 2016-07-21 18:26:52 +02:00
tobiasKaminsky 5511c063d6 Merge remote-tracking branch 'remotes/origin/master' into filesDrop 2016-07-21 18:18:05 +02:00
tobiasKaminsky 0e1f66e0e3 wip 2016-07-21 18:17:46 +02:00
tobiasKaminsky 2c71d2b57e wip 2016-07-20 20:18:18 +02:00
tobiasKaminsky a61c4b932c wip 2016-07-18 18:39:59 +02:00
tobiasKaminsky 8b9d6b2f22 Merge remote-tracking branch 'remotes/origin/master' into filesDrop 2016-07-18 18:37:20 +02:00
tobiasKaminsky 87f03c7c17 wip 2016-07-18 17:27:38 +02:00
tobiasKaminsky 6ca77290ec mix folders and files on sort by date 2016-07-17 17:22:42 +02:00
Andy Scherzinger d2a323a970 fix AccountUtils calls 2016-07-09 20:48:17 +02:00
Andy Scherzinger a6ef30cbbd CR changes 2016-07-09 20:23:47 +02:00
Andy Scherzinger 184eaef74f cleanup code for preference loading 2016-07-09 20:23:47 +02:00
Luke Owncloud 27d49da7ea configure account for instant upload 2016-07-09 20:23:46 +02:00
Andy Scherzinger 2ffcb50397 fixed strings (oC->Nc and ... --> &#8230;) 2016-07-03 14:36:17 +02:00
Andy Scherzinger 55d038e801 temporary gradle link to branch/snapshot of the library until it is merged, so the build works again 2016-07-03 14:32:04 +02:00
Bartosz Przybylski 47066401d0 rebase fixes 2016-07-03 00:19:59 +02:00
tobiasKaminsky 3eb7aa3809 use lollipop external storage system 2016-07-03 00:04:43 +02:00
Bartosz Przybylski 1cb345c99f Because of multiple underlying implementation of storage mount points introduce a mechanism which is querying multiple solutions and lists them to the user 2016-07-03 00:03:49 +02:00
Bartosz Przybylski 870b04a390 Handle case of migration of empty src directory 2016-07-03 00:02:31 +02:00
Bartosz Przybylski ec14112d82 Change the way of fetching mounted resources, use system tools and parse results 2016-07-03 00:02:31 +02:00
Bartosz Przybylski b20373d59b Use progress dialog instead of alert dialog, for better UX 2016-07-03 00:02:31 +02:00
Bartosz Przybylski 9745b34290 Tabs to spaces 2016-07-03 00:02:31 +02:00
Bartosz Przybylski b589077669 Small code cleanups 2016-07-03 00:01:07 +02:00
Bartosz Przybylski 56d0517a47 Simplify storage selection process 2016-07-02 23:58:49 +02:00
Bartosz Przybylski ebaf8c6ccf Add DataStorageUtils to detect connected SD cards 2016-07-02 23:48:40 +02:00
Bartosz Przybylski 029c54dc2b For more reliability delete old files recursively in migration cleanup 2016-07-02 23:48:40 +02:00
Bartosz Przybylski 4ab8d0cb35 Fix after rebase 2016-07-02 23:48:40 +02:00
Bartosz Przybylski ab0abea781 Soften requirement on cleanup step failures 2016-07-02 23:48:40 +02:00
Bartosz Przybylski fadbd7629d Stop and start logging on migration 2016-07-02 23:48:40 +02:00
Bartosz Przybylski cf2267e196 Code cleanups 2016-07-02 23:48:40 +02:00
Bartosz Przybylski 77c4819e98 Add cleanup and rollback step when migrating. Correctly set progress during migration. 2016-07-02 23:44:54 +02:00
Bartosz Przybylski 76d58fbbc8 Add more migration stuff. cleanup step is still missing 2016-07-02 23:44:54 +02:00
Bartosz Przybylski 7ec2ffc6af Add unfinished local directories browser for storage target. Add migration activity stub. Adjust some parts of app to prepare it for storage migration 2016-07-02 23:44:12 +02:00
tobiasKaminsky c848d4fd3b Prepare preferences and project to use user defined storage path 2016-07-02 23:32:03 +02:00
tobiasKaminsky e3d43e754d wip 2016-06-25 13:38:55 +02:00
tobiasKaminsky bcb55a0e4c Merge remote-tracking branch 'remotes/origin/master' into resizedImages 2016-06-25 13:30:23 +02:00
tobiasKaminsky a9fbec2934 revert wip 2016-05-13 18:17:49 +02:00
tobiasKaminsky 140e923982 update build gradle 2016-05-13 18:16:10 +02:00
tobiasKaminsky 680cf56746 correct indentation 2016-05-13 18:15:12 +02:00
tobiasKaminsky 7162aa65f4 revert exporting FileContentProvider 2016-05-13 18:14:32 +02:00
tobiasKaminsky a6e16a4e71 wip 2016-04-10 18:54:28 +02:00
tobiasKaminsky 93b143a647 use local context 2016-03-30 18:09:04 +02:00
tobiasKaminsky 78aa439660 changes due to CR 2016-03-21 08:25:12 +01:00
tobiasKaminsky a3fd1a0ac6 Merge remote-tracking branch 'remotes/upstream/master' into pinchZoom 2016-03-12 10:33:02 +01:00
tobiasKaminsky 302b253e9a update lib 2016-03-12 09:02:30 +01:00
tobiasKaminsky 7469b5dd96 Merge remote-tracking branch 'remotes/upstream/master' into pinchZoom 2016-03-12 08:56:26 +01:00
tobiasKaminsky e4ce10f180 changes according to CR 2016-03-12 08:54:59 +01:00
tobiasKaminsky 2ecff7c12f save gridColumns on start/stop 2016-02-08 08:58:59 +01:00
tobiasKaminsky 5849a4a93f after pinching grid is updated correctly 2016-01-24 09:46:51 +01:00
tobiasKaminsky 999a2ee86e wip 2016-01-20 20:39:33 +01:00
tobiasKaminsky eac4e49ceb fixed showing thumbnails in local file list (uploader) 2016-01-03 13:36:29 +01:00
tobiasKaminsky 5c9c34f1d2 fix wrong cast of cache size 2015-11-22 10:13:40 +01:00
tobiasKaminsky 0302a62af5 Merge branch 'master' of github.com:owncloud/android into resizeCache 2015-11-14 16:33:22 +01:00
tobiasKaminsky 11774de541 show cache size in mb 2015-11-13 18:33:21 +01:00
tobiasKaminsky 90382c5889 show thumbnail while waiting for resized image 2015-11-13 16:41:05 +01:00
tobiasKaminsky ce841a3c4f Merge remote-tracking branch 'remotes/upstream/master' into resizedImagesMaster 2015-11-05 22:04:57 +01:00
tobiasKaminsky d5ee0ef158 fixed #1244 2015-11-05 21:58:02 +01:00
tobiasKaminsky d06a4b155d updated for future use with later PRs 2015-11-02 22:09:29 +01:00
tobiasKaminsky 3ddb48b647 exported must be set to true 2015-11-02 10:24:01 +01:00
tobiasKaminsky 957484588e fix #1230 2015-10-31 11:03:15 +01:00
tobiasKaminsky cf22541dd5 fixed storing thumbnails by correct imageKey 2015-10-31 08:30:13 +01:00
tobiasKaminsky 61338bbb0c fixed rotating resized image 2015-10-31 08:09:49 +01:00
tobiasKaminsky 890b8df374 fixed according to andys comments 2015-10-17 17:36:31 +02:00
tobiasKaminsky 981ecb91c9 cache size is read from cache on preference start 2015-10-12 20:21:19 +02:00
tobiasKaminsky 39921730b3 cache resize 2015-10-12 08:30:30 +02:00
tobiasKaminsky 641ebef687 add preference for cache size 2015-10-12 07:40:21 +02:00
tobiasKaminsky 788ebbcdab reverted library 2015-07-01 20:13:02 +02:00
tobiasKaminsky ce35d6448e Merge remote-tracking branch 'upstream/develop' into resizedImages 2015-07-01 19:16:42 +02:00
tobiasKaminsky a1bc147849 resized image is loaded instead of full sized image. 2015-05-18 21:01:17 +02:00
131 changed files with 4452 additions and 973 deletions

No files matched your search

+1 -3
View File
@@ -1,6 +1,4 @@
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
@@ -31,4 +29,4 @@ tests/proguard-project.txt
.gradle
.idea
*.iml
build
build
+41 -15
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Nextcloud Android client application
Copyright (C) 2012 Bartek Przybylski
Copyright (C) 2012-2016 ownCloud Inc.
@@ -20,12 +20,12 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.owncloud.android"
android:versionCode="10030199"
android:versionName="1.3.1">
android:versionCode="20161019"
android:versionName="20161019" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
android:targetSdkVersion="24" />
<!-- GET_ACCOUNTS is needed for API < 23.
For API >= 23 results in the addition of CONTACTS group to the list of permissions that may be
@@ -44,6 +44,7 @@
<!-- WRITE_EXTERNAL_STORAGE may be enabled or disabled by the user after installation in
API >= 23; the app needs to handle this -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<!-- Next permissions are always approved in installation time,
the apps needs to do nothing special in runtime -->
@@ -56,15 +57,18 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name=".MainApp"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:label="Nextcloud beta"
android:theme="@style/Theme.ownCloud.Toolbar"
android:manageSpaceActivity="com.owncloud.android.ui.activity.ManageSpaceActivity">
<activity
android:name=".ui.activity.FileDisplayActivity"
android:label="@string/app_name"
android:label="Nextcloud beta"
android:theme="@style/Theme.ownCloud.Toolbar.Drawer">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -78,7 +82,10 @@
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
android:taskAffinity=""
android:excludeFromRecents="true"
android:label="Nextcloud beta"
android:theme="@style/Theme.ownCloud.NoActionBar">
<activity android:name=".ui.activity.LocalDirectorySelectorActivity" />
<activity android:name=".ui.activity.StorageMigrationActivity" />
<intent-filter>
<action android:name="android.intent.action.SEND" />
@@ -103,7 +110,7 @@
android:theme="@style/Theme.ownCloud.Overlay" />
<activity
android:name=".ui.preview.PreviewVideoActivity"
android:label="@string/app_name"
android:label="Nextcloud beta"
android:theme="@style/Theme.ownCloud.Fullscreen" />
<service
@@ -138,8 +145,8 @@
android:syncable="true" />
<provider
android:name=".providers.UsersAndGroupsSearchProvider"
android:authorities="com.nextcloud.android.providers.UsersAndGroupsSearchProvider"
android:name="org.nextcloud.providers.UsersAndGroupsSearchProvider"
android:authorities="org.nextcloud.beta.android.providers.UsersAndGroupsSearchProvider"
android:enabled="true"
android:exported="false"
android:label="@string/search_users_and_groups_hint" />
@@ -156,6 +163,23 @@
</intent-filter>
</provider>
<provider
android:name=".ui.adapter.DiskLruImageCacheFileProvider"
android:authorities="@string/authorityCache"
android:exported="true">
</provider>
<!-- new provider used to generate URIs without file:// scheme (forbidden from Android 7) -->
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="@string/file_provider_authority"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/exposed_filepaths" />
</provider>
<activity
android:name=".authentication.AuthenticatorActivity"
android:exported="true"
@@ -191,11 +215,13 @@
<activity android:name=".ui.activity.ConflictsResolveActivity"/>
<activity android:name=".ui.activity.GenericExplanationActivity"/>
<activity android:name=".ui.activity.ErrorsWhileCopyingHandlerActivity"/>
<activity android:name=".ui.activity.LogHistoryActivity"/>
<activity android:name=".ui.activity.ErrorReportActivity"/>
<activity android:name=".ui.errorhandling.ErrorShowActivity" />
<activity android:name=".ui.activity.UploadListActivity" />
<activity android:name=".ui.activity.WhatsNewActivity" />
<receiver android:name=".files.services.ConnectivityActionReceiver"
android:enabled="true" android:label="ConnectivityActionReceiver">
@@ -233,16 +259,16 @@
<activity
android:name=".ui.activity.CopyToClipboardActivity"
android:icon="@drawable/copy_link"
android:label="@string/copy_link" />
android:label="Copy link" />
<activity
android:name=".ui.activity.FolderPickerActivity"
android:label="@string/app_name" />
android:label="Nextcloud beta" />
<activity
android:name=".ui.activity.UploadPathActivity"
android:label="@string/app_name" />
android:label="Nextcloud beta" />
<activity
android:name=".ui.activity.ShareActivity"
android:label="@string/share_dialog_title"
android:label="Sharing"
android:theme="@style/Theme.ownCloud.Dialog.NoTitle"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize" >
@@ -253,7 +279,7 @@
android:resource="@xml/users_and_groups_searchable"/>
</activity>
<activity android:name=".ui.activity.ManageSpaceActivity"
android:label="@string/manage_space_title"
android:label="Manage space"
android:theme="@style/Theme.ownCloud" />
</application>
+75 -43
View File
@@ -1,54 +1,86 @@
## 1.3.1 (September 20, 2016)
## 2016-10-19
- Fix user info route (https://github.com/nextcloud/android-library/pull/21)
- Begin debug logs when build type is debug #335
- Account switcher optimizations #326
- Fix TimSort #339
- add preference to show hidden files #328
- tune grid view of images #316
- add grid view option when choosing a file from within the app #301
- Move action hard to discover - difference between single/multi selection
- Show move/copy context in toolbar title
- Share file with dictadroid to Nextcloud
- Don't show upload failure notification for already deleted files
## 2016-10-06
- put cursor close in finally block to make sure no resource leak occurrs #306
- change wordings for davdroid integration #293
- added logging to gain information about upload issues
- Sorts favourite files first in list #302
- Add open URL file feature #298
- fix remove failed #241
- Crash when sending non-existing log #284
- Fix NPE in ExpandableUploadListAdapter...setText #290
- change wordings for davdroid integration #293
- Fix NullPointerException in PreviewMediaFragment. #295
## 1.3.0 (September 17, 2016)
## 2016-09-26
- update fix crash in dismissLoadingDialog #279
- fix crash when sending non-existing log #284
- Files drop permission in share viewe
- Display quota if configured/available in navigation drawer
- Resume chunked uploads instead of complete restarts
- Filter remote and local file lists
- Simple integration with DAVdroid for calender and contacts sync
- Mix folders and files on sort by date
- Upload when charging option
- Revamp upload options Move/Copy/Just-Upload
- Text can be selected and shared to Nextcloud
- Respect metered wifi and block instant uploads
- Proper handling of .djvu files
- Bugfixes and design improvements
## 2016-09-22
- update to latest 1.3.1 functionality
- updated What's new #84
- fix crash in dismissLoadingDialog #279
- Provisioning Links to launch and prefill app with login data #248
- fix remove failed #241
## 1.2.0 (July 29, 2016)
## 2016-09-18
- update to latest 1.3.0 functionality
- change caption for move and copy action #265
- Multi select capabilities
- Confirmation dialog on account removal
- Offline available filter in main menu
- Sorting capability when choosing files to be uploaded
- Video thumbnails if activated on server
- Thumbnails during upload
- Fixed user agent for file firewalling
- Showing server side folder sizes
- Text in test preview can now be selected
- Search suggestions fixed for user/group search during sharing
- Minor bugfixes
## 2016-09-15
- update to latest 1.3.0 RC2 functionality
- What's new #84
## 1.1.0 (July 6, 2016)
## 2016-09-07
- update Motivate more users #239
- DAVdroid login screen prefilled launch #236
- New main menu to switch accounts easily
- Ability to open Nextcloud hosted files (read-only) from other apps that support the standard file chooser (requires Android 4.4 / KitKat or higher)
- "Select all files" for upload within a folder
- Optional feature to auto-create monthly folders for your instant uploads
- Revamped login screen
- Minor bugfixes
## 2016-09-04
- descend into folder after creating it in uploader #206
- Motivate more users #239
## 1.0.1 (June 20, 2016)
## 2016-09-03
- Display quota if configured/available in navigation drawer #204
- bugfix for empty folder display #229
- Update Toolchain/Android-Target to v24 #214
- Restore display of remote folder size #235
- Fix thumbnail preview support for new files
- Add support for animated GIFs
- Optimized uploader layout
## 2016-08-08
- update all PR
- search for the right ocShare with public link #197
- Fix comparator determining order of list of uploads #199
- generate thumbnails only if mCurrentUpload is not null #205
## 1.0.0 (June 12, 2016)
## 2016-07-31
- External SD support #92
- move / copy updated #178
- prevents NPE when selecting empty local folder #180
- initial release of the Nextcloud Android app
## 2016-07-30
- Upload when charging #171
## 2016-07-28
Fresh start on current master with these PRs:
- Resized images #69
- Instant upload in the context of multi account support #98
- mix folders and files on sort by date #135
- Files drop #141
- Receive text file #142
- Pinch zoom #143
- Resize cache #144
- filter for oc file list and local file list #152
- djvu is not an image #153
- delay instant upload when metered wifi is used #161
- rename instant upload path #162
- Refresh when app starts #166
- Disable suggestions in password field #167
- resume chunked uploads #168
From now on every new PR with "3. to review" will be merged to beta and published
+2 -2
View File
@@ -16,8 +16,8 @@ The [Android SDK][3] is necessary to build the app. There are different options
Open a terminal and type 'android' to start the Android SDK Manager. To build the Nextcloud for Android app you will need to install at least the next SDK packages:
* Android SDK Tools and Android SDK Platform-tools (already installed); upgrade to their last versions is usually a good idea.
* Android SDK Build-Tools; any version from 23 or later should work fine; avoid preview versions, if any available.
* Android 6.0 (API 23), SDK Platform; needed to build the nextcloud app.
* Android SDK Build-Tools 24.0.2.
* Android 7.0 (API 24), SDK Platform; needed to build the nextcloud app.
Install any other package you consider interesting, such as emulators.
+1
View File
@@ -0,0 +1 @@
20161017
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+44 -8
View File
@@ -10,7 +10,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.1'
}
}
@@ -20,7 +20,12 @@ apply plugin: 'pmd'
apply plugin: 'findbugs'
ext {
supportLibraryVersion = '23.4.0'
supportLibraryVersion = '24.2.1'
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
}
repositories {
@@ -36,12 +41,11 @@ dependencies {
/// dependencies for app building
compile name: 'touch-image-view'
compile 'com.github.nextcloud:android-library:1.0.7'
compile 'com.github.nextcloud:android-library:beta-SNAPSHOT'
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile 'com.jakewharton:disklrucache:2.0.2'
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
compile "com.android.support:cardview-v7:${supportLibraryVersion}"
compile 'com.getbase:floatingactionbutton:1.10.1'
/// dependencies for local unit tests
@@ -62,7 +66,10 @@ dependencies {
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
androidTestCompile "com.android.support:support-annotations:${supportLibraryVersion}"
}
@@ -80,8 +87,8 @@ android {
htmlReport true
htmlOutput file("$project.buildDir/reports/lint/lint.html")
}
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -91,7 +98,14 @@ android {
testInstrumentationRunnerArgument "TEST_PASSWORD", "\"$System.env.OCTEST_APP_PASSWORD\""
testInstrumentationRunnerArgument "TEST_SERVER_URL", "\"$System.env.OCTEST_SERVER_BASE_URL\""
applicationId "com.nextcloud.client"
applicationId "com.nextcloud.android.beta"
versionCode 20161019
versionName "20161019"
// Enable the experimental Jack build tools.
jackOptions {
enabled true
}
}
// adapt structure from Eclipse to Gradle/Android Studio expectations;
@@ -123,6 +137,11 @@ android {
release.setRoot('build-types/release')
}
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled && !travisBuild
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
@@ -136,6 +155,10 @@ android {
exclude 'META-INF/LICENSE.txt'
}
signingConfigs {
release
}
task checkstyle(type: Checkstyle) {
configFile = file("${rootProject.projectDir}/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
@@ -187,4 +210,17 @@ android {
}
check.dependsOn 'checkstyle', 'findbugs', 'pmd', 'lint'
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
if (project.hasProperty('RELEASE_STORE_FILE')) {
android.signingConfigs.release.storeFile = file(RELEASE_STORE_FILE)
android.signingConfigs.release.storePassword = RELEASE_STORE_PASSWORD
android.signingConfigs.release.keyAlias = RELEASE_KEY_ALIAS
android.signingConfigs.release.keyPassword = RELEASE_KEY_PASSWORD
}
+1 -1
View File
@@ -1,4 +1,4 @@
#Tue Aug 16 10:44:46 CEST 2016
#Sat Sep 03 07:48:32 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
+8
View File
@@ -0,0 +1,8 @@
<!-- drawable/arrow_right.xml -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#007CC2" android:pathData="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" />
</vector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015-2016 Bartosz Przybylski
Copyright (C) 2015 ownCloud Inc.
Copyright (C) 2016 nextCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="5dp" android:top="5dp" android:right="5dp" android:left="5dp">
<shape
android:shape="oval">
<solid android:color="@color/owncloud_blue_dark_transparent"/>
<size android:width="8dp" android:height="8dp" />
</shape>
</item>
</layer-list>
+29
View File
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015-2016 Bartosz Przybylski
Copyright (C) 2015 ownCloud Inc.
Copyright (C) 2016 nextCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="5dp" android:top="5dp" android:right="5dp" android:left="5dp">
<shape
android:shape="oval">
<solid android:color="@color/owncloud_blue_accent"/>
<size android:width="8dp" android:height="8dp" />
</shape>
</item>
</layer-list>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#ffffff"/>
</shape>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/owncloud_blue_accent"/>
</shape>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015 Bartosz Przybylski
Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/indicator_dot_not_selected" />
<item android:drawable="@drawable/indicator_dot_selected" />
</transition>
+11 -9
View File
@@ -1,21 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Nextcloud Android client application
Copyright (C) 2016 ownCloud Inc.
Copyright (C) 2016 Andy Scherzinger
Copyright (C) 2016 Nextcloud
Copyright (C) 2016 ownCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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 General Public License for more details.
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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/>.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+95 -38
View File
@@ -1,70 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Nextcloud Android client application
Copyright (C) 2016 ownCloud Inc.
Copyright (C) 2016 Andy Scherzinger
Copyright (C) 2016 Nextcloud
Copyright (C) 2016 ownCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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 General Public License for more details.
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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/>.
-->
<LinearLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="@dimen/account_item_layout_height"
android:orientation="horizontal"
android:weightSum="1">
<FrameLayout
android:id="@+id/avatar_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<ImageView
android:id="@+id/user_icon"
android:layout_width="@dimen/user_icon_size"
android:layout_height="@dimen/user_icon_size"
android:layout_gravity="top|left"
android:layout_marginBottom="1dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="1dp"
android:layout_marginTop="1dp"
android:src="@drawable/ic_menu_archive"/>
<ImageView
android:id="@+id/ticker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:background="@drawable/round_bgnd"
android:src="@drawable/ic_account_circle_white_18dp"
android:tint="@color/actionbar_start_color"/>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_toEndOf="@id/avatar_container"
android:layout_toLeftOf="@+id/passwordButton"
android:layout_toRightOf="@id/avatar_container"
android:layout_toStartOf="@id/passwordButton"
android:orientation="vertical">
<TextView
android:id="@+id/user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_marginLeft="@dimen/standard_half_margin"
android:layout_marginRight="@dimen/standard_half_margin"
android:layout_marginStart="@dimen/standard_margin"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:gravity="bottom"
android:maxLines="1"
android:text="@string/placeholder_filename"
android:textAppearance="?android:attr/textAppearanceListItem"/>
<TextView
android:id="@+id/account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginEnd="@dimen/standard_half_margin"
android:layout_marginLeft="@dimen/standard_half_margin"
android:layout_marginRight="@dimen/standard_half_margin"
android:layout_marginStart="@dimen/standard_margin"
android:ellipsize="end"
android:gravity="top"
android:maxLines="2"
android:text="@string/placeholder_sentence"
android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>
<ImageView
android:id="@+id/user_icon"
android:layout_width="@dimen/user_icon_size"
android:layout_height="@dimen/user_icon_size"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/standard_margin"
android:src="@drawable/ic_menu_archive"/>
<TextView
android:id="@+id/user_name"
android:layout_width="@dimen/zero"
android:layout_height="fill_parent"
android:layout_marginLeft="@dimen/standard_margin"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingRight="@dimen/standard_padding"
android:text="@string/placeholder_filename"
android:textColor="@color/textColor"
android:textSize="@dimen/two_line_primary_text_size"/>
<ImageButton
android:id="@+id/passwordButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:paddingLeft="@dimen/standard_half_padding"
android:paddingTop="@dimen/standard_padding"
android:layout_toLeftOf="@+id/removeButton"
android:layout_toStartOf="@id/removeButton"
android:paddingBottom="@dimen/standard_padding"
android:paddingLeft="@dimen/standard_half_padding"
android:paddingRight="@dimen/standard_half_padding"
android:background="?android:selectableItemBackground"
android:paddingTop="@dimen/standard_padding"
android:src="@drawable/ic_key"/>
<ImageButton
<ImageView
android:id="@+id/removeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:paddingLeft="@dimen/standard_half_padding"
android:paddingTop="@dimen/standard_padding"
android:paddingBottom="@dimen/standard_padding"
android:paddingLeft="@dimen/standard_half_padding"
android:paddingRight="@dimen/standard_padding"
android:background="?android:selectableItemBackground"
android:paddingTop="@dimen/standard_padding"
android:src="@drawable/ic_action_delete_grey"/>
</LinearLayout>
</RelativeLayout>
+12 -10
View File
@@ -1,21 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
<!--
Nextcloud Android client application
Copyright (C) 2016 ownCloud Inc.
Copyright (C) 2016 Andy Scherzinger
Copyright (C) 2016 Nextcloud
Copyright (C) 2016 ownCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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 General Public License for more details.
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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/>.
-->
<LinearLayout
android:id="@+id/upload_files_layout"
+12 -9
View File
@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Nextcloud Android client application
Copyright (C) 2015 ownCloud Inc.
Copyright (C) 2015 Andy Scherzinger
Copyright (C) 2016 Nextcloud
Copyright (C) 2015 ownCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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 General Public License for more details.
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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/>.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
+12 -9
View File
@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Nextcloud Android client application
Copyright (C) 2016 ownCloud Inc.
Copyright (C) 2015 Andy Scherzinger
Copyright (C) 2016 Nextcloud
Copyright (C) 2015 ownCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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 General Public License for more details.
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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
+77
View File
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/standard_padding"
android:paddingRight="@dimen/standard_padding">
<TextView
android:id="@+id/logTV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/empty"
android:typeface="monospace"/>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/historyButtonBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_marginLeft="@dimen/standard_margin"
android:layout_marginRight="@dimen/standard_margin">
<Button
android:id="@+id/cancelErrorLogButton"
android:theme="@style/Button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
android:text="@string/error_log_exit" />
<android.support.v7.widget.AppCompatButton
android:id="@+id/sendErrorLogButton"
android:theme="@style/Button.Primary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
android:text="@string/error_log_send" />
</LinearLayout>
</LinearLayout>
-33
View File
@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="@dimen/standard_margin"
android:orientation="vertical">
<TextView
android:id="@+id/file_actions_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/standard_padding"
android:textColor="@color/black"
android:visibility="gone"
/>
<View
android:id="@+id/file_actions_header_divider"
android:layout_width="match_parent"
android:layout_height="@dimen/file_actions_view_height"
android:background="@color/owncloud_blue"
android:visibility="gone"
/>
<ListView
android:id="@+id/file_actions_list"
android:layout_width="match_parent"
android:layout_height="@dimen/zero"
android:layout_weight="1"
/>
</LinearLayout >
+1 -1
View File
@@ -49,7 +49,7 @@
<ImageView
android:id="@+id/thumbnail"
android:layout_width="@dimen/file_icon_size"
android:layout_width="32dp"
android:layout_height="@dimen/file_icon_size"
android:layout_gravity="left|center_vertical"
android:src="@drawable/ic_menu_archive" />
+52
View File
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Nextcloud Android client application
Copyright (C) 2016 Bartosz Przybylski
Copyright (C) 2016 Nextcloud
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<ProgressBar
android:id="@+id/migrationProgress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:progress="50"/>
<TextView
android:id="@+id/migrationText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:id="@+id/finishButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/drawer_close"/>
</LinearLayout>
+12 -9
View File
@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
Nextcloud Android client application
Copyright (C) 2016 ownCloud Inc.
Copyright (C) 2016 Andy Scherzinger
Copyright (C) 2016 Nextcloud
Copyright (C) 2016 ownCloud
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or 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 General Public License for more details.
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 General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/>.
-->
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
+69
View File
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="100">
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/placeholder_sentence"
android:id="@+id/welcomeText"
android:layout_margin="5dp"
android:layout_weight="10"
android:gravity="center"/>
<android.support.v4.view.ViewPager
android:id="@+id/contentPanel"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="80">
</android.support.v4.view.ViewPager>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:weightSum="3"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_marginLeft="@dimen/standard_margin"
android:layout_marginRight="@dimen/standard_margin">
<android.support.v7.widget.AppCompatButton
android:id="@+id/skip"
style="@style/Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/whats_new_skip"
android:layout_gravity="center_vertical|center_horizontal"/>
<com.owncloud.android.ui.whatsnew.ProgressIndicator
android:id="@+id/progressIndicator"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_gravity="center_vertical|center_horizontal">
</com.owncloud.android.ui.whatsnew.ProgressIndicator>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="center">
<ImageButton
android:id="@+id/forward"
android:src="@drawable/arrow_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="@dimen/standard_padding"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="100">
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:id="@+id/whatsNewImage"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:layout_weight="50"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/NextcloudTextAppearanceHeadline"
android:textStyle="bold"
android:text="@string/placeholder_sentence"
android:id="@+id/whatsNewTitle"
android:layout_gravity="center_horizontal"
android:gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/NextcloudTextAppearanceMedium"
android:text="@string/placeholder_sentence"
android:id="@+id/whatsNewText"
android:layout_margin="@dimen/standard_margin"
android:layout_gravity="center_horizontal"
android:gravity="center"/>
</LinearLayout>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

+1 -1
View File
@@ -47,7 +47,7 @@
<dimen name="two_line_primary_text_size">16sp</dimen>
<dimen name="two_line_secondary_text_size">14sp</dimen>
<dimen name="list_item_avatar_icon_margin">20dp</dimen>
<dimen name="list_item_avatar_text_margin">28dp</dimen>
<dimen name="list_item_avatar_text_margin">20dp</dimen>
<dimen name="account_action_layout_height">72dp</dimen>
<dimen name="zero">0dp</dimen>
<dimen name="account_item_layout_height">72dp</dimen>
+16 -8
View File
@@ -1,23 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Beta indicator -->
<bool name="is_beta">false</bool>
<!-- App name and other strings-->
<string name="app_name">Nextcloud</string>
<string name="account_type">nextcloud</string> <!-- better if was a domain name; but changing it now would require
<string name="app_name">Nextcloud beta</string>
<string name="account_type">nextcloud.beta</string> <!-- better if was a domain name; but changing it now would require
migrate accounts when the app is updated -->
<string name="authority">org.nextcloud</string> <!-- better if was the app package with ".provider" appended ; it identifies the provider -->
<string name="document_provider_authority">org.nextcloud.documents</string>
<string name="authority">org.nextcloud.beta.provider</string> <!-- better if was the app package with ".provider" appended ; it identifies the provider -->
<string name="authorityCache">org.nextcloud.beta.imageCache.provider</string>
<string name="authoritySearch">org.nextcloud.beta.android.providers.UsersAndGroupsSearchProvider</string>
<string name="document_provider_authority">org.nextcloud.beta.documents</string>
<string name="file_provider_authority">org.nextcloud.beta.files</string>
<string name ="db_file">nextcloud.db</string>
<string name ="db_name">nextcloud</string>
<string name ="data_folder">nextcloud</string>
<string name ="log_name">nextcloud</string>
<string name ="log_name">beta</string>
<string name ="default_display_name_for_root_folder">Nextcloud</string>
<string name ="user_agent">Mozilla/5.0 (Android) ownCloud-android/%1$s</string>
<string name ="user_agent">Mozilla/5.0 (Android) nextcloud-android/%1$s</string>
<!-- URLs and flags related -->
<string name="server_url"></string>
<bool name="show_server_url_input">true</bool>
<bool name="show_welcome_link">true</bool>
<string name="welcome_link_url">"https://nextcloud.com"</string>
<string name="welcome_link_url">"https://nextcloud.com/mobile/new"</string>
<string name="share_api_link"></string>
<!-- Flags to setup the authentication methods available in the app -->
@@ -61,8 +67,10 @@
<bool name="imprint_enabled">false</bool>
<bool name="recommend_enabled">true</bool>
<bool name="feedback_enabled">true</bool>
<bool name="logger_enabled">false</bool>
<bool name="logger_enabled">true</bool>
<string name="url_help">https://help.nextcloud.com/c/feature</string>
<string name="beta_link">https://github.com/nextcloud/android/raw/beta/apks/nextcloud-beta-</string>
<string name="beta_latest">https://github.com/nextcloud/android/raw/beta/apks/latest</string>
<string name="url_imprint"></string>
<string name="mail_recommend">"mailto:"</string>
<string name="mail_feedback">"mailto:[email protected]"</string>
+58 -1
View File
@@ -314,8 +314,14 @@
<string name="preview_image_description">Image preview</string>
<string name="preview_image_error_unknown_format">This image cannot be shown</string>
<string name="error_log_exit">Exit</string>
<string name="error_log_send">Send Log</string>
<string name="error_log_title">Error Log</string>
<string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
<string name="prefs_instant_upload_path_title">Instant upload folder</string>
<string name="prefs_instant_upload_account">Account</string>
<string name="prefs_instant_upload_path">Path</string>
<string name="prefs_instant_upload_path_use_subfolders_title">Use subfolders</string>
<string name="prefs_instant_upload_path_use_subfolders_summary">Store in subfolders based on year and month</string>
@@ -344,7 +350,7 @@
<string name="network_error_socket_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
<string name="network_error_connect_timeout_exception">An error occurred while waiting for the server, the operation couldn\'t have been done</string>
<string name="network_host_not_available">The operation couldn\'t be completed, server is unavailable</string>
<string name="empty" />
<string name="empty" translatable="false" />
<string name="forbidden_permissions">You do not have permission %s</string>
<string name="forbidden_permissions_rename">to rename this file</string>
@@ -356,6 +362,28 @@
<string name="uploader_upload_forbidden_permissions">to upload in this folder</string>
<string name="downloader_download_file_not_found">The file is no longer available on the server</string>
<string name="file_migration_dialog_title">Updating storage path</string>
<string name="file_migration_finish_button">Finish</string>
<string name="file_migration_preparing">Preparing for migration&#8230;</string>
<string name="file_migration_checking_destination">Checking destination&#8230;</string>
<string name="file_migration_saving_accounts_configuration">Saving accounts configuration&#8230;</string>
<string name="file_migration_waiting_for_unfinished_sync">Waiting for unfinished synchronizations&#8230;</string>
<string name="file_migration_migrating">Moving data&#8230;</string>
<string name="file_migration_updating_index">Updating index&#8230;</string>
<string name="file_migration_cleaning">Cleaning&#8230;</string>
<string name="file_migration_restoring_accounts_configuration">Restoring accounts configuration&#8230;</string>
<string name="file_migration_ok_finished">Finished</string>
<string name="file_migration_failed_not_enough_space">ERROR: Not enough space</string>
<string name="file_migration_failed_not_writable">ERROR: File is not writable</string>
<string name="file_migration_failed_not_readable">ERROR: File is not readable</string>
<string name="file_migration_failed_dir_already_exists">ERROR: Nextcloud directory already exists</string>
<string name="file_migration_failed_while_coping">ERROR: While migrating</string>
<string name="file_migration_failed_while_updating_index">ERROR: While updating index</string>
<string name="file_migration_directory_already_exists">Data folder already exists, what to do?</string>
<string name="file_migration_override_data_folder">Override</string>
<string name="file_migration_use_data_folder">Use existing</string>
<string name="prefs_category_accounts">Accounts</string>
<string name="prefs_add_account">Add account</string>
<string name="drawer_manage_accounts">Manage accounts</string>
@@ -422,6 +450,10 @@
<string name="pref_behaviour_entries_keep_file">kept in original folder</string>
<string name="pref_behaviour_entries_move">moved to app folder</string>
<string name="pref_behaviour_entries_delete_file">deleted</string>
<string name="prefs_storage_path">Storage path</string>
<string name="prefs_common">Common</string>
<string name="pref_cache_size">Cache size</string>
<string name="share_dialog_title">Sharing</string>
<string name="share_file">Share %1$s</string>
@@ -454,6 +486,7 @@
<string name="share_privilege_can_edit_delete">delete</string>
<string name="edit_share_unshare">Stop sharing</string>
<string name="edit_share_done">done</string>
<string name="changelog">https://github.com/nextcloud/android/raw/beta/CHANGELOG.md</string>
<string name="action_retry_uploads">Retry failed</string>
<string name="action_clear_failed_uploads">Clear failed</string>
@@ -506,4 +539,28 @@
<item quantity="other">%d selected</item>
</plurals>
<string name="storage_description_default">Default</string>
<string name="storage_description_sd_no">SD card %1$d</string>
<string name="storage_description_unknown">Unknown</string>
<string name="prefs_category_beta">Beta</string>
<!-- What's new feature and texts to show -->
<string name="whats_new_title">What\'s new in Nextcloud</string>
<!-- Welcome to oC intro features -->
<string name="welcome_feature_1_title">Instant upload</string>
<string name="welcome_feature_1_text">Keep your photos safe</string>
<string name="welcome_feature_2_title">Manage all your files</string>
<string name="welcome_feature_2_text">You can delete, move</string>
<string name="welcome_feature_3_title">Share</string>
<string name="welcome_feature_3_text">You can share files and folders</string>
<string name="welcome_feature_4_title">MultiAccount</string>
<string name="welcome_feature_4_text">Connect to all your clouds</string>
<string name="welcome_feature_5_title">Your private files synced anywhere</string>
<string name="whats_new_skip">Skip</string>
</resources>
+10
View File
@@ -277,4 +277,14 @@
</style>
<style name="Theme.ownCloud.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.ownCloud.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<!-- Text styles -->
<style name="NextcloudTextAppearanceHeadline" parent="style/TextAppearance.AppCompat.Headline">
<item name="android:textSize">28sp</item>
<item name="android:textColor">#000000</item>
</style>
<style name="NextcloudTextAppearanceMedium" parent="style/TextAppearance.AppCompat.Medium">
</style>
<style name="NextcloudTextAppearanceSmall" parent="style/TextAppearance.AppCompat.Small">
</style>
</resources>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="file" path="/" />
<!-- yes, valid for ALL external storage and not only our app folder, since we can't use @string/data_folder
as a value for 'path' attribute; in practice, we will only generate URIs in our folders, of course -->
</paths>
+21 -3
View File
@@ -18,12 +18,17 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
<PreferenceCategory android:title="@string/prefs_category_general">
<ListPreference
android:title="@string/prefs_storage_path"
android:key="storage_path" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_category_instant_uploading" android:key="instant_uploading_category">
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
android:title="@string/prefs_instant_upload"
android:summary="@string/prefs_instant_upload_summary"/>
<com.owncloud.android.ui.PreferenceWithLongSummary
<com.owncloud.android.ui.PreferenceWithTwoLineLongSummary
android:title="@string/prefs_instant_upload_path_title"
android:key="instant_upload_path" />
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
@@ -31,8 +36,6 @@
android:summary="@string/prefs_instant_upload_path_use_subfolders_summary"
android:key="instant_upload_path_use_subfolders" />
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
android:dependency="instant_uploading"
android:disableDependentsState="true"
android:title="@string/instant_upload_on_wifi"
android:key="instant_upload_on_wifi"/>
<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
@@ -76,6 +79,10 @@
<PreferenceCategory android:title="@string/prefs_category_details">
<android.preference.CheckBoxPreference android:title="@string/prefs_passcode" android:key="set_pincode" />
<android.preference.CheckBoxPreference android:title="@string/prefs_show_hidden_files" android:key="show_hidden_files" />
<EditTextPreference android:title="@string/pref_cache_size"
android:key="pref_cache_size"
android:digits="0123456789"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_category_more" android:key="more">
@@ -90,4 +97,15 @@
<Preference android:title="@string/about_title" android:id="@+id/about_app" android:key="about_app" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/prefs_category_beta" android:key="beta_category">
<Preference android:id="@+id/beta_link"
android:title="Download latest beta version"
android:key="beta_link" />
<Preference android:id="@+id/changelog_link"
android:title="Changelog beta version"
android:key="changelog_link" />
</PreferenceCategory>
</PreferenceScreen>
+2 -2
View File
@@ -22,7 +22,7 @@
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_name"
android:hint="@string/search_users_and_groups_hint"
android:searchSuggestAuthority="com.nextcloud.android.providers.UsersAndGroupsSearchProvider"
android:searchSuggestIntentAction="com.nextcloud.android.providers.UsersAndGroupsSearchProvider.action.SHARE_WITH"
android:searchSuggestAuthority="org.nextcloud.beta.android.providers.UsersAndGroupsSearchProvider"
android:searchSuggestIntentAction="org.nextcloud.beta.android.providers.UsersAndGroupsSearchProvider.action.SHARE_WITH"
android:searchSuggestThreshold="1" >
</searchable>
+46 -13
View File
@@ -23,17 +23,22 @@ package com.owncloud.android;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.preference.PreferenceManager;
import com.owncloud.android.authentication.PassCodeManager;
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.WhatsNewActivity;
import com.owncloud.android.utils.ExceptionHandler;
import com.owncloud.android.ui.activity.Preferences;
/**
* Main Application of the project
@@ -54,13 +59,24 @@ public class MainApp extends Application {
private static Context mContext;
private static String storagePath;
private static boolean mOnlyOnDevice = false;
public void onCreate(){
super.onCreate();
MainApp.mContext = getApplicationContext();
// Setup handler for uncaught exceptions.
Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
MainApp.storagePath = appPrefs.getString(Preferences.Keys.STORAGE_PATH, Environment.
getExternalStorageDirectory().getAbsolutePath());
boolean isSamlAuth = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));
OwnCloudClientManagerFactory.setUserAgent(getUserAgent());
@@ -72,18 +88,15 @@ public class MainApp extends Application {
// initialise thumbnails cache on background thread
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
if (BuildConfig.DEBUG) {
String dataFolder = getDataFolder();
// Set folder for store logs
Log_OC.setLogDataFolder(dataFolder);
String dataFolder = getDataFolder() + getAppContext().getResources().getString(R.string.log_name);
//TODO: to be changed/fixed whenever SD card support gets merged.
Log_OC.startLogging(Environment.getExternalStorageDirectory().getAbsolutePath());
Log_OC.d("Debug", "start logging");
}
// Set folder for store logs
Log_OC.setLogDataFolder(dataFolder);
Log_OC.startLogging(MainApp.storagePath);
Log_OC.d("Debug", "start logging");
// register global protection with pass code
registerActivityLifecycleCallbacks( new ActivityLifecycleCallbacks() {
@@ -91,6 +104,7 @@ public class MainApp extends Application {
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
Log_OC.d(activity.getClass().getSimpleName(), "onCreate(Bundle) starting" );
WhatsNewActivity.runIfNeeded(activity);
PassCodeManager.getPassCodeManager().onActivityCreated(activity);
}
@@ -132,14 +146,33 @@ public class MainApp extends Application {
return MainApp.mContext;
}
// Methods to obtain Strings referring app_name
public static String getStoragePath(){
return MainApp.storagePath;
}
public static void setStoragePath(String path){
MainApp.storagePath = path;
}
// Methods to obtain Strings referring app_name
// From AccountAuthenticator
// public static final String ACCOUNT_TYPE = "owncloud";
public static String getAccountType() {
return getAppContext().getResources().getString(R.string.account_type);
}
// From AccountAuthenticator
// Non gradle build systems do not provide BuildConfig.VERSION_CODE
// so we must fallback to this method :(
public static int getVersionCode() {
try {
String thisPackageName = getAppContext().getPackageName();
return getAppContext().getPackageManager().getPackageInfo(thisPackageName, 0).versionCode;
} catch (PackageManager.NameNotFoundException e) {
return 0;
}
}
// From AccountAuthenticator
// public static final String AUTHORITY = "org.owncloud";
public static String getAuthority() {
return getAppContext().getResources().getString(R.string.authority);
@@ -332,4 +332,28 @@ public class AccountUtils {
}
return (serverVersion != null ? serverVersion.isSearchUsersSupported() : false);
}
/**
* Returns account for instant upload or null, if not defined.
* @return instant upload account or null
*/
public static Account getInstantUploadAccount(Context context) {
return getAccount(com.owncloud.android.db.PreferenceManager.instantPictureUploadPathAccount(context));
}
/**
* Returns account for instant video upload or null, if not defined.
* @return instant video upload account or null
*/
public static Account getInstantVideoUploadAccount(Context context) {
return getAccount(com.owncloud.android.db.PreferenceManager.instantVideoUploadPathAccount(context));
}
/**
* Returns account for given account name or null, if not defined.
* @return account named accountNam or null
*/
private static Account getAccount(String accountName) {
return getOwnCloudAccountByName(MainApp.getAppContext(), accountName);
}
}
@@ -43,13 +43,9 @@ import com.owncloud.android.lib.resources.status.CapabilityBooleanType;
import com.owncloud.android.lib.resources.status.OCCapability;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.utils.MimeType;
import com.owncloud.android.utils.MimeTypeUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -161,7 +157,7 @@ public class FileDataStorageManager {
OCFile current = null;
for (int i=0; i<tmp.size(); i++) {
current = tmp.get(i);
if (current.isImage()) {
if (MimeTypeUtil.isImage(current)) {
ret.add(current);
}
}
@@ -726,44 +722,69 @@ public class FileDataStorageManager {
if (!targetFolder.exists()) {
targetFolder.mkdirs();
}
copied = copyFile(localFile, targetFile);
copied = FileStorageUtils.copyFile(localFile, targetFile);
}
Log_OC.d(TAG, "Local file COPIED : " + copied);
}
}
private boolean copyFile(File src, File target) {
boolean ret = true;
public void migrateStoredFiles(String srcPath, String dstPath) throws Exception {
Cursor c = null;
if (getContentResolver() != null) {
c = getContentResolver().query(ProviderTableMeta.CONTENT_URI_FILE,
null,
ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL",
null,
null);
InputStream in = null;
OutputStream out = null;
try {
in = new FileInputStream(src);
out = new FileOutputStream(target);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
} catch (IOException ex) {
ret = false;
} finally {
if (in != null) try {
in.close();
} catch (IOException e) {
e.printStackTrace(System.err);
}
if (out != null) try {
out.close();
} catch (IOException e) {
e.printStackTrace(System.err);
} else {
try {
c = getContentProviderClient().query(ProviderTableMeta.CONTENT_URI_FILE,
new String[]{ProviderTableMeta._ID, ProviderTableMeta.FILE_STORAGE_PATH},
ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL",
null,
null);
} catch (RemoteException e) {
Log_OC.e(TAG, e.getMessage());
throw e;
}
}
return ret;
}
ArrayList<ContentProviderOperation> operations =
new ArrayList<ContentProviderOperation>(c.getCount());
if (c.moveToFirst()) {
do {
ContentValues cv = new ContentValues();
long fileId = c.getLong(c.getColumnIndex(ProviderTableMeta._ID));
String oldFileStoragePath = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_STORAGE_PATH));
if (oldFileStoragePath.startsWith(srcPath)) {
cv.put(
ProviderTableMeta.FILE_STORAGE_PATH,
oldFileStoragePath.replaceFirst(srcPath, dstPath));
operations.add(
ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
withValues(cv).
withSelection(
ProviderTableMeta._ID + "=?",
new String[]{String.valueOf(fileId)}
)
.build());
}
} while (c.moveToNext());
}
c.close();
/// 3. apply updates in batch
if (getContentResolver() != null) {
getContentResolver().applyBatch(MainApp.getAuthority(), operations);
} else {
getContentProviderClient().applyBatch(operations);
}
}
private Vector<OCFile> getFolderContent(long parentId, boolean onlyOnDevice) {
@@ -1689,15 +1710,15 @@ public class FileDataStorageManager {
ContentResolver contentResolver = getContentResolver();
if (contentResolver != null) {
if (mimetypeString.startsWith("image/")) {
if (MimeTypeUtil.isImage(mimetypeString)) {
// Images
contentResolver.delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
MediaStore.Images.Media.DATA + "=?", new String[]{path});
} else if (mimetypeString.startsWith("audio/")) {
} else if (MimeTypeUtil.isAudio(mimetypeString)) {
// Audio
contentResolver.delete(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
MediaStore.Audio.Media.DATA + "=?", new String[]{path});
} else if (mimetypeString.startsWith("video/")) {
} else if (MimeTypeUtil.isVideo(mimetypeString)) {
// Video
contentResolver.delete(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
MediaStore.Video.Media.DATA + "=?", new String[]{path});
@@ -1705,15 +1726,15 @@ public class FileDataStorageManager {
} else {
ContentProviderClient contentProviderClient = getContentProviderClient();
try {
if (mimetypeString.startsWith("image/")) {
if (MimeTypeUtil.isImage(mimetypeString)) {
// Images
contentProviderClient.delete(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
MediaStore.Images.Media.DATA + "=?", new String[]{path});
} else if (mimetypeString.startsWith("audio/")) {
} else if (MimeTypeUtil.isAudio(mimetypeString)) {
// Audio
contentProviderClient.delete(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
MediaStore.Audio.Media.DATA + "=?", new String[]{path});
} else if (mimetypeString.startsWith("video/")) {
} else if (MimeTypeUtil.isVideo(mimetypeString)) {
// Video
contentProviderClient.delete(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
MediaStore.Video.Media.DATA + "=?", new String[]{path});
@@ -1722,7 +1743,6 @@ public class FileDataStorageManager {
Log_OC.e(TAG, "Exception deleting media file in MediaStore " + e.getMessage());
}
}
}
public void saveConflict(OCFile file, String etagInConflict) {
+40 -47
View File
@@ -24,11 +24,16 @@ package com.owncloud.android.datamodel;
import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.content.FileProvider;
import android.webkit.MimeTypeMap;
import com.owncloud.android.R;
import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.utils.MimeType;
@@ -95,6 +100,14 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
private Uri mLocalUri;
/**
* Exportable URI to the local path of the file contents, if stored in the device.
*
* Cached after first call, until changed.
*/
private Uri mExposedFileUri;
/**
* Create new {@link OCFile} with given path.
* <p/>
@@ -245,6 +258,32 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
return mLocalUri;
}
public Uri getExposedFileUri(Context context) {
if (mLocalPath == null || mLocalPath.length() == 0) {
return null;
}
if (mExposedFileUri == null) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
// TODO - use FileProvider with any Android version, with deeper testing -> 2.2.0
mExposedFileUri = Uri.parse(
ContentResolver.SCHEME_FILE + "://" + WebdavUtils.encodePath(mLocalPath)
);
} else {
// Use the FileProvider to get a content URI
try {
mExposedFileUri = FileProvider.getUriForFile(
context,
context.getString(R.string.file_provider_authority),
new File(mLocalPath)
);
} catch (IllegalArgumentException e) {
Log_OC.e(TAG, "File can't be exported");
}
}
}
return mExposedFileUri;
}
/**
* Can be used to set the path where the file is stored
*
@@ -253,6 +292,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
public void setStoragePath(String storage_path) {
mLocalPath = storage_path;
mLocalUri = null;
mExposedFileUri = null;
}
/**
@@ -562,53 +602,6 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
return 0;
}
/**
* @return 'True' if the file contains audio
*/
public boolean isAudio() {
return (mMimeType != null && mMimeType.startsWith("audio/"));
}
/**
* @return 'True' if the file contains video
*/
public boolean isVideo() {
return (mMimeType != null && mMimeType.startsWith("video/"));
}
/**
* @return 'True' if the file contains an image
*/
public boolean isImage() {
String mimeType;
if (mMimeType != null) {
mimeType = mMimeType;
} else {
mimeType = getMimeTypeFromName();
}
return (mimeType.startsWith("image/") && !mimeType.contains("djvu"));
}
/**
* @return 'True' if the file is simple text (e.g. not application-dependent, like .doc or .docx)
*/
public boolean isText() {
return ((mMimeType != null && mMimeType.startsWith("text/")) ||
getMimeTypeFromName().startsWith("text/"));
}
public String getMimeTypeFromName() {
String extension = "";
int pos = mRemotePath.lastIndexOf('.');
if (pos >= 0) {
extension = mRemotePath.substring(pos + 1);
}
String result = MimeTypeMap.getSingleton().
getMimeTypeFromExtension(extension.toLowerCase());
return (result != null) ? result : "";
}
/**
* @return 'True' if the file is hidden
*/
@@ -21,30 +21,28 @@
package com.owncloud.android.datamodel;
import java.io.File;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.FileNameMap;
import java.net.URLConnection;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import android.accounts.Account;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.media.Image;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.os.AsyncTask;
import android.view.Display;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.preference.PreferenceManager;
import android.widget.ImageView;
import android.widget.ProgressBar;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
@@ -56,8 +54,9 @@ import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.ui.adapter.DiskLruImageCache;
import com.owncloud.android.utils.BitmapUtils;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.DisplayUtils.AvatarGenerationListener;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.utils.MimeTypeUtil;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
@@ -65,7 +64,6 @@ import org.apache.commons.httpclient.methods.GetMethod;
import java.io.File;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import com.owncloud.android.utils.FileStorageUtils;
/**
* Manager for concurrent access to thumbnails cache.
@@ -75,12 +73,12 @@ public class ThumbnailsCacheManager {
private static final String TAG = ThumbnailsCacheManager.class.getSimpleName();
private static final String CACHE_FOLDER = "thumbnailCache";
private static final Integer CACHE_SIZE_MB = 10;
private static final Object mThumbnailsDiskCacheLock = new Object();
private static DiskLruImageCache mThumbnailCache = null;
private static boolean mThumbnailCacheStarting = true;
private static final int DISK_CACHE_SIZE = 1024 * 1024 * 10; // 10MB
private static final CompressFormat mCompressFormat = CompressFormat.JPEG;
private static final int mCompressQuality = 70;
private static OwnCloudClient mClient = null;
@@ -97,7 +95,7 @@ public class ThumbnailsCacheManager {
R.drawable.file_movie
);
public static class InitDiskCacheTask extends AsyncTask<File, Void, Void> {
@Override
@@ -107,7 +105,19 @@ public class ThumbnailsCacheManager {
if (mThumbnailCache == null) {
try {
// Check if media is mounted or storage is built-in, if so,
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(MainApp.getAppContext());
// due to backward compatibility
Integer cacheSize = CACHE_SIZE_MB * 1024 * 1024;
try {
cacheSize = appPrefs.getInt("pref_cache_size", cacheSize);
} catch (ClassCastException e) {
String temp = appPrefs.getString("pref_cache_size",
cacheSize.toString());
cacheSize = Integer.decode(temp) * 1024 * 1024;
}
// Check if media is mounted or storage is built-in, if so,
// try and use external cache dir; otherwise use internal cache dir
final String cachePath =
MainApp.getAppContext().getExternalCacheDir().getPath() +
@@ -116,7 +126,7 @@ public class ThumbnailsCacheManager {
final File diskCacheDir = new File(cachePath);
mThumbnailCache = new DiskLruImageCache(
diskCacheDir,
DISK_CACHE_SIZE,
cacheSize,
mCompressFormat,
mCompressQuality
);
@@ -159,14 +169,40 @@ public class ThumbnailsCacheManager {
return null;
}
/**
* Sets max size of cache
* @param maxSize in MB
* @return
*/
public static boolean setMaxSize(long maxSize){
if (mThumbnailCache != null){
mThumbnailCache.setMaxSize(maxSize * 1024 * 1024);
return true;
} else {
return false;
}
}
/**
* Shows max cache size
* @return max cache size in MB.
*/
public static long getMaxSize(){
if (mThumbnailCache == null) {
new ThumbnailsCacheManager.InitDiskCacheTask().execute();
}
return mThumbnailCache.getMaxSize() / 1024 / 1024;
}
public static class ThumbnailGenerationTask extends AsyncTask<Object, Void, Bitmap> {
private final WeakReference<ImageView> mImageViewReference;
private WeakReference<ProgressBar> mProgressWheelRef;
private static Account mAccount;
private Object mFile;
private Boolean mIsThumbnail;
private String mImageKey = null;
private FileDataStorageManager mStorageManager;
public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager,
Account account) {
// Use a WeakReference to ensure the ImageView can be garbage collected
@@ -185,6 +221,12 @@ public class ThumbnailsCacheManager {
mImageViewReference = null;
}
public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager,
Account account, ProgressBar progressWheel) {
this(imageView, storageManager, account);
mProgressWheelRef = new WeakReference<ProgressBar>(progressWheel);
}
public ThumbnailGenerationTask(ImageView imageView) {
// Use a WeakReference to ensure the ImageView can be garbage collected
mImageViewReference = new WeakReference<ImageView>(imageView);
@@ -205,23 +247,25 @@ public class ThumbnailsCacheManager {
}
mFile = params[0];
if (params.length == 2){
mImageKey = (String) params[1];
}
if (mFile instanceof OCFile) {
thumbnail = doOCFileInBackground();
mIsThumbnail = (Boolean) params[1];
if (((OCFile) mFile).isVideo() && thumbnail != null){
if (params.length == 3){
mImageKey = (String) params[2];
}
if (mFile instanceof OCFile) {
thumbnail = doOCFileInBackground(mIsThumbnail);
if (MimeTypeUtil.isVideo((OCFile) mFile) && thumbnail != null) {
thumbnail = addVideoOverlay(thumbnail);
}
} else if (mFile instanceof File) {
thumbnail = doFileInBackground();
thumbnail = doFileInBackground(mIsThumbnail);
String url = ((File) mFile).getAbsolutePath();
String mMimeType = FileStorageUtils.getMimeTypeFromName(url);
if (mMimeType != null && mMimeType.startsWith("video/") && thumbnail != null){
if (MimeTypeUtil.isVideo(mMimeType) && thumbnail != null) {
thumbnail = addVideoOverlay(thumbnail);
}
//} else { do nothing
@@ -250,6 +294,12 @@ public class ThumbnailsCacheManager {
tagId = String.valueOf(mFile.hashCode());
}
if (String.valueOf(imageView.getTag()).equals(tagId)) {
if (mProgressWheelRef != null) {
final ProgressBar progressWheel = mProgressWheelRef.get();
if (progressWheel != null) {
progressWheel.setVisibility(View.GONE);
}
}
imageView.setImageBitmap(bitmap);
}
}
@@ -261,12 +311,14 @@ public class ThumbnailsCacheManager {
* @param imageKey: thumb key
* @param bitmap: image for extracting thumbnail
* @param path: image path
* @param px: thumbnail dp
* @param pxW: thumbnail width in pixel
* @param pxH: thumbnail height in pixel
* @return Bitmap
*/
private Bitmap addThumbnailToCache(String imageKey, Bitmap bitmap, String path, int px){
private Bitmap addThumbnailToCache(String imageKey, Bitmap bitmap, String path,
int pxW, int pxH){
Bitmap thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
Bitmap thumbnail = ThumbnailUtils.extractThumbnail(bitmap, pxW, pxH);
// Rotate image, obeying exif tag
thumbnail = BitmapUtils.rotateImage(thumbnail,path);
@@ -287,31 +339,56 @@ public class ThumbnailsCacheManager {
return Math.round(r.getDimension(R.dimen.file_icon_size_grid));
}
private Bitmap doOCFileInBackground() {
private Point getScreenDimension(){
WindowManager wm = (WindowManager) MainApp.getAppContext().
getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point test = new Point();
display.getSize(test);
return test;
}
private Bitmap doOCFileInBackground(Boolean isThumbnail) {
Bitmap thumbnail = null;
OCFile file = (OCFile)mFile;
final String imageKey = String.valueOf(file.getRemoteId());
// distinguish between thumbnail and resized image
String temp = String.valueOf(file.getRemoteId());
if (isThumbnail){
temp = "t" + temp;
} else {
temp = "r" + temp;
}
final String imageKey = temp;
// Check disk cache in background thread
Bitmap thumbnail = getBitmapFromDiskCache(imageKey);
thumbnail = getBitmapFromDiskCache(imageKey);
// Not found in disk cache
if (thumbnail == null || file.needsUpdateThumbnail()) {
int px = getThumbnailDimension();
int pxW = 0;
int pxH = 0;
if (mIsThumbnail) {
pxW = pxH = getThumbnailDimension();
} else {
Point p = getScreenDimension();
pxW = p.x;
pxH = p.y;
}
if (file.isDown()) {
Bitmap temp = BitmapUtils.decodeSampledBitmapFromFile(
file.getStoragePath(), px, px);
Bitmap bitmap = ThumbnailUtils.extractThumbnail(temp, px, px);
Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile(
file.getStoragePath(), pxW, pxH);
if (bitmap != null) {
// Handle PNG
if (file.getMimetype().equalsIgnoreCase("image/png")) {
bitmap = handlePNG(bitmap, px);
bitmap = handlePNG(bitmap, pxW);
}
thumbnail = addThumbnailToCache(imageKey, bitmap, file.getStoragePath(), px);
thumbnail = addThumbnailToCache(imageKey, bitmap, file.getStoragePath(),
pxW, pxH);
file.setNeedsUpdateThumbnail(false);
mStorageManager.saveFile(file);
@@ -324,30 +401,47 @@ public class ThumbnailsCacheManager {
if (serverOCVersion.supportsRemoteThumbnails()) {
GetMethod get = null;
try {
String uri = mClient.getBaseUri() + "" +
"/index.php/apps/files/api/v1/thumbnail/" +
px + "/" + px + Uri.encode(file.getRemotePath(), "/");
Log_OC.d("Thumbnail", "URI: " + uri);
get = new GetMethod(uri);
get.setRequestHeader("Cookie",
"nc_sameSiteCookielax=true;nc_sameSiteCookiestrict=true");
int status = mClient.executeMethod(get);
if (status == HttpStatus.SC_OK) {
InputStream inputStream = get.getResponseBodyAsStream();
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
// Handle PNG
if (file.getMimetype().equalsIgnoreCase("image/png")) {
thumbnail = handlePNG(thumbnail, px);
}
// Add thumbnail to cache
if (thumbnail != null) {
addBitmapToCache(imageKey, thumbnail);
if (mIsThumbnail) {
String uri = mClient.getBaseUri() + "" +
"/index.php/apps/files/api/v1/thumbnail/" +
pxW + "/" + pxH + Uri.encode(file.getRemotePath(), "/");
Log_OC.d("Thumbnail", "URI: " + uri);
get = new GetMethod(uri);
get.setRequestHeader("Cookie",
"nc_sameSiteCookielax=true;nc_sameSiteCookiestrict=true");
int status = mClient.executeMethod(get);
if (status == HttpStatus.SC_OK) {
InputStream inputStream = get.getResponseBodyAsStream();
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
thumbnail = ThumbnailUtils.extractThumbnail(bitmap, pxW, pxH);
}
} else {
mClient.exhaustResponse(get.getResponseBodyAsStream());
String uri = mClient.getBaseUri() + "" +
"/index.php/apps/gallery/api/preview/" +
Integer.parseInt(file.getRemoteId().substring(0,8)) +
"/" + pxW + "/" + pxH;
Log_OC.d("Thumbnail", "FileName: " + file.getFileName() +
" Download URI: " + uri);
get = new GetMethod(uri);
get.setRequestHeader("Cookie",
"nc_sameSiteCookielax=true;nc_sameSiteCookiestrict=true");
int status = mClient.executeMethod(get);
if (status == HttpStatus.SC_OK) {
InputStream inputStream = get.getResponseBodyAsStream();
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
// Download via gallery app
thumbnail = bitmap;
}
}
// Handle PNG
if (file.getMimetype().equalsIgnoreCase("image/png")) {
thumbnail = handlePNG(thumbnail, pxW);
}
// Add thumbnail to cache
if (thumbnail != null) {
addBitmapToCache(imageKey, thumbnail);
}
} catch (Exception e) {
e.printStackTrace();
@@ -367,7 +461,7 @@ public class ThumbnailsCacheManager {
}
private Bitmap doFileInBackground() {
private Bitmap doFileInBackground(Boolean mIsThumbnail) {
File file = (File)mFile;
final String imageKey;
@@ -377,19 +471,33 @@ public class ThumbnailsCacheManager {
imageKey = String.valueOf(file.hashCode());
}
// distinguish between thumbnail and resized image
if (mIsThumbnail){
mImageKey = "t" + mImageKey;
} else {
mImageKey = "r" + mImageKey;
}
// Check disk cache in background thread
Bitmap thumbnail = getBitmapFromDiskCache(imageKey);
// Not found in disk cache
if (thumbnail == null) {
int px = getThumbnailDimension();
int pxW = 0;
int pxH = 0;
if (mIsThumbnail) {
pxW = pxH = getThumbnailDimension();
} else {
Point p = getScreenDimension();
pxW = p.x;
pxH = p.y;
}
Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile(
file.getAbsolutePath(), px, px);
file.getAbsolutePath(), pxW, pxH);
if (bitmap != null) {
thumbnail = addThumbnailToCache(imageKey, bitmap, file.getPath(), px);
thumbnail = addThumbnailToCache(imageKey, bitmap, file.getPath(), pxW, pxH);
}
}
return thumbnail;
@@ -0,0 +1,96 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage;
import android.os.Build;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datastorage.providers.EnvironmentStoragePointProvider;
import com.owncloud.android.datastorage.providers.HardcodedStoragePointProvider;
import com.owncloud.android.datastorage.providers.IStoragePointProvider;
import com.owncloud.android.datastorage.providers.MountCommandStoragePointProvider;
import com.owncloud.android.datastorage.providers.SystemDefaultStoragePointProvider;
import com.owncloud.android.datastorage.providers.VDCStoragePointProvider;
import java.io.File;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public class DataStorageProvider {
private static final Vector<IStoragePointProvider> mStorageProviders = new Vector<>();
private static final UniqueStorageList mCachedStoragePoints = new UniqueStorageList();
private static final DataStorageProvider sInstance = new DataStorageProvider() {{
// There is no system wide way to get usb storage so we need to provide multiple
// handcrafted ways to add those.
addStoragePointProvider(new SystemDefaultStoragePointProvider());
addStoragePointProvider(new EnvironmentStoragePointProvider());
addStoragePointProvider(new VDCStoragePointProvider());
addStoragePointProvider(new MountCommandStoragePointProvider());
addStoragePointProvider(new HardcodedStoragePointProvider());
}};
public static DataStorageProvider getInstance() {
return sInstance;
}
private DataStorageProvider() {}
public StoragePoint[] getAvailableStoragePoints() {
if (mCachedStoragePoints.size() != 0)
return mCachedStoragePoints.toArray(new StoragePoint[mCachedStoragePoints.size()]);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
for (File f : MainApp.getAppContext().getExternalFilesDirs(null)) {
if (f != null) {
mCachedStoragePoints.add(new StoragePoint(f.getAbsolutePath(), f.getAbsolutePath()));
}
}
} else {
for (IStoragePointProvider p : mStorageProviders)
if (p.canProvideStoragePoints()) {
mCachedStoragePoints.addAll(p.getAvailableStoragePoint());
}
}
return mCachedStoragePoints.toArray(new StoragePoint[mCachedStoragePoints.size()]);
}
public String getStorageDescriptionByPath(String path) {
for (StoragePoint s : getAvailableStoragePoints())
if (s.getPath().equals(path))
return s.getDescription();
return MainApp.getAppContext().getString(R.string.storage_description_unknown);
}
public void addStoragePointProvider(IStoragePointProvider provider) {
mStorageProviders.add(provider);
}
public void removeStoragePointProvider(IStoragePointProvider provider) {
mStorageProviders.remove(provider);
}
}
@@ -0,0 +1,43 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage;
/**
* @author Bartosz Przybylski
*/
public class StoragePoint implements Comparable<StoragePoint> {
private String mDescription;
private String mPath;
public StoragePoint(String description, String path) {
mDescription = description;
mPath = path;
}
public String getPath() { return mPath; }
public String getDescription() { return mDescription; }
@Override
public int compareTo(StoragePoint another) {
return mPath.compareTo(another.getPath());
}
}
@@ -0,0 +1,54 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public class UniqueStorageList extends Vector<StoragePoint> {
@Override
public boolean add(StoragePoint sp) {
try {
for (StoragePoint s : this) {
String thisCanonPath = new File(s.getPath()).getCanonicalPath();
String otherCanonPath = new File(sp.getPath()).getCanonicalPath();
if (thisCanonPath.equals(otherCanonPath))
return true;
}
} catch (IOException e) {
return false;
}
return super.add(sp);
}
@Override
public synchronized boolean addAll(Collection<? extends StoragePoint> collection) {
for (StoragePoint sp : collection)
add(sp);
return true;
}
}
@@ -0,0 +1,64 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import java.io.InputStream;
import java.util.Arrays;
/**
* @author Bartosz Przybylski
*/
abstract public class AbstractCommandLineStoragePoint extends AbstractStoragePointProvider {
static protected final int sCommandLineOKReturnValue = 0;
protected abstract String[] getCommand();
@Override
public boolean canProvideStoragePoints() {
Process process;
try {
process = new ProcessBuilder().command(Arrays.asList(getCommand())).start();
process.waitFor();
} catch (Exception e) {
return false;
}
return process != null && process.exitValue() == sCommandLineOKReturnValue;
}
protected String getCommandLineResult() {
String s = "";
try {
final Process process = new ProcessBuilder().command(getCommand())
.redirectErrorStream(true).start();
process.waitFor();
final InputStream is = process.getInputStream();
final byte buffer[] = new byte[1024];
while (is.read(buffer) != -1)
s += new String(buffer);
is.close();
} catch (final Exception e) { }
return s;
}
}
@@ -0,0 +1,42 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.io.File;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
abstract public class AbstractStoragePointProvider implements IStoragePointProvider {
protected boolean canBeAddedToAvailableList(Vector<StoragePoint> currentList, String path) {
if (path == null) return false;
for (StoragePoint storage : currentList)
if (storage.getPath().equals(path))
return false;
File f = new File(path);
return f.exists() && f.isDirectory() && f.canRead() && f.canWrite();
}
}
@@ -0,0 +1,58 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import android.text.TextUtils;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public class EnvironmentStoragePointProvider extends AbstractStoragePointProvider {
private static final String sSecondaryStorageEnvName = "SECONDARY_STORAGE";
@Override
public boolean canProvideStoragePoints() {
return !TextUtils.isEmpty(System.getenv(sSecondaryStorageEnvName));
}
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
addEntriesFromEnv(result, sSecondaryStorageEnvName);
return result;
}
private void addEntriesFromEnv(Vector<StoragePoint> result, String envName) {
String env = System.getenv(envName);
if (env != null)
for (String p : env.split(":"))
if (canBeAddedToAvailableList(result, p))
result.add(new StoragePoint(p, p));
}
}
@@ -0,0 +1,56 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public class HardcodedStoragePointProvider extends AbstractStoragePointProvider {
static private final String[] sPaths = {
"/mnt/external_sd/",
"/mnt/extSdCard/",
"/storage/extSdCard",
"/storage/sdcard1/",
"/storage/usbcard1/"
};
@Override
public boolean canProvideStoragePoints() {
return true;
}
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
for (String s : sPaths)
if (canBeAddedToAvailableList(result, s))
result.add(new StoragePoint(s, s));
return result;
}
}
@@ -0,0 +1,48 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public interface IStoragePointProvider {
/**
* This method is used for querying storage provider to check if it can provide
* usable and reliable data storage places.
*
* @return true if provider can reliably return storage path
*/
boolean canProvideStoragePoints();
/**
*
* @return available storage points
*/
Vector<StoragePoint> getAvailableStoragePoint();
}
@@ -0,0 +1,69 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.Locale;
import java.util.Vector;
import java.util.regex.Pattern;
/**
* @author Bartosz Przybylski
*/
public class MountCommandStoragePointProvider extends AbstractCommandLineStoragePoint {
static private final String[] sCommand = new String[] { "mount" };
private static Pattern sPattern = Pattern.compile("(?i).*vold.*(vfat|ntfs|exfat|fat32|ext3|ext4).*rw.*");
@Override
protected String[] getCommand() {
return sCommand;
}
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
for (String p : getPotentialPaths(getCommandLineResult()))
if (canBeAddedToAvailableList(result, p))
result.add(new StoragePoint(p, p));
return result;
}
private Vector<String> getPotentialPaths(String mounted) {
final Vector<String> result = new Vector<>();
for (String line : mounted.split("\n"))
if (!line.toLowerCase(Locale.US).contains("asec") && sPattern.matcher(line).matches()) {
String parts[] = line.split(" ");
for (String path : parts) {
if (path.startsWith("/") &&
!path.toLowerCase(Locale.US).contains("vold"))
result.add(path);
}
}
return result;
}
}
@@ -0,0 +1,52 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import android.os.Environment;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public class SystemDefaultStoragePointProvider extends AbstractStoragePointProvider {
@Override
public boolean canProvideStoragePoints() {
return true;
}
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
final String defaultStringDesc =
MainApp.getAppContext().getString(R.string.storage_description_default);
final String path = Environment.getExternalStorageDirectory().getAbsolutePath();
result.add(new StoragePoint(defaultStringDesc, path));
return result;
}
}
@@ -0,0 +1,79 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import com.owncloud.android.lib.common.utils.Log_OC;
import java.util.Vector;
/**
* @author Bartosz Przybylski
*/
public class VDCStoragePointProvider extends AbstractCommandLineStoragePoint {
static private final String TAG = VDCStoragePointProvider.class.getSimpleName();
static private final String[] sVDCVolListCommand = new String[]{ "/system/bin/vdc", "volume", "list" };
static private final int sVDCVolumeList = 110;
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
result.addAll(getPaths(getCommandLineResult()));
return result;
}
@Override
protected String[] getCommand() {
return sVDCVolListCommand;
}
private Vector<StoragePoint> getPaths(String vdcResources) {
Vector<StoragePoint> result = new Vector<>();
for (String line : vdcResources.split("\n")) {
String vdcLine[] = line.split(" ");
try {
int status = Integer.parseInt(vdcLine[0]);
if (status != sVDCVolumeList)
continue;
final String description = vdcLine[1];
final String path = vdcLine[2];
if (canBeAddedToAvailableList(result, path))
result.add(new StoragePoint(description, path));
} catch (NumberFormatException e) {
Log_OC.e(TAG, "Incorrect VDC output format " + e);
} catch (Exception e) {
Log_OC.e(TAG, "Unexpected exception on VDC parsing " + e);
}
}
return result;
}
}
+2 -2
View File
@@ -34,7 +34,7 @@ import com.owncloud.android.datamodel.UploadsStorageManager.UploadStatus;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.UploadFileOperation;
import com.owncloud.android.utils.MimetypeIconUtil;
import com.owncloud.android.utils.MimeTypeUtil;
import java.io.File;
@@ -235,7 +235,7 @@ public class OCUpload implements Parcelable {
* @return the mimeType
*/
public String getMimeType() {
return MimetypeIconUtil.getBestMimeTypeByFilename(mLocalPath);
return MimeTypeUtil.getBestMimeTypeByFilename(mLocalPath);
}
/**
@@ -22,6 +22,8 @@ package com.owncloud.android.db;
import android.content.Context;
import android.content.SharedPreferences;
import com.owncloud.android.MainApp;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.utils.FileStorageUtils;
@@ -37,17 +39,25 @@ public abstract class PreferenceManager {
private static final String AUTO_PREF__SORT_ORDER = "sort_order";
private static final String AUTO_PREF__SORT_ASCENDING = "sort_ascending";
private static final String AUTO_PREF__UPLOADER_BEHAVIOR = "prefs_uploader_behaviour";
private static final String AUTO_PREF__GRID_COLUMNS = "grid_columns";
private static final String PREF__INSTANT_UPLOADING = "instant_uploading";
private static final String PREF__INSTANT_UPLOAD_PATH_ACCOUNT = "instant_upload_path_account";
private static final String PREF__INSTANT_VIDEO_UPLOADING = "instant_video_uploading";
private static final String PREF__INSTANT_UPLOAD_PATH_USE_SUBFOLDERS = "instant_upload_path_use_subfolders";
private static final String PREF__INSTANT_UPLOAD_ON_WIFI = "instant_upload_on_wifi";
private static final String PREF__INSTANT_VIDEO_UPLOAD_ON_WIFI = "instant_video_upload_on_wifi";
private static final String PREF__INSTANT_VIDEO_UPLOAD_PATH_USE_SUBFOLDERS = "instant_video_upload_path_use_subfolders";
private static final String PREF__INSTANT_VIDEO_UPLOAD_PATH_ACCOUNT = "instant_video_upload_path_account";
public static boolean instantPictureUploadEnabled(Context context) {
return getDefaultSharedPreferences(context).getBoolean(PREF__INSTANT_UPLOADING, false);
}
public static String instantPictureUploadPathAccount(Context context) {
return getDefaultSharedPreferences(context).getString(PREF__INSTANT_UPLOAD_PATH_ACCOUNT,
AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()).name);
}
public static boolean instantVideoUploadEnabled(Context context) {
return getDefaultSharedPreferences(context).getBoolean(PREF__INSTANT_VIDEO_UPLOADING, false);
}
@@ -60,6 +70,11 @@ public abstract class PreferenceManager {
return getDefaultSharedPreferences(context).getBoolean(PREF__INSTANT_UPLOAD_ON_WIFI, false);
}
public static String instantVideoUploadPathAccount(Context context) {
return getDefaultSharedPreferences(context).getString(PREF__INSTANT_VIDEO_UPLOAD_PATH_ACCOUNT,
AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()).name);
}
public static boolean instantVideoUploadPathUseSubfolders(Context context) {
return getDefaultSharedPreferences(context).getBoolean(PREF__INSTANT_VIDEO_UPLOAD_PATH_USE_SUBFOLDERS, false);
}
@@ -160,22 +175,44 @@ public abstract class PreferenceManager {
saveIntPreference(context, AUTO_PREF__UPLOADER_BEHAVIOR, uploaderBehaviour);
}
/**
* Gets the grid columns which the user has set last.
*
* @param context Caller {@link Context}, used to access to shared preferences manager.
* @return grid columns grid columns
*/
public static float getGridColumns(Context context) {
return getDefaultSharedPreferences(context).getFloat(AUTO_PREF__GRID_COLUMNS, -1.0f);
}
/**
* Saves the grid columns which the user has set last.
*
* @param context Caller {@link Context}, used to access to shared preferences manager.
* @param gridColumns the uploader behavior
*/
public static void setGridColumns(Context context, float gridColumns) {
saveFloatPreference(context, AUTO_PREF__GRID_COLUMNS, gridColumns);
}
private static void saveBooleanPreference(Context context, String key, boolean value) {
SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit();
appPreferences.putBoolean(key, value);
appPreferences.apply();
appPreferences.putBoolean(key, value).apply();
}
private static void saveStringPreference(Context context, String key, String value) {
SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit();
appPreferences.putString(key, value);
appPreferences.apply();
appPreferences.putString(key, value).apply();
}
private static void saveIntPreference(Context context, String key, int value) {
SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit();
appPreferences.putInt(key, value);
appPreferences.apply();
appPreferences.putInt(key, value).apply();
}
private static void saveFloatPreference(Context context, String key, float value) {
SharedPreferences.Editor appPreferences = getDefaultSharedPreferences(context.getApplicationContext()).edit();
appPreferences.putFloat(key, value).apply();
}
private static SharedPreferences getDefaultSharedPreferences(Context context) {
@@ -0,0 +1,160 @@
/**
* ownCloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2015 Bartosz Przybylski
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.owncloud.android.features;
import android.os.Parcel;
import android.os.Parcelable;
import com.owncloud.android.BuildConfig;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.lib.common.utils.Log_OC;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Pattern;
/**
* @author Bartosz Przybylski
*/
public class FeatureList {
static final private boolean SHOW_ON_FIRST_RUN = true;
static final private boolean SHOW_ON_UPGRADE = false;
static final private FeatureItem featuresList[] = {
// Basic features showed on first install
new FeatureItem(R.drawable.what_new_instant_upload, R.string.welcome_feature_1_title, R.string.welcome_feature_1_text, "1.0.0", "0", SHOW_ON_FIRST_RUN),
new FeatureItem(R.drawable.whats_new_files, R.string.welcome_feature_2_title, R.string.welcome_feature_2_text, "1.0.0", "0", SHOW_ON_FIRST_RUN),
new FeatureItem(R.drawable.whats_new_share, R.string.welcome_feature_3_title, R.string.welcome_feature_3_text, "1.0.0", "0" ,SHOW_ON_FIRST_RUN),
new FeatureItem(R.drawable.whats_new_accounts, R.string.welcome_feature_4_title, R.string.welcome_feature_4_text, "1.0.0", "0", SHOW_ON_FIRST_RUN),
// Features introduced in certain point in time
};
static public FeatureItem[] get() {
return featuresList;
}
static public FeatureItem[] getFiltered(final int lastSeenVersionCode, final boolean isFirstRun, boolean isBeta) {
List<FeatureItem> features = new LinkedList<>();
for (FeatureItem item : get()) {
final int itemVersionCode = isBeta ? item.getBetaVersionNumber() : item.getVersionNumber();
if (isFirstRun && item.shouldShowOnFirstRun()) {
features.add(item);
} else if (!isFirstRun && !item.shouldShowOnFirstRun() &&
MainApp.getVersionCode() >= itemVersionCode &&
lastSeenVersionCode < itemVersionCode) {
features.add(item);
}
}
return features.toArray(new FeatureItem[features.size()]);
}
static public class FeatureItem implements Parcelable {
public static final int DO_NOT_SHOW = -1;
private int image;
private int titleText;
private int contentText;
private int versionNumber;
private int betaVersion;
private boolean showOnInitialRun;
public FeatureItem(int image, int titleText, int contentText, String version, String betaVersion) {
this(image, titleText, contentText, version, betaVersion, false);
}
public FeatureItem(int image, int titleText, int contentText, String version, String betaVersion, boolean showOnInitialRun) {
this.image = image;
this.titleText = titleText;
this.contentText = contentText;
this.versionNumber = versionCodeFromString(version);
this.betaVersion = Integer.parseInt(betaVersion);
this.showOnInitialRun = showOnInitialRun;
}
public boolean shouldShowImage() { return image != DO_NOT_SHOW; }
public int getImage() { return image; }
public boolean shouldShowTitleText() { return titleText != DO_NOT_SHOW; }
public int getTitleText() { return titleText; }
public boolean shouldShowContentText() { return contentText != DO_NOT_SHOW; }
public int getContentText() { return contentText; }
public int getVersionNumber() { return versionNumber; }
public int getBetaVersionNumber() { return betaVersion; }
public boolean shouldShowOnFirstRun() { return showOnInitialRun; }
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(image);
dest.writeInt(titleText);
dest.writeInt(contentText);
dest.writeInt(versionNumber);
dest.writeInt(betaVersion);
dest.writeByte((byte) (showOnInitialRun ? 1 : 0));
}
private FeatureItem(Parcel p) {
image = p.readInt();
titleText = p.readInt();
contentText = p.readInt();
versionNumber = p.readInt();
betaVersion = p.readInt();
showOnInitialRun = p.readByte() == 1;
}
public static final Parcelable.Creator CREATOR =
new Parcelable.Creator() {
@Override
public Object createFromParcel(Parcel source) {
return new FeatureItem(source);
}
@Override
public Object[] newArray(int size) {
return new FeatureItem[size];
}
};
}
static int versionCodeFromString(String version) {
String v[] = version.split(Pattern.quote("."));
if (v.length != 3) {
Log_OC.wtf("FeatureList", "Version string is incorrect " + version);
return 0;
}
int result = Integer.parseInt(v[0])*(int)(10e6) +
Integer.parseInt(v[1])*(int)(10e4) +
Integer.parseInt(v[2])*100;
return result;
}
}
+4 -4
View File
@@ -92,9 +92,9 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
return;
}
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
Account account = AccountUtils.getInstantUploadAccount(context);
if (account == null) {
Log_OC.w(TAG, "No account found for instant upload, aborting");
Log_OC.w(TAG, "No account found for instant photo upload, aborting");
return;
}
@@ -175,9 +175,9 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
return;
}
Account account = AccountUtils.getCurrentOwnCloudAccount(context);
Account account = AccountUtils.getInstantVideoUploadAccount(context);
if (account == null) {
Log_OC.w(TAG, "No account found for instant upload, aborting");
Log_OC.w(TAG, "No account found for instant video upload, aborting");
return;
}
@@ -954,9 +954,10 @@ public class FileUploader extends Service
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
new ThumbnailsCacheManager.ThumbnailGenerationTask(mStorageManager, mCurrentAccount);
Object[] params = new Object[2];
params[0] = new File(mCurrentUpload.getOriginalStoragePath());
params[1] = mCurrentUpload.getFile().getRemoteId();
Object[] params = new Object[3];
params[0] = mCurrentUpload.getFile();
params[1] = true;
params[2] = mCurrentUpload.getFile().getRemoteId();
task.execute(params);
}
@@ -39,6 +39,7 @@ import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.syncadapter.FileSyncAdapter;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.utils.MimeTypeUtil;
import java.util.ArrayList;
import java.util.HashMap;
@@ -404,7 +405,7 @@ public class RefreshFolderOperation extends RemoteOperation {
updatedFile.setEtag(localFile.getEtag());
if (updatedFile.isFolder()) {
updatedFile.setFileLength(remoteFile.getFileLength());
} else if (mRemoteFolderChanged && remoteFile.isImage() &&
} else if (mRemoteFolderChanged && MimeTypeUtil.isImage(remoteFile) &&
remoteFile.getModificationTimestamp() !=
localFile.getModificationTimestamp()) {
updatedFile.setNeedsUpdateThumbnail(true);
@@ -20,19 +20,11 @@
package com.owncloud.android.operations;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader;
@@ -47,7 +39,14 @@ import com.owncloud.android.lib.resources.files.RemoteFile;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.utils.MimeTypeUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -329,7 +328,7 @@ public class SynchronizeFolderOperation extends SyncOperation {
if (updatedFile.isFolder()) {
updatedFile.setFileLength(localFile.getFileLength());
// TODO move operations about size of folders to FileContentProvider
} else if (mRemoteFolderChanged && remoteFile.isImage() &&
} else if (mRemoteFolderChanged && MimeTypeUtil.isImage(remoteFile) &&
remoteFile.getModificationTimestamp() !=
localFile.getModificationTimestamp()) {
updatedFile.setNeedsUpdateThumbnail(true);
@@ -47,7 +47,7 @@ import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.utils.ConnectivityUtils;
import com.owncloud.android.utils.FileStorageUtils;
import com.owncloud.android.utils.MimeType;
import com.owncloud.android.utils.MimetypeIconUtil;
import com.owncloud.android.utils.MimeTypeUtil;
import com.owncloud.android.utils.UriUtils;
import org.apache.commons.httpclient.HttpStatus;
@@ -80,7 +80,7 @@ public class UploadFileOperation extends SyncOperation {
// MIME type
if (mimeType == null || mimeType.length() <= 0) {
mimeType = MimetypeIconUtil.getBestMimeTypeByFilename(localPath);
mimeType = MimeTypeUtil.getBestMimeTypeByFilename(localPath);
}
OCFile newFile = new OCFile(remotePath);
@@ -433,15 +433,14 @@ public class UploadFileOperation extends SyncOperation {
if (result.getException() != null) {
if(result.isCancelled()){
Log_OC.w(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath +
": " + result.getLogMessage());
" has been canceled: " + result.getLogMessage());
} else {
Log_OC.e(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath +
": " + result.getLogMessage(), result.getException());
}
} else {
Log_OC.e(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath +
": " + result.getLogMessage());
Log_OC.e(TAG, "Upload of " + mOriginalStoragePath + " to " + mRemotePath + "ResultCode(" +
result.getCode().name() + "): " + result.getLogMessage());
}
}
}
@@ -0,0 +1,49 @@
/**
* Nextcloud Android client application
*
* Copyright (C) 2016 Nextcloud
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3,
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.ui;
import android.content.Context;
import android.preference.Preference;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
public class PreferenceWithTwoLineLongSummary extends Preference{
public PreferenceWithTwoLineLongSummary(Context context) {
super(context);
}
public PreferenceWithTwoLineLongSummary(Context context, AttributeSet attrs) {
super(context, attrs);
}
public PreferenceWithTwoLineLongSummary(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onBindView(View view) {
super.onBindView(view);
TextView titleView = (TextView) view.findViewById(android.R.id.summary);
titleView.setSingleLine(false);
titleView.setMaxLines(2);
titleView.setEllipsize(TextUtils.TruncateAt.MIDDLE);
}
}
@@ -116,7 +116,7 @@ public abstract class BaseActivity extends AppCompatActivity {
Account newAccount = AccountUtils.getCurrentOwnCloudAccount(getApplicationContext());
if (newAccount == null) {
/// no account available: force account creation
createAccount();
createAccount(true);
mRedirectingToSetupAccount = true;
mAccountWasSet = false;
mAccountWasRestored = false;
@@ -129,16 +129,19 @@ public abstract class BaseActivity extends AppCompatActivity {
}
/**
* Launches the account creation activity. To use when no ownCloud account is available.
* Launches the account creation activity.
*
* @param mandatoryCreation When 'true', if an account is not created by the user, the app will be closed.
* To use when no ownCloud account is available.
*/
protected void createAccount() {
protected void createAccount(boolean mandatoryCreation) {
AccountManager am = AccountManager.get(getApplicationContext());
am.addAccount(MainApp.getAccountType(),
null,
null,
null,
this,
new AccountCreationCallback(),
new AccountCreationCallback(mandatoryCreation),
new Handler());
}
@@ -216,6 +219,17 @@ public abstract class BaseActivity extends AppCompatActivity {
*/
public class AccountCreationCallback implements AccountManagerCallback<Bundle> {
boolean mMandatoryCreation;
/**
* Constuctor
*
* @param mandatoryCreation When 'true', if an account was not created, the app is closed.
*/
public AccountCreationCallback(boolean mandatoryCreation) {
mMandatoryCreation = mandatoryCreation;
}
@Override
public void run(AccountManagerFuture<Bundle> future) {
BaseActivity.this.mRedirectingToSetupAccount = false;
@@ -242,7 +256,7 @@ public abstract class BaseActivity extends AppCompatActivity {
} else {
Log_OC.e(TAG, "Account creation callback with null bundle");
}
if (!accountWasSet) {
if (mMandatoryCreation && !accountWasSet) {
moveTaskToBack(true);
}
}
@@ -21,7 +21,7 @@
package com.owncloud.android.ui.activity;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.files.FileOperationsHelper;
import com.owncloud.android.ui.helpers.FileOperationsHelper;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
@@ -3,8 +3,7 @@
*
* @author Andy Scherzinger
* Copyright (C) 2016 Andy Scherzinger
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 ownCloud Inc.
* Copyright (C) 2016 Nextcloud.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -198,7 +197,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
};
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerLayout.addDrawerListener(mDrawerToggle);
mDrawerToggle.setDrawerIndicatorEnabled(true);
}
@@ -277,7 +276,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
startActivity(participateIntent);
break;
case R.id.drawer_menu_account_add:
createAccount();
createAccount(false);
break;
case R.id.drawer_menu_account_manage:
Intent manageAccountsIntent = new Intent(getApplicationContext(),
@@ -796,4 +795,17 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
}
return false;
}
/**
* Adds other listeners to react on changes of the drawer layout.
*
* @param listener Object interested in changes of the drawer layout.
*/
public void addDrawerListener(DrawerLayout.DrawerListener listener) {
if (mDrawerLayout != null) {
mDrawerLayout.addDrawerListener(listener);
} else {
Log_OC.e(TAG, "Drawer layout not ready to add drawer listener");
}
}
}
@@ -0,0 +1,104 @@
/**
* ownCloud Android client application
*
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.owncloud.android.ui.activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import com.owncloud.android.R;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.dialog.LoadingDialog;
import com.owncloud.android.utils.FileStorageUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.lang.ref.WeakReference;
public class ErrorReportActivity extends AppCompatActivity {
private static final String TAG = ErrorReportActivity.class.getSimpleName();
private String mLogText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.error_send);
setTitle(getString(R.string.error_log_title));
Button cancelErrorLogButton = (Button) findViewById(R.id.cancelErrorLogButton);
Button sendErrorLogButton = (Button) findViewById(R.id.sendErrorLogButton);
TextView logTV = (TextView) findViewById(R.id.logTV);
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if (Intent.ACTION_SEND.equals(action) && type != null) {
mLogText = intent.getStringExtra(Intent.EXTRA_TEXT);
} else {
// Handle other intents, such as being started from the home screen
mLogText = "Error, nothing received!";
}
logTV.setText(mLogText);
cancelErrorLogButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finishAffinity();
}
});
sendErrorLogButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
sendMail();
}
});
}
/**
* Start activity for sending email with logs attached
*/
private void sendMail() {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, mLogText);
sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
}
@@ -41,7 +41,7 @@ import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileOperationsHelper;
import com.owncloud.android.ui.helpers.FileOperationsHelper;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader;
@@ -1659,7 +1659,7 @@ public class FileDisplayActivity extends HookActivity
// another window floating over
}
},
DELAY_TO_REQUEST_REFRESH_OPERATION_LATER
DELAY_TO_REQUEST_OPERATIONS_LATER + 350
);
}
@@ -0,0 +1,54 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 ownCloud Inc.
* Copyright (C) 2016 Nextcloud
* Copyright (C) 2016 Bartosz Przybylski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.owncloud.android.R;
/**
* Created by Bartosz Przybylski on 07.11.2015.
*/
public class LocalDirectorySelectorActivity extends UploadFilesActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mUploadBtn.setText(R.string.folder_picker_choose_button_text);
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.upload_files_btn_cancel) {
setResult(RESULT_CANCELED);
finish();
} else if (v.getId() == R.id.upload_files_btn_upload) {
Intent resultIntent = new Intent();
resultIntent.putExtra(EXTRA_CHOSEN_FILES, getInitialDirectory().getAbsolutePath());
setResult(RESULT_OK, resultIntent);
finish();
}
}
}
@@ -32,12 +32,17 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.owncloud.android.MainApp;
@@ -45,13 +50,13 @@ import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.files.FileOperationsHelper;
import com.owncloud.android.files.services.FileDownloader;
import com.owncloud.android.files.services.FileUploader;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.ui.adapter.AccountListAdapter;
import com.owncloud.android.ui.adapter.AccountListItem;
import com.owncloud.android.ui.helpers.FileOperationsHelper;
import java.util.ArrayList;
import java.util.HashSet;
@@ -75,11 +80,16 @@ public class ManageAccountsActivity extends FileActivity
private ServiceConnection mDownloadServiceConnection, mUploadServiceConnection = null;
Set<String> mOriginalAccounts;
String mOriginalCurrentAccount;
private Drawable mTintedCheck;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mTintedCheck = DrawableCompat.wrap(ContextCompat.getDrawable(this, R.drawable.ic_account_circle_white_18dp));
int tint = ContextCompat.getColor(this, R.color.primary);
DrawableCompat.setTint(mTintedCheck, tint);
setContentView(R.layout.accounts_layout);
mListView = (ListView) findViewById(R.id.account_list);
@@ -94,10 +104,17 @@ public class ManageAccountsActivity extends FileActivity
setAccount(AccountUtils.getCurrentOwnCloudAccount(this));
onAccountSet(false);
mAccountListAdapter = new AccountListAdapter(this, getAccountListItems());
mAccountListAdapter = new AccountListAdapter(this, getAccountListItems(),mTintedCheck);
mListView.setAdapter(mAccountListAdapter);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switchAccount(mAccountListAdapter.getItem(position).getAccount());
}
});
initializeComponentGetters();
}
@@ -108,7 +125,7 @@ public class ManageAccountsActivity extends FileActivity
* @return set of account names
*/
private Set<String> toAccountNameSet(Account[] accountList) {
Set<String> actualAccounts = new HashSet<String>(accountList.length);
Set<String> actualAccounts = new HashSet<>(accountList.length);
for (Account account : accountList) {
actualAccounts.add(account.name);
}
@@ -143,7 +160,7 @@ public class ManageAccountsActivity extends FileActivity
*/
private boolean hasCurrentAccountChanged() {
Account account = AccountUtils.getCurrentOwnCloudAccount(this);
if (account == null){
if (account == null) {
return true;
} else {
return !mOriginalCurrentAccount.equals(account.name);
@@ -231,8 +248,11 @@ public class ManageAccountsActivity extends FileActivity
Bundle result = future.getResult();
String name = result.getString(AccountManager.KEY_ACCOUNT_NAME);
AccountUtils.setCurrentOwnCloudAccount(getApplicationContext(), name);
mAccountListAdapter = new AccountListAdapter(ManageAccountsActivity
.this, getAccountListItems());
mAccountListAdapter = new AccountListAdapter(
ManageAccountsActivity.this,
getAccountListItems(),
mTintedCheck
);
mListView.setAdapter(mAccountListAdapter);
runOnUiThread(new Runnable() {
@Override
@@ -250,6 +270,20 @@ public class ManageAccountsActivity extends FileActivity
}, mHandler);
}
public void switchAccount(Account account) {
if (getAccount().name.equals(account.name)) {
// current account selected, just go back
finish();
} else {
// restart list of files with new account
AccountUtils.setCurrentOwnCloudAccount(ManageAccountsActivity.this, account.name);
Intent i = new Intent(ManageAccountsActivity.this, FileDisplayActivity.class);
i.putExtra(FileActivity.EXTRA_ACCOUNT, account);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
}
@Override
public void run(AccountManagerFuture<Boolean> future) {
if (future.isDone()) {
@@ -274,7 +308,7 @@ public class ManageAccountsActivity extends FileActivity
AccountUtils.setCurrentOwnCloudAccount(this, accountName);
}
mAccountListAdapter = new AccountListAdapter(this, getAccountListItems());
mAccountListAdapter = new AccountListAdapter(this, getAccountListItems(), mTintedCheck);
mListView.setAdapter(mAccountListAdapter);
}
}
@@ -5,6 +5,7 @@
* @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
* Copyright (C) 2016 ownCloud Inc.
* Copyright (C) 2016 Nextcloud
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@@ -30,8 +31,11 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
@@ -55,21 +59,30 @@ import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.datastorage.DataStorageProvider;
import com.owncloud.android.datastorage.StoragePoint;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.PreferenceWithTwoLineLongSummary;
import com.owncloud.android.utils.DisplayUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.ExecutionException;
/**
* An Activity that allows the user to change the application's settings.
*
* It proxies the necessary calls via {@link android.support.v7.app.AppCompatDelegate} to be used
* with AppCompat.
* It proxies the necessary calls via {@link android.support.v7.app.AppCompatDelegate} to be used with AppCompat.
*/
public class Preferences extends PreferenceActivity {
public class Preferences extends PreferenceActivity
implements StorageMigration.StorageMigrationProgressListener {
private static final String TAG = Preferences.class.getSimpleName();
@@ -85,13 +98,35 @@ public class Preferences extends PreferenceActivity {
*/
private Uri mUri;
public static final String INSTANT_UPLOAD_PATH_ACCOUNT = "instant_upload_path_account";
public static final String INSTANT_UPLOAD_PATH = "instant_upload_path";
public static final String INSTANT_VIDEO_UPLOAD_PATH = "instant_video_upload_path";
public static final String INSTANT_VIDEO_UPLOAD_PATH_ACCOUNT = "instant_video_upload_path_account";
public static final String INSTANT_VIDEO_UPLOAD_PATH_USE_SUBFOLDERS = "instant_video_upload_path_use_subfolders";
public static final String INSTANT_VIDEO_UPLOAD_ON_WIFI = "instant_video_upload_on_wifi";
public static final String INSTANT_VIDEO_UPLOADING = "instant_video_uploading";
public static final String PREFS_INSTANT_BEHAVIOUR = "prefs_instant_behaviour";
public static final String ABOUT_APP = "about_app";
public static final String INSTANT_UPLOADING_CATEGORY = "instant_uploading_category";
public static final String INSTANT_UPLOAD_PATH_USE_SUBFOLDERS = "instant_upload_path_use_subfolders";
public static final String INSTANT_UPLOAD_ON_WIFI = "instant_upload_on_wifi";
public static final String INSTANT_UPLOADING = "instant_uploading";
public static final String LOGGER = "logger";
public static final String FEEDBACK = "feedback";
public static final String RECOMMEND = "recommend";
public static final String MORE = "more";
public static final String HELP = "help";
private static String INSTANT_UPLOAD_ACCOUNT_LABEL;
private static String INSTANT_UPLOAD_PATH_LABEL;
private CheckBoxPreference pCode;
private CheckBoxPreference mShowHiddenFiles;
private Preference pAboutApp;
private AppCompatDelegate mDelegate;
private PreferenceCategory mAccountsPrefCategory = null;
private String mUploadPath;
private String mUploadPathAccount;
private PreferenceCategory mPrefInstantUploadCategory;
private Preference mPrefInstantUpload;
private Preference mPrefInstantUploadBehaviour;
@@ -105,6 +140,15 @@ public class Preferences extends PreferenceActivity {
private Preference mPrefInstantVideoUploadPathWiFi;
private Preference mPrefInstantVideoUploadOnlyOnCharging;
private String mUploadVideoPath;
private String mUploadVideoPathAccount;
private ListPreference mPrefStoragePath;
private String mStoragePath;
public static class Keys {
public static final String STORAGE_PATH = "storage_path";
public static final String INSTANT_UPLOAD_PATH = "instant_upload_path";
public static final String INSTANT_VIDEO_UPLOAD_PATH = "instant_video_upload_path";
}
@SuppressWarnings("deprecation")
@Override
@@ -128,7 +172,6 @@ public class Preferences extends PreferenceActivity {
getWindow().getDecorView().findViewById(actionBarTitleId).
setContentDescription(getString(R.string.actionbar_settings));
}
// Load package info
String temp;
try {
@@ -137,9 +180,9 @@ public class Preferences extends PreferenceActivity {
} catch (NameNotFoundException e) {
temp = "";
Log_OC.e(TAG, "Error while showing about dialog", e);
}
}
final String appVersion = temp;
// Register context menu for list of preferences.
registerForContextMenu(getListView());
@@ -178,7 +221,7 @@ public class Preferences extends PreferenceActivity {
}
});
PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference("more");
PreferenceCategory preferenceCategory = (PreferenceCategory) findPreference(MORE);
boolean calendarContactsEnabled = getResources().getBoolean(R.bool.calendar_contacts_enabled);
Preference pCalendarContacts = findPreference("calendar_contacts");
@@ -204,9 +247,30 @@ public class Preferences extends PreferenceActivity {
preferenceCategory.removePreference(pCalendarContacts);
}
}
final Preference pCacheSize = findPreference("pref_cache_size");
if (pCacheSize != null){
final SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
Long cacheSize = ThumbnailsCacheManager.getMaxSize();
pCacheSize.setSummary(cacheSize + " Mb");
pCacheSize.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
int size = Integer.decode((String) newValue);
if (ThumbnailsCacheManager.setMaxSize(size)){
appPrefs.edit().putInt("pref_cache_size", size);
pCacheSize.setSummary(size + " MB");
return true;
} else {
return false;
}
}
});
}
boolean helpEnabled = getResources().getBoolean(R.bool.help_enabled);
Preference pHelp = findPreference("help");
Preference pHelp = findPreference(HELP);
if (pHelp != null ){
if (helpEnabled) {
pHelp.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@@ -225,34 +289,33 @@ public class Preferences extends PreferenceActivity {
preferenceCategory.removePreference(pHelp);
}
}
boolean recommendEnabled = getResources().getBoolean(R.bool.recommend_enabled);
Preference pRecommend = findPreference("recommend");
Preference pRecommend = findPreference(RECOMMEND);
if (pRecommend != null){
if (recommendEnabled) {
pRecommend.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Intent intent = new Intent(Intent.ACTION_SENDTO);
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType("text/plain");
intent.setData(Uri.parse(getString(R.string.mail_recommend)));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(getString(R.string.mail_recommend)));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
String appName = getString(R.string.app_name);
String downloadUrl = getString(R.string.url_app_download);
String recommendSubject =
String.format(getString(R.string.recommend_subject),
appName);
String.format(getString(R.string.recommend_subject), appName);
String recommendText = String.format(getString(R.string.recommend_text),
appName, downloadUrl);
intent.putExtra(Intent.EXTRA_SUBJECT, recommendSubject);
intent.putExtra(Intent.EXTRA_TEXT, recommendText);
startActivity(intent);
return(true);
return true;
}
});
@@ -260,25 +323,25 @@ public class Preferences extends PreferenceActivity {
preferenceCategory.removePreference(pRecommend);
}
}
boolean feedbackEnabled = getResources().getBoolean(R.bool.feedback_enabled);
Preference pFeedback = findPreference("feedback");
Preference pFeedback = findPreference(FEEDBACK);
if (pFeedback != null){
if (feedbackEnabled) {
pFeedback.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
String feedbackMail =(String) getText(R.string.mail_feedback);
String feedback =(String) getText(R.string.prefs_feedback) +
String feedbackMail = (String) getText(R.string.mail_feedback);
String feedback = getText(R.string.prefs_feedback) +
" - android v" + appVersion;
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, feedback);
intent.setData(Uri.parse(feedbackMail));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(feedbackMail));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
return true;
}
});
@@ -288,7 +351,7 @@ public class Preferences extends PreferenceActivity {
}
boolean loggerEnabled = getResources().getBoolean(R.bool.logger_enabled) || BuildConfig.DEBUG;
Preference pLogger = findPreference("logger");
Preference pLogger = findPreference(LOGGER);
if (pLogger != null){
if (loggerEnabled) {
pLogger.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@@ -327,7 +390,38 @@ public class Preferences extends PreferenceActivity {
}
}
mPrefInstantUploadPath = findPreference("instant_upload_path");
mPrefStoragePath = (ListPreference) findPreference(Keys.STORAGE_PATH);
if (mPrefStoragePath != null) {
StoragePoint[] storageOptions = DataStorageProvider.getInstance().getAvailableStoragePoints();
String[] entries = new String[storageOptions.length];
String[] values = new String[storageOptions.length];
for (int i = 0; i < storageOptions.length; ++i) {
entries[i] = storageOptions[i].getDescription();
values[i] = storageOptions[i].getPath();
}
mPrefStoragePath.setEntries(entries);
mPrefStoragePath.setEntryValues(values);
mPrefStoragePath.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
String newPath = (String)newValue;
if (mStoragePath.equals(newPath))
return true;
StorageMigration storageMigration = new StorageMigration(Preferences.this, mStoragePath, newPath);
storageMigration.setStorageMigrationProgressListener(Preferences.this);
storageMigration.migrate();
return false;
}
});
}
mPrefInstantUploadPath = (PreferenceWithTwoLineLongSummary)findPreference(Keys.INSTANT_UPLOAD_PATH);
if (mPrefInstantUploadPath != null){
mPrefInstantUploadPath.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@@ -343,19 +437,19 @@ public class Preferences extends PreferenceActivity {
}
});
}
mPrefInstantUploadCategory =
(PreferenceCategory) findPreference("instant_uploading_category");
mPrefInstantUploadUseSubfolders = findPreference("instant_upload_path_use_subfolders");
mPrefInstantUploadPathWiFi = findPreference("instant_upload_on_wifi");
mPrefInstantUploadCategory =
(PreferenceCategory) findPreference(INSTANT_UPLOADING_CATEGORY);
mPrefInstantUploadUseSubfolders = findPreference(INSTANT_UPLOAD_PATH_USE_SUBFOLDERS);
mPrefInstantUploadPathWiFi = findPreference(INSTANT_UPLOAD_ON_WIFI);
mPrefInstantUpload = findPreference(INSTANT_UPLOADING);
mPrefInstantPictureUploadOnlyOnCharging = findPreference("instant_upload_on_charging");
mPrefInstantUpload = findPreference("instant_uploading");
toggleInstantPictureOptions(((CheckBoxPreference) mPrefInstantUpload).isChecked());
mPrefInstantUpload.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
toggleInstantPictureOptions((Boolean) newValue);
@@ -365,8 +459,8 @@ public class Preferences extends PreferenceActivity {
return true;
}
});
mPrefInstantVideoUploadPath = findPreference("instant_video_upload_path");
mPrefInstantVideoUploadPath = findPreference(Keys.INSTANT_VIDEO_UPLOAD_PATH);
if (mPrefInstantVideoUploadPath != null){
mPrefInstantVideoUploadPath.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@@ -384,12 +478,12 @@ public class Preferences extends PreferenceActivity {
});
}
mPrefInstantVideoUploadUseSubfolders = findPreference("instant_video_upload_path_use_subfolders");
mPrefInstantVideoUploadPathWiFi = findPreference("instant_video_upload_on_wifi");
mPrefInstantVideoUpload = findPreference("instant_video_uploading");
mPrefInstantVideoUploadUseSubfolders = findPreference(INSTANT_VIDEO_UPLOAD_PATH_USE_SUBFOLDERS);
mPrefInstantVideoUploadPathWiFi = findPreference(INSTANT_VIDEO_UPLOAD_ON_WIFI);
mPrefInstantVideoUpload = findPreference(INSTANT_VIDEO_UPLOADING);
mPrefInstantVideoUploadOnlyOnCharging = findPreference("instant_video_upload_on_charging");
toggleInstantVideoOptions(((CheckBoxPreference) mPrefInstantVideoUpload).isChecked());
mPrefInstantVideoUpload.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
@@ -402,21 +496,96 @@ public class Preferences extends PreferenceActivity {
}
});
mPrefInstantUploadBehaviour = findPreference("prefs_instant_behaviour");
mPrefInstantUploadBehaviour = findPreference(PREFS_INSTANT_BEHAVIOUR);
toggleInstantUploadBehaviour(
((CheckBoxPreference)mPrefInstantVideoUpload).isChecked(),
((CheckBoxPreference)mPrefInstantUpload).isChecked());
/* About App */
pAboutApp = (Preference) findPreference("about_app");
pAboutApp = (Preference) findPreference(ABOUT_APP);
if (pAboutApp != null) {
pAboutApp.setTitle(String.format(getString(R.string.about_android),
getString(R.string.app_name)));
pAboutApp.setSummary(String.format(getString(R.string.about_version), appVersion));
try {
Integer currentVersion = getPackageManager().getPackageInfo
(getPackageName(), 0).versionCode;
pAboutApp.setSummary(String.format(getString(R.string.about_version),
currentVersion));
} catch (NameNotFoundException e) {
}
}
INSTANT_UPLOAD_ACCOUNT_LABEL = getResources().getString(R.string.prefs_instant_upload_account);
INSTANT_UPLOAD_PATH_LABEL = getResources().getString(R.string.prefs_instant_upload_path);
INSTANT_UPLOAD_ACCOUNT_LABEL = getResources().getString(R.string.prefs_instant_upload_account);
INSTANT_UPLOAD_PATH_LABEL = getResources().getString(R.string.prefs_instant_upload_path);
INSTANT_UPLOAD_ACCOUNT_LABEL = getResources().getString(R.string.prefs_instant_upload_account);
INSTANT_UPLOAD_PATH_LABEL = getResources().getString(R.string.prefs_instant_upload_path);
loadInstantUploadPath();
loadStoragePath();
loadInstantUploadVideoPath();
/* Link to Beta apks */
Preference pBetaLink = findPreference("beta_link");
if (pBetaLink != null ){
pBetaLink.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
Integer latestVersion = -1;
Integer currentVersion = -1;
try {
currentVersion = getPackageManager().getPackageInfo
(getPackageName(), 0).versionCode;
LoadingVersionNumberTask loadTask = new LoadingVersionNumberTask();
loadTask.execute();
latestVersion = loadTask.get();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
} catch (NameNotFoundException e) {
e.printStackTrace();
}
if (latestVersion == -1 || currentVersion == -1) {
Toast.makeText(getApplicationContext(), "No information available!",
Toast.LENGTH_SHORT).show();
}
if (latestVersion > currentVersion) {
String betaLinkWeb = (String) getText(R.string.beta_link) +
latestVersion + ".apk";
if (betaLinkWeb != null && betaLinkWeb.length() > 0) {
Uri uriUrl = Uri.parse(betaLinkWeb);
Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(intent);
return true;
}
} else {
Toast.makeText(getApplicationContext(), "No new version available!",
Toast.LENGTH_SHORT).show();
return true;
}
return true;
}
});
}
/* Link to beta changelog */
Preference pChangelogLink = findPreference("changelog_link");
if (pChangelogLink != null) {
pChangelogLink.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
String betaLinkWeb = getString(R.string.changelog);
if (betaLinkWeb != null && betaLinkWeb.length() > 0) {
Uri uriUrl = Uri.parse(betaLinkWeb);
Intent intent = new Intent(Intent.ACTION_VIEW, uriUrl);
startActivity(intent);
return true;
}
return true;
}
});
}
}
private void launchDavDroidLogin()
@@ -488,7 +657,7 @@ public class Preferences extends PreferenceActivity {
mPrefInstantUploadCategory.removePreference(mPrefInstantPictureUploadOnlyOnCharging);
}
}
private void toggleInstantVideoOptions(Boolean value){
if (value){
mPrefInstantUploadCategory.addPreference(mPrefInstantVideoUploadPathWiFi);
@@ -550,29 +719,31 @@ public class Preferences extends PreferenceActivity {
if (requestCode == ACTION_SELECT_UPLOAD_PATH && resultCode == RESULT_OK){
OCFile folderToUpload =
(OCFile) data.getParcelableExtra(UploadPathActivity.EXTRA_FOLDER);
OCFile folderToUpload = data.getParcelableExtra(UploadPathActivity.EXTRA_FOLDER);
mUploadPath = folderToUpload.getRemotePath();
mUploadPath = DisplayUtils.getPathWithoutLastSlash(mUploadPath);
mUploadPathAccount = AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()).name;
// Show the path on summary preference
mPrefInstantUploadPath.setSummary(mUploadPath);
mPrefInstantUploadPath.setSummary(getUploadAccountPath(mUploadPathAccount, mUploadPath));
saveInstantUploadPathOnPreferences();
} else if (requestCode == ACTION_SELECT_UPLOAD_VIDEO_PATH && resultCode == RESULT_OK){
} else if (requestCode == ACTION_SELECT_UPLOAD_VIDEO_PATH && resultCode == RESULT_OK) {
OCFile folderToUploadVideo =
(OCFile) data.getParcelableExtra(UploadPathActivity.EXTRA_FOLDER);
OCFile folderToUploadVideo = data.getParcelableExtra(UploadPathActivity.EXTRA_FOLDER);
mUploadVideoPath = folderToUploadVideo.getRemotePath();
mUploadVideoPath = DisplayUtils.getPathWithoutLastSlash(mUploadVideoPath);
mUploadVideoPathAccount = AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()).name;
// Show the video path on summary preference
mPrefInstantVideoUploadPath.setSummary(mUploadVideoPath);
mPrefInstantVideoUploadPath.setSummary(getUploadAccountPath(mUploadVideoPathAccount, mUploadVideoPath));
saveInstantUploadVideoPathOnPreferences();
} else if (requestCode == ACTION_REQUEST_PASSCODE && resultCode == RESULT_OK) {
@@ -681,24 +852,64 @@ public class Preferences extends PreferenceActivity {
return mDelegate;
}
/**
* Returns a combined string of accountName and uploadPath to be displayed to user.
*/
private String getUploadAccountPath(String accountName, String uploadPath) {
return INSTANT_UPLOAD_ACCOUNT_LABEL + ": " + accountName + "\n"
+ INSTANT_UPLOAD_PATH_LABEL + ": " + uploadPath;
}
/**
* Load upload path set on preferences
*/
private void loadInstantUploadPath() {
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
mUploadPath = appPrefs.getString("instant_upload_path", getString(R.string.instant_upload_path));
mPrefInstantUploadPath.setSummary(mUploadPath);
mUploadPath = appPrefs.getString(INSTANT_UPLOAD_PATH, getString(R.string.instant_upload_path));
mUploadPathAccount = appPrefs.getString(INSTANT_UPLOAD_PATH_ACCOUNT,
AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()).name);
mPrefInstantUploadPath.setSummary(getUploadAccountPath(mUploadPathAccount, mUploadPath));
}
/**
* Save the "Instant Upload Path" on preferences
* Save storage path
*/
private void saveStoragePath(String newStoragePath) {
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
mStoragePath = newStoragePath;
MainApp.setStoragePath(mStoragePath);
SharedPreferences.Editor editor = appPrefs.edit();
editor.putString(Keys.STORAGE_PATH, mStoragePath);
editor.commit();
String storageDescription = DataStorageProvider.getInstance().getStorageDescriptionByPath(mStoragePath);
mPrefStoragePath.setSummary(storageDescription);
mPrefStoragePath.setValue(newStoragePath);
}
/**
* Load storage path set on preferences
*/
private void loadStoragePath() {
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
mStoragePath = appPrefs.getString(Keys.STORAGE_PATH, Environment.getExternalStorageDirectory()
.getAbsolutePath());
String storageDescription = DataStorageProvider.getInstance().getStorageDescriptionByPath(mStoragePath);
mPrefStoragePath.setSummary(storageDescription);
}
/**
* Save the "Instant Upload Path" and corresponding account on preferences
*/
private void saveInstantUploadPathOnPreferences() {
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = appPrefs.edit();
editor.putString("instant_upload_path", mUploadPath);
editor.putString(INSTANT_UPLOAD_PATH, mUploadPath)
.putString(INSTANT_UPLOAD_PATH_ACCOUNT, mUploadPathAccount);
editor.commit();
}
@@ -708,18 +919,58 @@ public class Preferences extends PreferenceActivity {
private void loadInstantUploadVideoPath() {
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
mUploadVideoPath = appPrefs.getString("instant_video_upload_path", getString(R.string.instant_upload_path));
mPrefInstantVideoUploadPath.setSummary(mUploadVideoPath);
mUploadVideoPath = appPrefs.getString(INSTANT_VIDEO_UPLOAD_PATH, getString(R.string.instant_upload_path));
mUploadVideoPathAccount = appPrefs.getString(INSTANT_VIDEO_UPLOAD_PATH_ACCOUNT,
AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext()).name);
mPrefInstantVideoUploadPath.setSummary(getUploadAccountPath(mUploadVideoPathAccount, mUploadVideoPath));
}
/**
* Save the "Instant Video Upload Path" on preferences
* Save the "Instant Video Upload Path" and corresponding account on preferences
*/
private void saveInstantUploadVideoPathOnPreferences() {
SharedPreferences appPrefs =
PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
SharedPreferences.Editor editor = appPrefs.edit();
editor.putString("instant_video_upload_path", mUploadVideoPath);
editor.putString(INSTANT_VIDEO_UPLOAD_PATH, mUploadVideoPath)
.putString(INSTANT_VIDEO_UPLOAD_PATH_ACCOUNT, mUploadVideoPathAccount);
editor.commit();
}
@Override
public void onStorageMigrationFinished(String storagePath, boolean succeed) {
if (succeed)
saveStoragePath(storagePath);
}
@Override
public void onCancelMigration() {
// Migration was canceled so we don't do anything
}
/**
*
* Class for loading the version number
*
*/
private class LoadingVersionNumberTask extends AsyncTask<Void, Void, Integer> {
protected Integer doInBackground(Void... args) {
try {
URL url = new URL(getString(R.string.beta_latest));
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
Integer latestVersion = Integer.parseInt(in.readLine());
in.close();
return latestVersion;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return -1;
}
}
}
@@ -42,9 +42,8 @@ import com.owncloud.android.operations.CreateShareViaLinkOperation;
import com.owncloud.android.operations.GetSharesForFileOperation;
import com.owncloud.android.operations.UnshareOperation;
import com.owncloud.android.operations.UpdateSharePermissionsOperation;
import com.owncloud.android.providers.UsersAndGroupsSearchProvider;
import org.nextcloud.providers.UsersAndGroupsSearchProvider;
import com.owncloud.android.ui.dialog.ShareLinkToDialog;
import com.owncloud.android.ui.dialog.SharePasswordDialogFragment;
import com.owncloud.android.ui.fragment.EditShareFragment;
import com.owncloud.android.ui.fragment.SearchShareesFragment;
import com.owncloud.android.ui.fragment.ShareFileFragment;
@@ -0,0 +1,424 @@
/**
* Nextcloud Android client application
*
* @author Bartosz Przybylski
* Copyright (C) 2016 Bartosz Przybylski
* Copyright (C) 2016 Nextcloud
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or 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.ui.activity;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.ProgressDialog;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.AsyncTask;
import android.view.View;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.utils.FileStorageUtils;
import java.io.File;
/**
* @author Bartosz Przybylski
*/
public class StorageMigration {
private static final String TAG = StorageMigration.class.getName();
public interface StorageMigrationProgressListener {
void onStorageMigrationFinished(String storagePath, boolean succeed);
void onCancelMigration();
}
private ProgressDialog mProgressDialog;
private Context mContext;
private String mSourceStoragePath;
private String mTargetStoragePath;
private StorageMigrationProgressListener mListener;
public StorageMigration(Context context, String sourcePath, String targetPath) {
mContext = context;
mSourceStoragePath = sourcePath;
mTargetStoragePath = targetPath;
}
public void setStorageMigrationProgressListener(StorageMigrationProgressListener listener) {
mListener = listener;
}
public void migrate() {
if (storageFolderAlreadyExists())
askToOverride();
else {
ProgressDialog progressDialog = createMigrationProgressDialog();
progressDialog.show();
new FileMigrationTask(
mContext,
mSourceStoragePath,
mTargetStoragePath,
progressDialog,
mListener).execute();
progressDialog.getButton(progressDialog.BUTTON_POSITIVE).setVisibility(View.GONE);
}
}
private boolean storageFolderAlreadyExists() {
File f = new File(mTargetStoragePath, MainApp.getDataFolder());
return f.exists() && f.isDirectory();
}
private void askToOverride() {
new AlertDialog.Builder(mContext)
.setMessage(R.string.file_migration_directory_already_exists)
.setCancelable(true)
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
if (mListener != null)
mListener.onCancelMigration();
}
})
.setNegativeButton(R.string.common_cancel, new OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (mListener != null)
mListener.onCancelMigration();
}
})
.setNeutralButton(R.string.file_migration_use_data_folder, new OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ProgressDialog progressDialog = createMigrationProgressDialog();
progressDialog.show();
new StoragePathSwitchTask(
mContext,
mSourceStoragePath,
mTargetStoragePath,
progressDialog,
mListener).execute();
progressDialog.getButton(ProgressDialog.BUTTON_POSITIVE).setVisibility(View.GONE);
}
})
.setPositiveButton(R.string.file_migration_override_data_folder, new OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ProgressDialog progressDialog = createMigrationProgressDialog();
progressDialog.show();
new FileMigrationTask(
mContext,
mSourceStoragePath,
mTargetStoragePath,
progressDialog,
mListener).execute();
progressDialog.getButton(ProgressDialog.BUTTON_POSITIVE).setVisibility(View.GONE);
}
})
.create()
.show();
}
private ProgressDialog createMigrationProgressDialog() {
ProgressDialog progressDialog = new ProgressDialog(mContext);
progressDialog.setCancelable(false);
progressDialog.setTitle(R.string.file_migration_dialog_title);
progressDialog.setMessage(mContext.getString(R.string.file_migration_preparing));
progressDialog.setButton(
ProgressDialog.BUTTON_POSITIVE,
mContext.getString(R.string.drawer_close),
new OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
return progressDialog;
}
abstract static private class FileMigrationTaskBase extends AsyncTask<Void, Integer, Integer> {
protected String mStorageSource;
protected String mStorageTarget;
protected Context mContext;
protected ProgressDialog mProgressDialog;
protected StorageMigrationProgressListener mListener;
protected String mAuthority;
protected Account[] mOcAccounts;
public FileMigrationTaskBase(Context context,
String source,
String target,
ProgressDialog progressDialog,
StorageMigrationProgressListener listener) {
mContext = context;
mStorageSource = source;
mStorageTarget = target;
mProgressDialog = progressDialog;
mListener = listener;
mAuthority = mContext.getString(R.string.authority);
mOcAccounts = AccountManager.get(mContext).getAccountsByType(MainApp.getAccountType());
}
@Override
protected void onProgressUpdate(Integer... progress) {
if (progress.length > 1 && progress[0] != 0) {
mProgressDialog.setMessage(mContext.getString(progress[0]));
}
}
@Override
protected void onPostExecute(Integer code) {
if (code != 0) {
mProgressDialog.setMessage(mContext.getString(code));
} else {
mProgressDialog.setMessage(mContext.getString(R.string.file_migration_ok_finished));
}
boolean succeed = code == 0;
if (succeed) {
mProgressDialog.hide();
} else {
mProgressDialog.getButton(ProgressDialog.BUTTON_POSITIVE).setVisibility(View.VISIBLE);
mProgressDialog.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.image_fail));
}
if (mListener != null) {
mListener.onStorageMigrationFinished(succeed ? mStorageTarget : mStorageSource, succeed);
}
}
protected boolean[] saveAccountsSyncStatus() {
boolean[] syncs = new boolean[mOcAccounts.length];
for (int i = 0; i < mOcAccounts.length; ++i) {
syncs[i] = ContentResolver.getSyncAutomatically(mOcAccounts[i], mAuthority);
}
return syncs;
}
protected void stopAccountsSyncing() {
for (int i = 0; i < mOcAccounts.length; ++i) {
ContentResolver.setSyncAutomatically(mOcAccounts[i], mAuthority, false);
}
}
protected void waitForUnfinishedSynchronizations() {
for (int i = 0; i < mOcAccounts.length; ++i) {
while (ContentResolver.isSyncActive(mOcAccounts[i], mAuthority)) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
Log_OC.w(TAG, "Thread interrupted while waiting for account to end syncing");
Thread.currentThread().interrupt();
}
}
}
}
protected void restoreAccountsSyncStatus(boolean oldSync[]) {
for (int i = 0; i < mOcAccounts.length; ++i) {
ContentResolver.setSyncAutomatically(mOcAccounts[i], mAuthority, oldSync[i]);
}
}
}
static private class StoragePathSwitchTask extends FileMigrationTaskBase {
public StoragePathSwitchTask(Context context,
String source,
String target,
ProgressDialog progressDialog,
StorageMigrationProgressListener listener) {
super(context, source, target, progressDialog, listener);
}
@Override
protected Integer doInBackground(Void... voids) {
publishProgress(R.string.file_migration_preparing);
Log_OC.stopLogging();
boolean[] syncStates = new boolean[0];
try {
publishProgress(R.string.file_migration_saving_accounts_configuration);
syncStates = saveAccountsSyncStatus();
publishProgress(R.string.file_migration_waiting_for_unfinished_sync);
stopAccountsSyncing();
waitForUnfinishedSynchronizations();
} finally {
publishProgress(R.string.file_migration_restoring_accounts_configuration);
restoreAccountsSyncStatus(syncStates);
}
Log_OC.startLogging(mStorageTarget);
return 0;
}
}
static private class FileMigrationTask extends FileMigrationTaskBase {
private class MigrationException extends Exception {
private int mResId;
MigrationException(int resId) {
super();
this.mResId = resId;
}
int getResId() { return mResId; }
}
public FileMigrationTask(Context context,
String source,
String target,
ProgressDialog progressDialog,
StorageMigrationProgressListener listener) {
super(context, source, target, progressDialog, listener);
}
@Override
protected Integer doInBackground(Void... args) {
publishProgress(R.string.file_migration_preparing);
Log_OC.stopLogging();
boolean[] syncState = new boolean[0];
try {
File dstFile = new File(mStorageTarget + File.separator + MainApp.getDataFolder());
deleteRecursive(dstFile);
dstFile.delete();
File srcFile = new File(mStorageSource + File.separator + MainApp.getDataFolder());
srcFile.mkdirs();
publishProgress(R.string.file_migration_checking_destination);
checkDestinationAvailability();
publishProgress(R.string.file_migration_saving_accounts_configuration);
syncState = saveAccountsSyncStatus();
publishProgress(R.string.file_migration_waiting_for_unfinished_sync);
stopAccountsSyncing();
waitForUnfinishedSynchronizations();
publishProgress(R.string.file_migration_migrating);
copyFiles();
publishProgress(R.string.file_migration_updating_index);
updateIndex(mContext);
publishProgress(R.string.file_migration_cleaning);
cleanup();
} catch (MigrationException e) {
rollback();
Log_OC.startLogging(mStorageSource);
return e.getResId();
} finally {
publishProgress(R.string.file_migration_restoring_accounts_configuration);
restoreAccountsSyncStatus(syncState);
}
Log_OC.startLogging(mStorageTarget);
publishProgress(R.string.file_migration_ok_finished);
return 0;
}
void checkDestinationAvailability() throws MigrationException {
File srcFile = new File(mStorageSource);
File dstFile = new File(mStorageTarget);
if (!dstFile.canRead() || !srcFile.canRead())
throw new MigrationException(R.string.file_migration_failed_not_readable);
if (!dstFile.canWrite() || !srcFile.canWrite())
throw new MigrationException(R.string.file_migration_failed_not_writable);
if (new File(dstFile, MainApp.getDataFolder()).exists())
throw new MigrationException(R.string.file_migration_failed_dir_already_exists);
if (dstFile.getFreeSpace() < FileStorageUtils.getFolderSize(new File(srcFile, MainApp.getDataFolder())))
throw new MigrationException(R.string.file_migration_failed_not_enough_space);
}
void copyFiles() throws MigrationException {
File srcFile = new File(mStorageSource + File.separator + MainApp.getDataFolder());
File dstFile = new File(mStorageTarget + File.separator + MainApp.getDataFolder());
copyDirs(srcFile, dstFile);
}
void copyDirs(File src, File dst) throws MigrationException {
if (!dst.mkdirs())
throw new MigrationException(R.string.file_migration_failed_while_coping);
for (File f : src.listFiles()) {
if (f.isDirectory())
copyDirs(f, new File(dst, f.getName()));
else if (!FileStorageUtils.copyFile(f, new File(dst, f.getName())))
throw new MigrationException(R.string.file_migration_failed_while_coping);
}
}
void updateIndex(Context context) throws MigrationException {
FileDataStorageManager manager = new FileDataStorageManager(null, context.getContentResolver());
try {
manager.migrateStoredFiles(mStorageSource, mStorageTarget);
} catch (Exception e) {
Log_OC.e(TAG,e.getMessage(),e);
throw new MigrationException(R.string.file_migration_failed_while_updating_index);
}
}
void cleanup() {
File srcFile = new File(mStorageSource + File.separator + MainApp.getDataFolder());
if (!deleteRecursive(srcFile))
Log_OC.w(TAG, "Migration cleanup step failed");
srcFile.delete();
}
boolean deleteRecursive(File f) {
boolean res = true;
if (f.isDirectory())
for (File c : f.listFiles())
res = deleteRecursive(c) && res;
return f.delete() && res;
}
void rollback() {
File dstFile = new File(mStorageTarget + File.separator + MainApp.getDataFolder());
if (dstFile.exists())
if (!dstFile.delete())
Log_OC.w(TAG, "Rollback step failed");
}
}
}
@@ -68,7 +68,7 @@ public class UploadFilesActivity extends FileActivity implements
private boolean mSelectAll = false;
private LocalFileListFragment mFileListFragment;
private Button mCancelBtn;
private Button mUploadBtn;
protected Button mUploadBtn;
private Spinner mBehaviourSpinner;
private Account mAccountOnCreation;
private DialogFragment mCurrentDialog;
@@ -210,7 +210,7 @@ public class UploadFilesActivity extends FileActivity implements
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.actionbar_sort_title)
.setSingleChoiceItems(R.array.actionbar_sortby, sortOrder ,
.setSingleChoiceItems(R.array.menu_items_sort_by_options, sortOrder ,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
switch (which){
@@ -52,7 +52,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.CheckCurrentCredentialsOperation;
import com.owncloud.android.ui.fragment.UploadListFragment;
import com.owncloud.android.utils.MimetypeIconUtil;
import com.owncloud.android.utils.MimeTypeUtil;
import java.io.File;
@@ -161,7 +161,7 @@ public class UploadListActivity extends FileActivity implements UploadListFragme
private void openFileWithDefault(String localPath) {
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW);
File file = new File(localPath);
String mimetype = MimetypeIconUtil.getBestMimeTypeByFilename(localPath);
String mimetype = MimeTypeUtil.getBestMimeTypeByFilename(localPath);
if ("application/octet-stream".equals(mimetype)) {
mimetype = "*/*";
}
Loaded 100 of 131 files, more files were not shown because too many files have changed in this diff. Show more