From d56afb034ba7875bc3530a27dd3679ec1709a8aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 7 Apr 2020 12:16:48 +0200 Subject: [PATCH] [API] Add Vulcan OneDrive attachment downloading. Add asking for permissions on demand. --- .idea/jarRepositories.xml | 10 ++ app/build.gradle | 3 + app/src/main/AndroidManifest.xml | 3 + .../java/pl/szczodrzynski/edziennik/App.kt | 1 + .../szczodrzynski/edziennik/MainActivity.kt | 2 - .../edziennik/data/api/Errors.kt | 2 + .../helper/OneDriveDownloadAttachment.kt | 103 ++++++++++++++++++ .../LibrusSandboxDownloadAttachment.kt | 8 +- .../data/api/edziennik/vulcan/Vulcan.kt | 54 ++++++++- .../edziennik/data/db/entity/Profile.kt | 3 +- .../ui/modules/login/LoginChooserFragment.kt | 9 +- .../ui/modules/views/AttachmentAdapter.kt | 9 +- .../ui/modules/views/AttachmentsView.kt | 29 +++-- .../edziennik/utils/ProfileImageHolder.kt | 17 +++ .../utils/managers/PermissionManager.kt | 79 ++++++++++++++ app/src/main/res/values-en/strings.xml | 10 +- app/src/main/res/values/errors.xml | 4 + app/src/main/res/values/strings.xml | 11 +- build.gradle | 1 + 19 files changed, 320 insertions(+), 38 deletions(-) create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/helper/OneDriveDownloadAttachment.kt create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/utils/ProfileImageHolder.kt create mode 100644 app/src/main/java/pl/szczodrzynski/edziennik/utils/managers/PermissionManager.kt diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 6afdce41..276cd1ca 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -41,5 +41,15 @@