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 edb4256a..077793d6 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/model/CloudTypeModel.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/model/CloudTypeModel.kt @@ -7,42 +7,54 @@ enum class CloudTypeModel(builder: Builder) { CRYPTO(Builder("CRYPTO", R.string.cloud_names_crypto)), // DROPBOX(Builder("DROPBOX", R.string.cloud_names_dropbox) // - .withCloudImageResource(R.drawable.cloud_type_dropbox) // - .withCloudImageLargeResource(R.drawable.cloud_type_dropbox_large)), // + .withCloudImageResource(R.drawable.dropbox) // + .withVaultImageResource(R.drawable.dropbox_vault) // + .withVaultSelectedImageResource(R.drawable.dropbox_vault_selected)), // GOOGLE_DRIVE(Builder("GOOGLE_DRIVE", R.string.cloud_names_google_drive) // - .withCloudImageResource(R.drawable.cloud_type_google_drive) // - .withCloudImageLargeResource(R.drawable.cloud_type_google_drive_large)), // + .withCloudImageResource(R.drawable.google_drive) // + .withVaultImageResource(R.drawable.google_drive_vault) // + .withVaultSelectedImageResource(R.drawable.google_drive_vault_selected)), // ONEDRIVE(Builder("ONEDRIVE", R.string.cloud_names_onedrive) // - .withCloudImageResource(R.drawable.cloud_type_onedrive) // - .withCloudImageLargeResource(R.drawable.cloud_type_onedrive_large)), // + .withCloudImageResource(R.drawable.onedrive) // + .withVaultImageResource(R.drawable.onedrive_vault) // + .withVaultSelectedImageResource(R.drawable.onedrive_vault_selected)), // WEBDAV(Builder("WEBDAV", R.string.cloud_names_webdav) // - .withCloudImageResource(R.drawable.cloud_type_webdav) // - .withCloudImageLargeResource(R.drawable.cloud_type_webdav_large) // + .withCloudImageResource(R.drawable.webdav) // + .withVaultImageResource(R.drawable.webdav_vault) // + .withVaultSelectedImageResource(R.drawable.webdav_vault_selected) // .withMultiInstances()), // LOCAL(Builder("LOCAL", R.string.cloud_names_local_storage) // - .withCloudImageResource(R.drawable.storage_type_local) // - .withCloudImageLargeResource(R.drawable.storage_type_local_large) // + .withCloudImageResource(R.drawable.local_fs) // + .withVaultImageResource(R.drawable.local_fs_vault) // + .withVaultSelectedImageResource(R.drawable.local_fs_vault_selected) // .withMultiInstances()); val cloudName: String = builder.cloudName val displayNameResource: Int = builder.displayNameResource val cloudImageResource: Int = builder.cloudImageResource - val cloudImageLargeResource: Int = builder.cloudImageLargeResource + val vaultImageResource: Int = builder.vaultImageResource + val vaultSelectedImageResource: Int = builder.vaultSelectedImageResource val isMultiInstance: Boolean = builder.multiInstances private class Builder(val cloudName: String, val displayNameResource: Int) { var cloudImageResource = 0 - var cloudImageLargeResource = 0 + var vaultImageResource = 0 + var vaultSelectedImageResource = 0 var multiInstances = false - fun withCloudImageResource(cloudImageResource: Int): Builder { - this.cloudImageResource = cloudImageResource + fun withCloudImageResource(cloudImageLargeResource: Int): Builder { + this.cloudImageResource = cloudImageLargeResource return this } - fun withCloudImageLargeResource(cloudImageLargeResource: Int): Builder { - this.cloudImageLargeResource = cloudImageLargeResource + fun withVaultImageResource(vaultImageResource: Int): Builder { + this.vaultImageResource = vaultImageResource + return this + } + + fun withVaultSelectedImageResource(vaultSelectedImageResource: Int): Builder { + this.vaultSelectedImageResource = vaultSelectedImageResource return this } diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ChooseCloudServiceActivity.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ChooseCloudServiceActivity.kt index f9d0caf9..c5e1bc3c 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ChooseCloudServiceActivity.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/activity/ChooseCloudServiceActivity.kt @@ -29,7 +29,7 @@ class ChooseCloudServiceActivity : BaseActivity(), ChooseCloudServiceView { setSupportActionBar(toolbar) } - override fun createFragment(): Fragment? = ChooseCloudServiceFragment() + override fun createFragment(): Fragment = ChooseCloudServiceFragment() override fun getCustomMenuResource(): Int = R.menu.menu_cloud_services diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/adapter/BiometricAuthSettingsAdapter.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/adapter/BiometricAuthSettingsAdapter.kt index ee154fa0..85bd708b 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/adapter/BiometricAuthSettingsAdapter.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/adapter/BiometricAuthSettingsAdapter.kt @@ -48,7 +48,7 @@ constructor() : RecyclerViewBaseAdapter throw IllegalStateException("Cloud model is not binded in the view") } - iv_cloud_image.setImageResource(cloudModel.cloudType().cloudImageResource) + iv_cloud_image.setImageResource(cloudModel.cloudType().vaultImageResource) change_cloud.setOnClickListener { callback?.onChangeCloudClicked(cloudModel) dismiss() diff --git a/presentation/src/main/java/org/cryptomator/presentation/ui/bottomsheet/SettingsVaultBottomSheet.kt b/presentation/src/main/java/org/cryptomator/presentation/ui/bottomsheet/SettingsVaultBottomSheet.kt index 5451e47a..84f4c96a 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/ui/bottomsheet/SettingsVaultBottomSheet.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/ui/bottomsheet/SettingsVaultBottomSheet.kt @@ -31,7 +31,7 @@ class SettingsVaultBottomSheet : BaseBottomSheet - + android:layout_height="72dp" + android:background="?android:attr/selectableItemBackground"> - + + + + + + + + + android:layout_width="match_parent" + android:layout_height="1dp" + android:layout_alignParentBottom="true" + android:layout_marginStart="16dp" + android:layout_toEndOf="@+id/cloudImage" + android:background="@color/list_divider" /> - +