diff --git a/app/src/main/java/com/infomaniak/drive/utils/Extensions.kt b/app/src/main/java/com/infomaniak/drive/utils/Extensions.kt
index a968af883e..f55bd76f0e 100644
--- a/app/src/main/java/com/infomaniak/drive/utils/Extensions.kt
+++ b/app/src/main/java/com/infomaniak/drive/utils/Extensions.kt
@@ -430,15 +430,15 @@ fun LayoutSwitchDriveBinding.setDriveHeader(currentDrive: Drive) {
}
fun LayoutSwitchDriveBinding.setupSwitchDriveButton(fragment: Fragment) {
- switchDriveButton.apply {
- AccountUtils.getCurrentDrive()?.let { setDriveHeader(it) }
+ AccountUtils.getCurrentDrive()?.let { setDriveHeader(it) }
- if (DriveInfosController.hasSingleDrive(AccountUtils.currentUserId)) {
+ if (DriveInfosController.hasSingleDrive(AccountUtils.currentUserId)) {
+ switchDriveButton.apply {
icon = null
isEnabled = false
- } else {
- setOnClickListener { fragment.safeNavigate(R.id.switchDriveDialog) }
}
+ } else {
+ offsetOverlayedRipple.setOnClickListener { fragment.safeNavigate(R.id.switchDriveDialog) }
}
fragment.viewLifecycleOwner.lifecycle.addObserver(
diff --git a/app/src/main/res/layout/layout_switch_drive.xml b/app/src/main/res/layout/layout_switch_drive.xml
index 034ed397e4..0930ec9ae5 100644
--- a/app/src/main/res/layout/layout_switch_drive.xml
+++ b/app/src/main/res/layout/layout_switch_drive.xml
@@ -15,12 +15,13 @@
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see .
-->
-
@@ -30,8 +31,7 @@
style="@style/TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="@dimen/marginStandard"
+ android:clickable="false"
android:contentDescription="@string/buttonSwitchDrive"
android:ellipsize="end"
android:fontFamily="@font/suisseintl_bold"
@@ -45,6 +45,49 @@
app:iconGravity="end"
app:iconSize="28dp"
app:iconTint="@color/iconColor"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0"
+ app:layout_constraintStart_toStartOf="parent"
tools:text="Drive de test dev infomaniak" />
-
+
+
+
+
+
+
+
+
+
+