Skip to content

Commit

Permalink
feat(MyKSuite): Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianDevel committed Feb 19, 2025
1 parent 35fd507 commit fd05edc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ dependencies {

implementation libs.coil.svg

// Compose
implementation libs.compose.ui.android

// Test
testImplementation libs.junit
androidTestImplementation libs.ext.junit
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/infomaniak/mail/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ open class MainApplication : Application(), ImageLoaderFactory, DefaultLifecycle
if (BuildConfig.DEBUG) configureDebugMode()
configureSentry()
enforceAppTheme()
configureRoomDatabase()
configureRoomDatabases()
configureAppReloading()
configureInfomaniakCore()
notificationUtils.initNotificationChannel()
Expand Down Expand Up @@ -217,7 +217,7 @@ open class MainApplication : Application(), ImageLoaderFactory, DefaultLifecycle
AppCompatDelegate.setDefaultNightMode(localSettings.theme.mode)
}

private fun configureRoomDatabase() {
private fun configureRoomDatabases() {
AccountUtils.init(this)
MyKSuiteDataUtils.initDatabase(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SettingsFragment : Fragment() {
}

private fun setupMyKSuite() {
binding.myKSuitelayout.isGone = MyKSuiteDataUtils.myKSuite == null
binding.myKSuiteLayout.isGone = MyKSuiteDataUtils.myKSuite == null
MyKSuiteDataUtils.myKSuite?.let { setupMyKSuiteLayout(it) } ?: fetchMyKSuite()
}

Expand Down Expand Up @@ -114,14 +114,13 @@ class SettingsFragment : Fragment() {
binding.myKSuiteMailAddress.apply {
isVisible = mailbox != null

setTitle(mailbox?.email ?: "")
if (mailbox == null) return@observe

if (mailbox != null) {
setOnClickListener {
animatedNavigation(
SettingsFragmentDirections.actionSettingsToMailboxSettings(mailbox.objectId, mailbox.email)
)
}
setTitle(mailbox.email)
setOnClickListener {
animatedNavigation(
SettingsFragmentDirections.actionSettingsToMailboxSettings(mailbox.objectId, mailbox.email)
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
android:orientation="vertical">

<LinearLayout
android:id="@+id/myKSuitelayout"
android:id="@+id/myKSuiteLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
Expand Down
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[versions]
androidGradlePlugin = "8.7.2"
coilSvg = "2.7.0"
compose = "1.7.6"
dotsindicator = "5.1.0"
dragdropswipeRecyclerview = "1.2.0"
firebaseMessagingKtx = "24.1.0"
Expand Down Expand Up @@ -29,7 +28,6 @@ workRuntimeKtx = "2.9.1" # Doesn't build when bumped (waiting for Android SDK 35

[libraries]
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coilSvg" }
compose-ui-android = { group = "androidx.compose.ui", name = "ui-android", version.ref = "compose" }
dotsindicator = { module = "com.tbuonomo:dotsindicator", version.ref = "dotsindicator" }
dragdropswipe-recyclerview = { module = "com.ernestoyaquello.dragdropswiperecyclerview:drag-drop-swipe-recyclerview", version.ref = "dragdropswipeRecyclerview" }
firebase-messaging-ktx = { module = "com.google.firebase:firebase-messaging-ktx", version.ref = "firebaseMessagingKtx" }
Expand Down

0 comments on commit fd05edc

Please sign in to comment.