File tree Expand file tree Collapse file tree 8 files changed +9
-35
lines changed
java/com/example/nav3recipes Expand file tree Collapse file tree 8 files changed +9
-35
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 86
86
android : exported =" true"
87
87
android : theme =" @style/Theme.Nav3Recipes" />
88
88
<activity
89
- android : name =" .modular.ModularActivity"
89
+ android : name =" .modular.hilt. ModularActivity"
90
90
android : exported =" true"
91
91
android : label =" @string/app_name"
92
92
android : theme =" @style/Theme.Nav3Recipes" />
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import com.example.nav3recipes.basicdsl.BasicDslActivity
28
28
import com.example.nav3recipes.basicsaveable.BasicSaveableActivity
29
29
import com.example.nav3recipes.commonui.CommonUiActivity
30
30
import com.example.nav3recipes.conditional.ConditionalActivity
31
- import com.example.nav3recipes.modular.ModularActivity
31
+ import com.example.nav3recipes.modular.hilt. ModularActivity
32
32
import com.example.nav3recipes.passingarguments.basicviewmodels.BasicViewModelsActivity
33
33
import com.example.nav3recipes.passingarguments.injectedviewmodels.InjectedViewModelsActivity
34
34
import com.example.nav3recipes.scenes.materiallistdetail.MaterialListDetailActivity
Original file line number Diff line number Diff line change 1
- package com.example.nav3recipes.modular
1
+ package com.example.nav3recipes.modular.hilt
2
2
3
3
import dagger.Module
4
4
import dagger.Provides
Original file line number Diff line number Diff line change 1
- package com.example.nav3recipes.modular
1
+ package com.example.nav3recipes.modular.hilt
2
2
3
3
import androidx.compose.runtime.mutableStateListOf
4
4
import androidx.compose.runtime.snapshots.SnapshotStateList
5
5
import androidx.navigation3.runtime.EntryProviderBuilder
6
- import dagger.Module
7
- import dagger.Provides
8
- import dagger.hilt.InstallIn
9
- import dagger.hilt.android.components.ActivityRetainedComponent
10
6
import dagger.hilt.android.scopes.ActivityRetainedScoped
11
7
import javax.inject.Inject
12
8
Original file line number Diff line number Diff line change 1
- package com.example.nav3recipes.modular
1
+ package com.example.nav3recipes.modular.hilt
2
2
3
3
import androidx.compose.foundation.background
4
4
import androidx.compose.foundation.clickable
@@ -16,7 +16,6 @@ import androidx.compose.material3.ListItemDefaults
16
16
import androidx.compose.material3.MaterialTheme
17
17
import androidx.compose.material3.Text
18
18
import androidx.compose.runtime.Composable
19
- import androidx.compose.runtime.snapshots.SnapshotStateList
20
19
import androidx.compose.ui.Alignment
21
20
import androidx.compose.ui.Modifier
22
21
import androidx.compose.ui.graphics.Color
Original file line number Diff line number Diff line change 1
- package com.example.nav3recipes.modular
1
+ package com.example.nav3recipes.modular.hilt
2
2
3
3
import android.os.Bundle
4
4
import androidx.activity.ComponentActivity
5
5
import androidx.activity.compose.setContent
6
6
import androidx.compose.foundation.layout.padding
7
7
import androidx.compose.material3.Scaffold
8
- import androidx.compose.runtime.snapshots.SnapshotStateList
9
8
import androidx.compose.ui.Modifier
10
9
import androidx.navigation3.ui.NavDisplay
11
- import androidx.navigation3.runtime.EntryProviderBuilder
12
10
import androidx.navigation3.runtime.entryProvider
13
11
import com.example.nav3recipes.ui.setEdgeToEdgeConfig
14
12
import dagger.hilt.android.AndroidEntryPoint
15
13
import javax.inject.Inject
16
14
17
15
/* *
18
16
* This recipe demonstrates how to use a modular approach with Navigation 3,
19
- * where different parts of the application are defined in separate modules.
17
+ * where different parts of the application are defined in separate modules and injected
18
+ * into the main app using Dagger/Hilt.
20
19
*
21
20
* Features (Conversation and Profile) are split into two modules:
22
21
* - api: defines the public facing routes for this feature
Original file line number Diff line number Diff line change 1
- package com.example.nav3recipes.modular
1
+ package com.example.nav3recipes.modular.hilt
2
2
3
3
import androidx.compose.foundation.background
4
4
import androidx.compose.foundation.layout.Arrangement
@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.padding
8
8
import androidx.compose.material3.MaterialTheme
9
9
import androidx.compose.material3.Text
10
10
import androidx.compose.runtime.Composable
11
- import androidx.compose.runtime.snapshots.SnapshotStateList
12
11
import androidx.compose.ui.Alignment
13
12
import androidx.compose.ui.Modifier
14
13
import androidx.compose.ui.unit.dp
You can’t perform that action at this time.
0 commit comments