Skip to content

Commit

Permalink
refactor(wear): migrate main in dedicated modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardPaligot committed Oct 10, 2024
1 parent d2391e7 commit 644bc86
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 32 deletions.
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ include(":wear:wear-app")
include(":wear:wear-features:events:events-di")
include(":wear:wear-features:events:events-panes")
include(":wear:wear-features:events:events-presentation")
include(":wear:wear-features:main:main")
include(":wear:wear-features:main:main-di")
include(":wear:wear-features:partners:partners-di")
include(":wear:wear-features:partners:partners-panes")
include(":wear:wear-features:partners:partners-presentation")
Expand Down
10 changes: 2 additions & 8 deletions wear/wear-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,13 @@ android {
}

dependencies {
implementation(projects.shared.core)
implementation(projects.shared.coreDi)
implementation(projects.shared.uiModels)
implementation(projects.wear.wearFeatures.events.eventsDi)
implementation(projects.wear.wearFeatures.events.eventsPresentation)
implementation(projects.wear.wearFeatures.main.main)
implementation(projects.wear.wearFeatures.main.mainDi)
implementation(projects.wear.wearFeatures.partners.partnersDi)
implementation(projects.wear.wearFeatures.partners.partnersPanes)
implementation(projects.wear.wearFeatures.partners.partnersPresentation)
implementation(projects.wear.wearFeatures.schedules.schedulesDi)
implementation(projects.wear.wearFeatures.schedules.schedulesPresentation)
implementation(projects.wear.wearFeatures.speakers.speakersDi)
implementation(projects.wear.wearFeatures.speakers.speakersPresentation)
implementation(projects.wear.wearResources)
implementation(projects.wear.wearTheme)

implementation(platform(libs.androidx.compose.bom))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
/* While this template provides a good starting point for using Wear Compose, you can always
* take a look at https://github.com/android/wear-os-samples/tree/main/ComposeStarter and
* https://github.com/android/wear-os-samples/tree/main/ComposeAdvanced to find the most up to date
* changes to the libraries and their usages.
*/

package com.paligot.confily.wear.presentation

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.wear.compose.material3.AppScaffold
import com.paligot.confily.wear.presentation.main.Main
import com.paligot.confily.wear.main.Main
import com.paligot.confily.wear.theme.ConfilyTheme

class MainActivity : ComponentActivity() {
Expand All @@ -22,16 +14,11 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
setTheme(android.R.style.Theme_DeviceDefault)
setContent {
WearApp()
}
}
}

@Composable
fun WearApp(modifier: Modifier = Modifier) {
ConfilyTheme {
AppScaffold(modifier = modifier) {
Main()
ConfilyTheme {
AppScaffold {
Main()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import com.paligot.confily.core.di.platformModule
import com.paligot.confily.core.di.repositoriesModule
import com.paligot.confily.wear.buildConfigModule
import com.paligot.confily.wear.events.di.eventsModule
import com.paligot.confily.wear.main.di.mainModule
import com.paligot.confily.wear.partners.di.partnersModule
import com.paligot.confily.wear.presentation.main.mainModule
import com.paligot.confily.wear.schedules.di.schedulesModule
import com.paligot.confily.wear.speakers.di.speakersModule
import org.koin.android.ext.koin.androidContext
Expand Down
16 changes: 16 additions & 0 deletions wear/wear-features/main/main-di/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
id("confily.android.library")
id("confily.quality")
}

android {
namespace = "com.paligot.confily.wear.main.di"
}

dependencies {
implementation(projects.wear.wearFeatures.main.main)
implementation(projects.shared.coreDi)

implementation(libs.koin.core)
implementation(libs.koin.android)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.paligot.confily.wear.presentation.main
package com.paligot.confily.wear.main.di

import com.paligot.confily.wear.main.MainViewModel
import org.koin.core.module.dsl.viewModel
import org.koin.dsl.module

Expand Down
24 changes: 24 additions & 0 deletions wear/wear-features/main/main/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
id("confily.android.library")
id("confily.android.library.compose")
id("confily.quality")
}

android {
namespace = "com.paligot.confily.wear.main"
}

dependencies {
implementation(projects.shared.core)
implementation(projects.wear.wearFeatures.events.eventsPresentation)
implementation(projects.wear.wearFeatures.partners.partnersPresentation)
implementation(projects.wear.wearFeatures.schedules.schedulesPresentation)
implementation(projects.wear.wearFeatures.speakers.speakersPresentation)
implementation(projects.wear.wearTheme)

implementation(compose.ui)
implementation(libs.bundles.androidx.wear)
implementation(libs.androidx.wear.navigation)

implementation(libs.koin.androidx.compose)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.paligot.confily.wear.presentation.main
package com.paligot.confily.wear.main

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.paligot.confily.wear.presentation.main
package com.paligot.confily.wear.main

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.paligot.confily.wear.presentation.main
package com.paligot.confily.wear.main

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
Expand Down

0 comments on commit 644bc86

Please sign in to comment.