diff --git a/data/src/main/java/org/cryptomator/data/cloud/local/LocalStorageContentRepositoryFactory.java b/data/src/main/java/org/cryptomator/data/cloud/local/LocalStorageContentRepositoryFactory.java index 1a7427a6..c3ea26b0 100644 --- a/data/src/main/java/org/cryptomator/data/cloud/local/LocalStorageContentRepositoryFactory.java +++ b/data/src/main/java/org/cryptomator/data/cloud/local/LocalStorageContentRepositoryFactory.java @@ -1,7 +1,6 @@ package org.cryptomator.data.cloud.local; import android.content.Context; -import android.os.Build; import org.cryptomator.data.cloud.local.file.LocalStorageContentRepository; import org.cryptomator.data.cloud.local.storageaccessframework.LocalStorageAccessFrameworkContentRepository; @@ -43,7 +42,7 @@ public class LocalStorageContentRepositoryFactory implements CloudContentReposit if (!hasPermissions(WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE)) { throw new NoAuthenticationProvidedException(cloud); } - if (((LocalStorageCloud) cloud).rootUri() != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (((LocalStorageCloud) cloud).rootUri() != null) { return new LocalStorageAccessFrameworkContentRepository(context, mimeTypes, (LocalStorageCloud) cloud); } else { return new LocalStorageContentRepository(context, (LocalStorageCloud) cloud); diff --git a/presentation/src/main/java/org/cryptomator/presentation/model/CloudTypeModel.kt b/presentation/src/main/java/org/cryptomator/presentation/model/CloudTypeModel.kt index a9c3dfcf..74f9d2b6 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/model/CloudTypeModel.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/model/CloudTypeModel.kt @@ -1,6 +1,5 @@ package org.cryptomator.presentation.model -import android.os.Build import org.cryptomator.domain.CloudType import org.cryptomator.presentation.R @@ -22,14 +21,13 @@ enum class CloudTypeModel(builder: Builder) { .withMultiInstances()), // LOCAL(Builder("LOCAL", R.string.cloud_names_local_storage) // .withCloudImageResource(R.drawable.storage_type_local) // - .withCloudImageLargeResource(R.drawable.storage_type_local_large) // - .withMultiInstancesIfLollipopOrLater()); + .withCloudImageLargeResource(R.drawable.storage_type_local_large)); - val cloudName: String - val displayNameResource: Int - val cloudImageResource: Int - val cloudImageLargeResource: Int - val isMultiInstance: Boolean + val cloudName: String = builder.cloudName + val displayNameResource: Int = builder.displayNameResource + val cloudImageResource: Int = builder.cloudImageResource + val cloudImageLargeResource: Int = builder.cloudImageLargeResource + val isMultiInstance: Boolean = builder.multiInstances private class Builder(val cloudName: String, val displayNameResource: Int) { var cloudImageResource = 0 @@ -50,11 +48,6 @@ enum class CloudTypeModel(builder: Builder) { multiInstances = true return this } - - fun withMultiInstancesIfLollipopOrLater(): Builder { - multiInstances = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP - return this - } } companion object { @@ -66,12 +59,4 @@ enum class CloudTypeModel(builder: Builder) { return CloudType.valueOf(type.name) } } - - init { - cloudName = builder.cloudName - displayNameResource = builder.displayNameResource - cloudImageResource = builder.cloudImageResource - cloudImageLargeResource = builder.cloudImageLargeResource - isMultiInstance = builder.multiInstances - } } diff --git a/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt b/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt index c3f9f7fe..d053b17a 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt @@ -673,22 +673,11 @@ class BrowseFilesPresenter @Inject constructor( // } fun onExportFileClicked(cloudFile: CloudFileModel, trigger: ExportOperation) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - exportFileToDownloadDirectory(cloudFile, trigger) - } else { - exportFileToUserSelectedLocation(cloudFile, trigger) - } + exportFileToUserSelectedLocation(cloudFile, trigger) } fun onExportNodesClicked(selectedCloudFiles: ArrayList>, trigger: ExportOperation) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - exportNodesToUserSelectedLocation(selectedCloudFiles, trigger) - } - } - - private fun exportFileToDownloadDirectory(fileToExport: CloudFileModel, exportOperation: ExportOperation) { - requestPermissions(PermissionsResultCallbacks.exportFileToDownloadDirectory(fileToExport, exportOperation), // - R.string.permission_message_export_file, Manifest.permission.WRITE_EXTERNAL_STORAGE) + exportNodesToUserSelectedLocation(selectedCloudFiles, trigger) } @Callback diff --git a/presentation/src/main/java/org/cryptomator/presentation/presenter/CloudConnectionListPresenter.kt b/presentation/src/main/java/org/cryptomator/presentation/presenter/CloudConnectionListPresenter.kt index e4e565ac..b4a11094 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/presenter/CloudConnectionListPresenter.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/presenter/CloudConnectionListPresenter.kt @@ -103,7 +103,7 @@ class CloudConnectionListPresenter @Inject constructor( // } private fun releaseUriPermissionForLocalStorageCloud(cloudModel: LocalStorageModel) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && (cloudModel.toCloud() as LocalStorageCloud).rootUri() != null) { + if ((cloudModel.toCloud() as LocalStorageCloud).rootUri() != null) { releaseUriPermission(cloudModel.uri()) } } diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt index 4b4f7d59..5d70f3b1 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ImagePreviewActivity.kt @@ -1,7 +1,6 @@ package org.cryptomator.presentation.ui.activity import android.net.Uri -import android.os.Build import android.view.View.* import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment @@ -91,9 +90,7 @@ class ImagePreviewActivity : BaseActivity(), ImagePreviewView, ConfirmDeleteClou } private fun setupStatusBar() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - window.statusBarColor = ContextCompat.getColor(this, R.color.colorBlack) - } + window.statusBarColor = ContextCompat.getColor(this, R.color.colorBlack) } private fun setupToolbar(index: Int) { @@ -131,10 +128,7 @@ class ImagePreviewActivity : BaseActivity(), ImagePreviewView, ConfirmDeleteClou var newUiOptions = window.decorView.systemUiVisibility newUiOptions = newUiOptions or SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION newUiOptions = newUiOptions xor SYSTEM_UI_FLAG_FULLSCREEN - - if (Build.VERSION.SDK_INT >= 19) { - newUiOptions = newUiOptions xor SYSTEM_UI_FLAG_IMMERSIVE_STICKY - } + newUiOptions = newUiOptions xor SYSTEM_UI_FLAG_IMMERSIVE_STICKY window.decorView.systemUiVisibility = newUiOptions } diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/SettingsFragment.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/SettingsFragment.kt index f27a3af0..5c912189 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/SettingsFragment.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/SettingsFragment.kt @@ -179,11 +179,7 @@ class SettingsFragment : PreferenceFragmentCompat() { val strDate: String = dateFormatUser.format(lastUpdateCheck) format(getString(R.string.screen_settings_last_check_updates), strDate) } else { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - getString(R.string.screen_settings_last_check_updates_never) - } else { - getString(R.string.screen_settings_last_check_updates_never_pre_marshmallow) - } + getString(R.string.screen_settings_last_check_updates_never) } val date = SpannableString(readableDate) diff --git a/presentation/src/main/res/values-de/strings.xml b/presentation/src/main/res/values-de/strings.xml index ffeaba07..227eca18 100644 --- a/presentation/src/main/res/values-de/strings.xml +++ b/presentation/src/main/res/values-de/strings.xml @@ -342,7 +342,6 @@ Nach Aktualisierungen suchen Letzte Ausführung %1$s @string/lock_timeout_never - Noch nie ~ Wenn aus technischen Gründen keine Update-Prüfung durchgeführt werden kann, können Updates manuell über die Website https://cryptomator.org/android/ heruntergeladen und installiert werden. Zwischenspeichergröße pro Cloud Sofort diff --git a/presentation/src/main/res/values-fr/strings.xml b/presentation/src/main/res/values-fr/strings.xml index ccdf0340..312cd807 100644 --- a/presentation/src/main/res/values-fr/strings.xml +++ b/presentation/src/main/res/values-fr/strings.xml @@ -350,7 +350,6 @@ Vérifier les mises à jour Dernière exécution %1$s @string/lock_timeout_never - Jamais ~ Si la vérification de mise à jour ne peut être effectué pour des raisons techniques, les mises à jour peuvent être téléchargées et installées manuellement à partir du site https://cryptomator.org/android/. Taille du cache par cloud Instantané diff --git a/presentation/src/main/res/values-tr/strings.xml b/presentation/src/main/res/values-tr/strings.xml index c74cf321..43ceaef7 100644 --- a/presentation/src/main/res/values-tr/strings.xml +++ b/presentation/src/main/res/values-tr/strings.xml @@ -342,7 +342,6 @@ Güncellemeleri kontrol et Son çalıştırma %1$s @string/lock_timeout_never - Teknik nedenlerle güncelleme kontrolü yapılamıyorsa, güncellemeler, https://cryptomator.org/android/ web sitesinden manuel olarak indirilebilir ve yüklenebilir. Bulut başına önbellek boyutu Anında diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index dcc26ed5..240d713f 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -510,7 +510,6 @@ Check for updates Last run %1$s @string/lock_timeout_never - Never ~ If an update check cannot be performed for technical reasons, updates can be downloaded and installed manually from the website https://cryptomator.org/android/. Cache size per Cloud