From e93c14de03b4a3dfcb1f2fcb0ae5092558361d97 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Fri, 17 Sep 2021 10:47:22 +0200 Subject: [PATCH 01/12] Simplify ProgressStateModel --- .../presentation/model/ProgressStateModel.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/presentation/src/main/java/org/cryptomator/presentation/model/ProgressStateModel.kt b/presentation/src/main/java/org/cryptomator/presentation/model/ProgressStateModel.kt index 18a2372f6..93acd60ca 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/model/ProgressStateModel.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/model/ProgressStateModel.kt @@ -5,9 +5,9 @@ import java.io.Serializable open class ProgressStateModel private constructor(private val name: String, image: Image, text: Text, selectable: Boolean) : Serializable { - private val imageResourceId: Int - private val textResourceId: Int - val isSelectable: Boolean + private val imageResourceId: Int = image.id() + private val textResourceId: Int = text.id() + val isSelectable: Boolean = selectable private constructor(name: String) : this(name, noImage(), noText()) private constructor(name: String, text: Text) : this(name, noImage(), text) @@ -76,9 +76,4 @@ open class ProgressStateModel private constructor(private val name: String, imag } } - init { - imageResourceId = image.id() - textResourceId = text.id() - isSelectable = selectable - } } From 48166023c7fbd00ff6ce0352dd948a00f2e1f092 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Wed, 22 Sep 2021 11:55:27 +0200 Subject: [PATCH 02/12] Update dependencies --- build.gradle | 2 +- buildsystem/dependencies.gradle | 10 +++++----- pcloud-sdk-java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 4b8b41c95..157c6d160 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply from: 'buildsystem/dependencies.gradle' apply plugin: "com.vanniktech.android.junit.jacoco" buildscript { - ext.kotlin_version = '1.5.30' + ext.kotlin_version = '1.5.31' repositories { mavenCentral() google() diff --git a/buildsystem/dependencies.gradle b/buildsystem/dependencies.gradle index a0788c5bd..b2e35d60e 100644 --- a/buildsystem/dependencies.gradle +++ b/buildsystem/dependencies.gradle @@ -18,7 +18,7 @@ ext { // support lib androidSupportAnnotationsVersion = '1.2.0' - androidSupportAppcompatVersion = '1.3.0' + androidSupportAppcompatVersion = '1.3.1' androidSupportDesignVersion = '1.4.0' coreDesugaringVersion = '1.1.5' @@ -55,7 +55,7 @@ ext { dropboxVersion = '4.0.1' googleApiServicesVersion = 'v3-rev20210725-1.32.1' - googlePlayServicesVersion = '19.0.0' + googlePlayServicesVersion = '19.2.0' googleClientVersion = '1.32.1' msgraphVersion = '2.10.0' @@ -69,8 +69,8 @@ ext { // testing dependencies - jUnitVersion = '5.7.1' - jUnit4Version = '4.13.1' + jUnitVersion = '5.8.0' + jUnit4Version = '5.8.0' assertJVersion = '1.7.1' mockitoVersion = '3.12.4' mockitoKotlinVersion = '3.2.0' @@ -84,7 +84,7 @@ ext { uiautomatorVersion = '2.2.0' androidxCoreVersion = '1.6.0' - androidxFragmentVersion = '1.3.5' + androidxFragmentVersion = '1.3.6' androidxViewpagerVersion = '1.0.0' androidxSwiperefreshVersion = '1.1.0' androidxPreferenceVersion = '1.1.1' diff --git a/pcloud-sdk-java b/pcloud-sdk-java index e62e94805..4226c0b12 160000 --- a/pcloud-sdk-java +++ b/pcloud-sdk-java @@ -1 +1 @@ -Subproject commit e62e948056a17ddc2ada4ad23c27e9b451078787 +Subproject commit 4226c0b1297a12dc5937b2d3eae7962f146cf683 From ebac2cbc2f0d45ec3e214adb21ec0c3d0cd0de8a Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Wed, 22 Sep 2021 12:54:07 +0200 Subject: [PATCH 03/12] Center "create vault hint" even if it is displayed as multi-line text --- .../src/main/res/layout/view_empty_cloud_connections.xml | 1 + presentation/src/main/res/layout/view_vault_creation_hint.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/presentation/src/main/res/layout/view_empty_cloud_connections.xml b/presentation/src/main/res/layout/view_empty_cloud_connections.xml index 6f821c49c..8b024477f 100644 --- a/presentation/src/main/res/layout/view_empty_cloud_connections.xml +++ b/presentation/src/main/res/layout/view_empty_cloud_connections.xml @@ -8,6 +8,7 @@ diff --git a/presentation/src/main/res/layout/view_vault_creation_hint.xml b/presentation/src/main/res/layout/view_vault_creation_hint.xml index 78a85549d..e31f3c655 100644 --- a/presentation/src/main/res/layout/view_vault_creation_hint.xml +++ b/presentation/src/main/res/layout/view_vault_creation_hint.xml @@ -8,6 +8,7 @@ From 828ba7207d3d2b7b3162cbd276280ed657a7ad12 Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Wed, 22 Sep 2021 13:15:17 +0200 Subject: [PATCH 04/12] Remove ... after the 'Select'-entry in navbar while browsing files For consistency, the other entries don't have that either. --- presentation/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/presentation/src/main/res/values/strings.xml b/presentation/src/main/res/values/strings.xml index 6b98b9549..bc233e7bd 100644 --- a/presentation/src/main/res/values/strings.xml +++ b/presentation/src/main/res/values/strings.xml @@ -130,7 +130,7 @@ Select items %1$d selected - Select… + Select Select all Refresh From a8d789440ec2a30ee3deb3c533d4a6c27009104e Mon Sep 17 00:00:00 2001 From: Julian Raufelder Date: Wed, 22 Sep 2021 15:53:03 +0200 Subject: [PATCH 05/12] Remove redundant empty and no DirFile handling --- presentation/src/main/AndroidManifest.xml | 1 - .../di/component/ActivityComponent.java | 6 --- .../intent/EmptyDirIdFileInfoIntent.java | 13 ------- .../presenter/BrowseFilesPresenter.kt | 5 +-- .../presenter/EmptyDirIdFileInfoPresenter.kt | 18 --------- .../ui/activity/EmptyDirIdFileInfoActivity.kt | 39 ------------------- .../ui/fragment/EmptyDirIdFileInfoFragment.kt | 23 ----------- .../layout/activity_empty_dir_file_info.xml | 20 ---------- .../layout/fragment_empty_dir_file_info.xml | 33 ---------------- presentation/src/main/res/values/strings.xml | 8 +--- 10 files changed, 2 insertions(+), 164 deletions(-) delete mode 100644 presentation/src/main/java/org/cryptomator/presentation/intent/EmptyDirIdFileInfoIntent.java delete mode 100644 presentation/src/main/java/org/cryptomator/presentation/presenter/EmptyDirIdFileInfoPresenter.kt delete mode 100644 presentation/src/main/java/org/cryptomator/presentation/ui/activity/EmptyDirIdFileInfoActivity.kt delete mode 100644 presentation/src/main/java/org/cryptomator/presentation/ui/fragment/EmptyDirIdFileInfoFragment.kt delete mode 100644 presentation/src/main/res/layout/activity_empty_dir_file_info.xml delete mode 100644 presentation/src/main/res/layout/fragment_empty_dir_file_info.xml diff --git a/presentation/src/main/AndroidManifest.xml b/presentation/src/main/AndroidManifest.xml index 61dea3f01..0e2bbcf73 100644 --- a/presentation/src/main/AndroidManifest.xml +++ b/presentation/src/main/AndroidManifest.xml @@ -101,7 +101,6 @@ - diff --git a/presentation/src/main/java/org/cryptomator/presentation/di/component/ActivityComponent.java b/presentation/src/main/java/org/cryptomator/presentation/di/component/ActivityComponent.java index db8337feb..07aec966f 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/di/component/ActivityComponent.java +++ b/presentation/src/main/java/org/cryptomator/presentation/di/component/ActivityComponent.java @@ -13,7 +13,6 @@ import org.cryptomator.presentation.ui.activity.CloudConnectionListActivity; import org.cryptomator.presentation.ui.activity.CloudSettingsActivity; import org.cryptomator.presentation.ui.activity.CreateVaultActivity; -import org.cryptomator.presentation.ui.activity.EmptyDirIdFileInfoActivity; import org.cryptomator.presentation.ui.activity.ImagePreviewActivity; import org.cryptomator.presentation.ui.activity.LicenseCheckActivity; import org.cryptomator.presentation.ui.activity.LicensesActivity; @@ -32,7 +31,6 @@ import org.cryptomator.presentation.ui.fragment.ChooseCloudServiceFragment; import org.cryptomator.presentation.ui.fragment.CloudConnectionListFragment; import org.cryptomator.presentation.ui.fragment.CloudSettingsFragment; -import org.cryptomator.presentation.ui.fragment.EmptyDirIdFileInfoFragment; import org.cryptomator.presentation.ui.fragment.ImagePreviewFragment; import org.cryptomator.presentation.ui.fragment.S3AddOrChangeFragment; import org.cryptomator.presentation.ui.fragment.SetPasswordFragment; @@ -96,10 +94,6 @@ public interface ActivityComponent { void inject(CloudConnectionListActivity cloudConnectionListActivity); - void inject(EmptyDirIdFileInfoActivity emptyDirIdFileInfoActivity); - - void inject(EmptyDirIdFileInfoFragment emptyDirIdFileInfoFragment); - void inject(BiometricAuthSettingsActivity biometricAuthSettingsActivity); void inject(BiometricAuthSettingsFragment biometricAuthSettingsFragment); diff --git a/presentation/src/main/java/org/cryptomator/presentation/intent/EmptyDirIdFileInfoIntent.java b/presentation/src/main/java/org/cryptomator/presentation/intent/EmptyDirIdFileInfoIntent.java deleted file mode 100644 index e5ec6bd5d..000000000 --- a/presentation/src/main/java/org/cryptomator/presentation/intent/EmptyDirIdFileInfoIntent.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.cryptomator.presentation.intent; - -import org.cryptomator.generator.Intent; -import org.cryptomator.presentation.ui.activity.EmptyDirIdFileInfoActivity; - -@Intent(EmptyDirIdFileInfoActivity.class) -public interface EmptyDirIdFileInfoIntent { - - String dirName(); - - String dirFilePath(); - -} 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 7124b351b..b1af75db0 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt @@ -167,10 +167,7 @@ class BrowseFilesPresenter @Inject constructor( // return } e is EmptyDirFileException -> { - Intents.emptyDirIdFileInfoIntent() // - .withDirName(e.dirName) // - .withDirFilePath(e.filePath) // - .startActivity(this@BrowseFilesPresenter) + view?.showNoDirFileDialog(e.dirName, e.filePath) } e is SymLinkException -> { view?.showSymLinkDialog() diff --git a/presentation/src/main/java/org/cryptomator/presentation/presenter/EmptyDirIdFileInfoPresenter.kt b/presentation/src/main/java/org/cryptomator/presentation/presenter/EmptyDirIdFileInfoPresenter.kt deleted file mode 100644 index 25dd5a324..000000000 --- a/presentation/src/main/java/org/cryptomator/presentation/presenter/EmptyDirIdFileInfoPresenter.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.cryptomator.presentation.presenter - -import android.content.Intent -import android.net.Uri -import org.cryptomator.domain.di.PerView -import org.cryptomator.presentation.exception.ExceptionHandlers -import org.cryptomator.presentation.ui.activity.view.EmptyDirFileView -import javax.inject.Inject - -@PerView -class EmptyDirIdFileInfoPresenter @Inject constructor(exceptionMappings: ExceptionHandlers) : Presenter(exceptionMappings) { - - fun onShowMoreInfoButtonPressed() { - val intent = Intent(Intent.ACTION_VIEW) - intent.data = Uri.parse("https://cryptomator.org/help/articles/sanitizer") - context().startActivity(intent) - } -} diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/EmptyDirIdFileInfoActivity.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/EmptyDirIdFileInfoActivity.kt deleted file mode 100644 index 569e66a9a..000000000 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/EmptyDirIdFileInfoActivity.kt +++ /dev/null @@ -1,39 +0,0 @@ -package org.cryptomator.presentation.ui.activity - -import org.cryptomator.generator.Activity -import org.cryptomator.generator.InjectIntent -import org.cryptomator.presentation.R -import org.cryptomator.presentation.intent.EmptyDirIdFileInfoIntent -import org.cryptomator.presentation.presenter.EmptyDirIdFileInfoPresenter -import org.cryptomator.presentation.ui.activity.view.EmptyDirFileView -import org.cryptomator.presentation.ui.fragment.EmptyDirIdFileInfoFragment -import javax.inject.Inject -import kotlinx.android.synthetic.main.toolbar_layout.toolbar - -@Activity(layout = R.layout.activity_empty_dir_file_info) -class EmptyDirIdFileInfoActivity : BaseActivity(), EmptyDirFileView { - - @Inject - lateinit var presenter: EmptyDirIdFileInfoPresenter - - @InjectIntent - lateinit var emptyDirIdFileInfoIntent: EmptyDirIdFileInfoIntent - - override fun setupView() { - setupToolbar() - } - - private fun setupToolbar() { - toolbar.title = getString( - R.string.screen_empty_dir_file_info_title, - emptyDirIdFileInfoIntent.dirName() - ) - setSupportActionBar(toolbar) - } - - override fun onResume() { - super.onResume() - (supportFragmentManager.findFragmentByTag("EmptyDirIdFileInfoFragment") as EmptyDirIdFileInfoFragment) - .setDirFilePath(emptyDirIdFileInfoIntent.dirFilePath()) - } -} diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/EmptyDirIdFileInfoFragment.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/EmptyDirIdFileInfoFragment.kt deleted file mode 100644 index 7de9617ff..000000000 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/fragment/EmptyDirIdFileInfoFragment.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.cryptomator.presentation.ui.fragment - -import org.cryptomator.generator.Fragment -import org.cryptomator.presentation.R -import org.cryptomator.presentation.presenter.EmptyDirIdFileInfoPresenter -import javax.inject.Inject -import kotlinx.android.synthetic.main.fragment_empty_dir_file_info.infoText -import kotlinx.android.synthetic.main.fragment_empty_dir_file_info.moreDetailsButton - -@Fragment(R.layout.fragment_empty_dir_file_info) -class EmptyDirIdFileInfoFragment : BaseFragment() { - - @Inject - lateinit var presenter: EmptyDirIdFileInfoPresenter - - override fun setupView() { - moreDetailsButton.setOnClickListener { presenter.onShowMoreInfoButtonPressed() } - } - - fun setDirFilePath(dirFilePath: String) { - infoText.text = String.format(getString(R.string.screen_empty_dir_file_info_text), dirFilePath) - } -} diff --git a/presentation/src/main/res/layout/activity_empty_dir_file_info.xml b/presentation/src/main/res/layout/activity_empty_dir_file_info.xml deleted file mode 100644 index d7fb3ca02..000000000 --- a/presentation/src/main/res/layout/activity_empty_dir_file_info.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - diff --git a/presentation/src/main/res/layout/fragment_empty_dir_file_info.xml b/presentation/src/main/res/layout/fragment_empty_dir_file_info.xml deleted file mode 100644 index 21396e803..000000000 --- a/presentation/src/main/res/layout/fragment_empty_dir_file_info.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - -