Skip to content

Commit 90cd61e

Browse files
committed
Code review
1 parent ff0c53b commit 90cd61e

File tree

4 files changed

+64
-30
lines changed

4 files changed

+64
-30
lines changed

app/src/main/java/com/infomaniak/mail/ui/bottomSheetDialogs/AccountBottomSheetDialog.kt

+8-7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import android.view.ViewGroup
2424
import androidx.fragment.app.activityViewModels
2525
import androidx.lifecycle.lifecycleScope
2626
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
27+
import com.infomaniak.lib.core.utils.context
2728
import com.infomaniak.lib.core.utils.safeBinding
2829
import com.infomaniak.lib.core.utils.safeNavigate
2930
import com.infomaniak.mail.MatomoMail.trackAccountEvent
@@ -66,11 +67,11 @@ class AccountBottomSheetDialog : BottomSheetDialogFragment() {
6667
return BottomSheetAccountBinding.inflate(inflater, container, false).also { binding = it }.root
6768
}
6869

69-
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
70+
override fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit = with(binding) {
7071
super.onViewCreated(view, savedInstanceState)
71-
binding.recyclerViewAccount.adapter = accountsAdapter
72-
binding.addAccount.setOnClickListener { safeNavigate(resId = R.id.attachMailboxFragment) }
73-
binding.logout.setOnClickListener {
72+
recyclerViewAccount.adapter = accountsAdapter
73+
addAccount.setOnClickListener { safeNavigate(resId = R.id.attachMailboxFragment) }
74+
logout.setOnClickListener {
7475
requireContext().trackAccountEvent("logOut")
7576
descriptionDialog.show(
7677
title = getString(R.string.confirmLogoutTitle),
@@ -79,9 +80,9 @@ class AccountBottomSheetDialog : BottomSheetDialogFragment() {
7980
onPositiveButtonClicked = ::logoutCurrentUser,
8081
)
8182
}
82-
binding.addAccount.setOnClickListener {
83-
requireContext().trackAccountEvent("add")
84-
requireContext().launchLoginActivity()
83+
addAccount.setOnClickListener {
84+
context.trackAccountEvent("add")
85+
context.launchLoginActivity()
8586
}
8687

8788
observeAccounts()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Infomaniak Mail - Android
3+
~ Copyright (C) 2024 Infomaniak Network SA
4+
~
5+
~ This program is free software: you can redistribute it and/or modify
6+
~ it under the terms of the GNU General Public License as published by
7+
~ the Free Software Foundation, either version 3 of the License, or
8+
~ (at your option) any later version.
9+
~
10+
~ This program is distributed in the hope that it will be useful,
11+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
~ GNU General Public License for more details.
14+
~
15+
~ You should have received a copy of the GNU General Public License
16+
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
-->
18+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:width="24dp"
20+
android:height="24dp"
21+
android:viewportWidth="24"
22+
android:viewportHeight="24">
23+
<group>
24+
<clip-path android:pathData="M0,0h24v24h-24z" />
25+
<path
26+
android:strokeWidth="1"
27+
android:pathData="M12,7.5V16.5"
28+
android:strokeLineJoin="round"
29+
android:fillColor="#00000000"
30+
android:strokeColor="#BC0055"
31+
android:strokeLineCap="round" />
32+
<path
33+
android:strokeWidth="1"
34+
android:pathData="M7.5,12H16.5"
35+
android:strokeLineJoin="round"
36+
android:fillColor="#00000000"
37+
android:strokeColor="#BC0055"
38+
android:strokeLineCap="round" />
39+
<path
40+
android:strokeWidth="1"
41+
android:pathData="M12,23.25C18.213,23.25 23.25,18.213 23.25,12C23.25,5.787 18.213,0.75 12,0.75C5.787,0.75 0.75,5.787 0.75,12C0.75,18.213 5.787,23.25 12,23.25Z"
42+
android:strokeLineJoin="round"
43+
android:fillColor="#00000000"
44+
android:strokeColor="#BC0055"
45+
android:strokeLineCap="round" />
46+
</group>
47+
</vector>

app/src/main/res/layout/fragment_account_management_settings.xml

+8-22
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
android:layout_width="match_parent"
2727
android:layout_height="match_parent">
2828

29-
<androidx.constraintlayout.widget.ConstraintLayout
29+
<LinearLayout
3030
android:id="@+id/container"
3131
android:layout_width="match_parent"
3232
android:layout_height="wrap_content"
@@ -39,16 +39,14 @@
3939
android:layout_height="wrap_content"
4040
android:layout_marginHorizontal="@dimen/marginStandardMedium"
4141
android:layout_marginTop="@dimen/marginStandard"
42-
android:text="@string/usernameTitle"
43-
app:layout_constraintTop_toTopOf="parent" />
42+
android:text="@string/usernameTitle"/>
4443

4544
<TextView
4645
android:id="@+id/username"
4746
style="@style/Body.Secondary"
4847
android:layout_width="match_parent"
4948
android:layout_height="wrap_content"
5049
android:layout_marginHorizontal="@dimen/marginStandardMedium"
51-
app:layout_constraintTop_toBottomOf="@id/userNameTitle"
5250
tools:text="Test" />
5351

5452
<TextView
@@ -58,8 +56,7 @@
5856
android:layout_height="wrap_content"
5957
android:layout_marginHorizontal="@dimen/marginStandardMedium"
6058
android:layout_marginTop="@dimen/marginStandardMedium"
61-
android:text="@string/attachMailboxInputHint"
62-
app:layout_constraintTop_toBottomOf="@id/username" />
59+
android:text="@string/attachMailboxInputHint" />
6360

6461
<TextView
6562
android:id="@+id/email"
@@ -68,15 +65,11 @@
6865
android:layout_height="wrap_content"
6966
android:layout_marginHorizontal="@dimen/marginStandardMedium"
7067
android:paddingBottom="@dimen/marginStandardMedium"
71-
app:layout_constraintTop_toBottomOf="@id/emailTitle"
7268
tools:text="[email protected]" />
7369

7470
<com.google.android.material.divider.MaterialDivider
7571
android:id="@+id/divider"
76-
style="@style/ItemDivider"
77-
app:layout_constraintEnd_toEndOf="parent"
78-
app:layout_constraintStart_toStartOf="parent"
79-
app:layout_constraintTop_toBottomOf="@id/email" />
72+
style="@style/ItemDivider" />
8073

8174
<com.google.android.material.button.MaterialButton
8275
android:id="@+id/deleteAccountButton"
@@ -88,9 +81,7 @@
8881
android:text="@string/buttonAccountDelete"
8982
android:textColor="@color/redDestructiveAction"
9083
app:icon="@drawable/ic_bin"
91-
app:iconTint="@color/redDestructiveAction"
92-
app:layout_constraintStart_toStartOf="parent"
93-
app:layout_constraintTop_toBottomOf="@id/divider" />
84+
app:iconTint="@color/redDestructiveAction" />
9485

9586
<LinearLayout
9687
android:layout_width="match_parent"
@@ -100,9 +91,7 @@
10091
android:background="@drawable/background_rounded"
10192
android:backgroundTint="@color/commonColor1"
10293
android:orientation="horizontal"
103-
android:padding="@dimen/marginStandardMedium"
104-
app:layout_constraintEnd_toEndOf="parent"
105-
app:layout_constraintTop_toBottomOf="@id/deleteAccountButton">
94+
android:padding="@dimen/marginStandardMedium">
10695

10796
<ImageView
10897
android:id="@+id/waringIcon"
@@ -116,14 +105,11 @@
116105
style="@style/Body"
117106
android:layout_width="match_parent"
118107
android:layout_height="wrap_content"
119-
android:text="@string/deleteAccountWarning"
120-
app:layout_constraintEnd_toEndOf="parent"
121-
app:layout_constraintStart_toEndOf="@id/waringIcon"
122-
app:layout_constraintTop_toBottomOf="@id/deleteAccountButton" />
108+
android:text="@string/deleteAccountWarning" />
123109

124110
</LinearLayout>
125111

126-
</androidx.constraintlayout.widget.ConstraintLayout>
112+
</LinearLayout>
127113

128114
</androidx.core.widget.NestedScrollView>
129115

app/src/main/res/layout/item_menu_drawer_add_mailbox.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
android:layout_width="wrap_content"
3333
android:layout_height="wrap_content"
3434
android:layout_gravity="center_vertical"
35-
android:src="@drawable/ic_add_circle" />
35+
android:src="@drawable/ic_add_circle_thin" />
3636

3737
<TextView
3838
android:layout_width="wrap_content"

0 commit comments

Comments
 (0)