Skip to content

Commit 9c225fb

Browse files
committed
refactor(MyKSuiteBlockSignature): Create another utils for Ui and remove useless FrameLayout
1 parent 8b71fd4 commit 9c225fb

File tree

4 files changed

+48
-31
lines changed

4 files changed

+48
-31
lines changed

app/src/main/java/com/infomaniak/mail/ui/main/settings/mailbox/SignatureSettingFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import com.infomaniak.mail.BuildConfig
3030
import com.infomaniak.mail.data.models.mailbox.Mailbox
3131
import com.infomaniak.mail.data.models.signature.Signature
3232
import com.infomaniak.mail.databinding.FragmentSignatureSettingBinding
33-
import com.infomaniak.mail.utils.MyKSuiteDataUtils.openMyKSuiteUpgradeBottomSheet
33+
import com.infomaniak.mail.utils.MyKSuiteUiUtils.openMyKSuiteUpgradeBottomSheet
3434
import com.infomaniak.mail.utils.extensions.setSystemBarsColors
3535
import dagger.hilt.android.AndroidEntryPoint
3636
import io.realm.kotlin.ext.copyFromRealm

app/src/main/java/com/infomaniak/mail/utils/MyKSuiteDataUtils.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@
1717
*/
1818
package com.infomaniak.mail.utils
1919

20-
import androidx.fragment.app.Fragment
2120
import com.infomaniak.core.myksuite.ui.data.MyKSuiteData
2221
import com.infomaniak.core.myksuite.ui.data.MyKSuiteDataManager
23-
import com.infomaniak.core.myksuite.ui.screens.KSuiteApp
24-
import com.infomaniak.core.myksuite.ui.views.MyKSuiteUpgradeBottomSheetDialogArgs
25-
import com.infomaniak.lib.core.utils.safeNavigate
26-
import com.infomaniak.mail.R
2722
import com.infomaniak.mail.data.cache.appSettings.AppSettingsController
2823
import com.infomaniak.mail.data.models.AppSettings
2924

@@ -42,9 +37,4 @@ object MyKSuiteDataUtils : MyKSuiteDataManager() {
4237
field = myKSuiteData
4338
myKSuiteId = myKSuiteData?.id ?: AppSettings.DEFAULT_ID
4439
}
45-
46-
fun Fragment.openMyKSuiteUpgradeBottomSheet(currentClassName: String? = null) {
47-
val args = MyKSuiteUpgradeBottomSheetDialogArgs(kSuiteApp = KSuiteApp.Mail)
48-
safeNavigate(R.id.myKSuiteUpgradeBottomSheet, args.toBundle(), currentClassName = currentClassName)
49-
}
5040
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Infomaniak Mail - Android
3+
* Copyright (C) 2025 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+
package com.infomaniak.mail.utils
19+
20+
import androidx.fragment.app.Fragment
21+
import com.infomaniak.core.myksuite.ui.screens.KSuiteApp
22+
import com.infomaniak.core.myksuite.ui.views.MyKSuiteUpgradeBottomSheetDialogArgs
23+
import com.infomaniak.lib.core.utils.safeNavigate
24+
import com.infomaniak.mail.R
25+
26+
object MyKSuiteUiUtils {
27+
28+
fun Fragment.openMyKSuiteUpgradeBottomSheet(currentClassName: String? = null) {
29+
val args = MyKSuiteUpgradeBottomSheetDialogArgs(kSuiteApp = KSuiteApp.Mail)
30+
safeNavigate(R.id.myKSuiteUpgradeBottomSheet, args.toBundle(), currentClassName = currentClassName)
31+
}
32+
}

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

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,20 @@
4040
android:layout_weight="1"
4141
tools:text="Simple messages" />
4242

43-
<FrameLayout
44-
android:layout_width="wrap_content"
45-
android:layout_height="wrap_content">
46-
47-
<ImageView
48-
android:id="@+id/checkMark"
49-
android:layout_width="@dimen/mediumIconSize"
50-
android:layout_height="@dimen/mediumIconSize"
51-
android:layout_marginStart="@dimen/marginStandardMedium"
52-
android:contentDescription="@string/contentDescriptionSelectedItem"
53-
android:src="@drawable/ic_check"
54-
android:visibility="invisible"
55-
app:tint="?android:attr/colorPrimary" />
43+
<ImageView
44+
android:id="@+id/checkMark"
45+
android:layout_width="@dimen/mediumIconSize"
46+
android:layout_height="@dimen/mediumIconSize"
47+
android:layout_marginStart="@dimen/marginStandardMedium"
48+
android:contentDescription="@string/contentDescriptionSelectedItem"
49+
android:src="@drawable/ic_check"
50+
android:visibility="invisible"
51+
app:tint="?android:attr/colorPrimary" />
5652

57-
<com.infomaniak.core.myksuite.ui.views.MyKSuitePlusChipView
58-
android:id="@+id/myKSuitePlusChip"
59-
android:layout_width="wrap_content"
60-
android:layout_height="wrap_content"
61-
android:visibility="gone"
62-
tools:visibility="visible" />
63-
</FrameLayout>
53+
<com.infomaniak.core.myksuite.ui.views.MyKSuitePlusChipView
54+
android:id="@+id/myKSuitePlusChip"
55+
android:layout_width="wrap_content"
56+
android:layout_height="wrap_content"
57+
android:visibility="gone"
58+
tools:visibility="visible" />
6459
</LinearLayout>

0 commit comments

Comments
 (0)