From bc9fbcf56c73ae8d30a2de2a870707d0e6349ac6 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Mon, 17 Jun 2019 14:54:45 +0300 Subject: [PATCH] Fix permissions issue for Android API >28 --- app/src/main/AndroidManifest.xml | 1 + .../activities/upload/UploadActivity.java | 55 ++++++++++++++----- .../mthmmy/utils/ScrollAwareFABBehavior.java | 3 - 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1e8bf257..3f63279b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,6 +8,7 @@ + 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) takePhoto(); break; + case UPLOAD_REQUEST_STORAGE_CODE: + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED && + zipTask != null) { + Uri[] filesListArray = new Uri[filesList.size()]; + for (int i = 0; i < filesList.size(); ++i) { + filesListArray[i] = filesList.get(i).getFileUri(); + } + + zipTask.execute(filesListArray); + finish(); + } + break; } } diff --git a/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java b/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java index 06a355f2..44c0d4f3 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java +++ b/app/src/main/java/gr/thmmy/mthmmy/utils/ScrollAwareFABBehavior.java @@ -38,9 +38,7 @@ public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior 0 || (!target.canScrollVertically(-1) && dyConsumed == 0 && dyUnconsumed > 50)) { - Log.d("THISSSS", "GOT_HIDE"); child.hide(new FloatingActionButton.OnVisibilityChangedListener() { @Override public void onHidden(FloatingActionButton fab) { @@ -50,7 +48,6 @@ public class ScrollAwareFABBehavior extends CoordinatorLayout.Behavior