diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-10-30 19:22:01 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-10-30 19:22:01 +0300 |
commit | f18c399a55b9e42e98e01ef3b1485d69cc786842 (patch) | |
tree | 6171f3b12cab23e0e9f03733b01d321f6304bcf7 /app/src/main/java/it/niedermann/nextcloud/deck/ui | |
parent | 476d650828c0f6313f3a396de8255cdf799ebaca (diff) | |
parent | 13a720e10b707de7eba17a08c2cd7ff086cc6f24 (diff) |
Merge branch 'master' into java8-desugaring-java-time
# Conflicts:
# app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/helpers/providers/ActivityDataProvider.java
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/ui')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java index 03e63b64f..1c8a84103 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/CardAttachmentsFragment.java @@ -12,7 +12,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.RequiresApi; import androidx.core.app.SharedElementCallback; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; @@ -44,7 +43,6 @@ import it.niedermann.nextcloud.deck.ui.exception.ExceptionDialogFragment; import static android.Manifest.permission.READ_EXTERNAL_STORAGE; import static android.app.Activity.RESULT_OK; import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.KITKAT; import static android.os.Build.VERSION_CODES.M; import static androidx.core.content.PermissionChecker.PERMISSION_GRANTED; import static androidx.core.content.PermissionChecker.checkSelfPermission; @@ -127,7 +125,7 @@ public class CardAttachmentsFragment extends BrandedFragment implements Attachme updateEmptyContentView(); } - if (viewModel.canEdit() && SDK_INT >= KITKAT) { + if (viewModel.canEdit()) { binding.fab.setOnClickListener(v -> pickFile()); binding.fab.show(); binding.attachmentsList.addOnScrollListener(new RecyclerView.OnScrollListener() { @@ -146,7 +144,6 @@ public class CardAttachmentsFragment extends BrandedFragment implements Attachme return binding.getRoot(); } - @RequiresApi(api = KITKAT) public void pickFile() { if (SDK_INT >= M && checkSelfPermission(requireActivity(), READ_EXTERNAL_STORAGE) != PERMISSION_GRANTED) { requestPermissions(new String[]{READ_EXTERNAL_STORAGE}, REQUEST_CODE_ADD_FILE_PERMISSION); @@ -245,7 +242,7 @@ public class CardAttachmentsFragment extends BrandedFragment implements Attachme //noinspection SwitchStatementWithTooFewBranches switch (requestCode) { case REQUEST_CODE_ADD_FILE_PERMISSION: - if (SDK_INT >= KITKAT && checkSelfPermission(requireActivity(), READ_EXTERNAL_STORAGE) == PERMISSION_GRANTED) { + if (checkSelfPermission(requireActivity(), READ_EXTERNAL_STORAGE) == PERMISSION_GRANTED) { pickFile(); } else { Toast.makeText(requireContext(), R.string.cannot_upload_files_without_permission, Toast.LENGTH_LONG).show(); |