Skip to content

Commit ddf90aa

Browse files
committed
Move recipe into hilt subpackage
1 parent 50c18b8 commit ddf90aa

File tree

8 files changed

+9
-35
lines changed

8 files changed

+9
-35
lines changed

.idea/gradle.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
android:exported="true"
8787
android:theme="@style/Theme.Nav3Recipes"/>
8888
<activity
89-
android:name=".modular.ModularActivity"
89+
android:name=".modular.hilt.ModularActivity"
9090
android:exported="true"
9191
android:label="@string/app_name"
9292
android:theme="@style/Theme.Nav3Recipes"/>

app/src/main/java/com/example/nav3recipes/RecipePickerActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import com.example.nav3recipes.basicdsl.BasicDslActivity
2828
import com.example.nav3recipes.basicsaveable.BasicSaveableActivity
2929
import com.example.nav3recipes.commonui.CommonUiActivity
3030
import com.example.nav3recipes.conditional.ConditionalActivity
31-
import com.example.nav3recipes.modular.ModularActivity
31+
import com.example.nav3recipes.modular.hilt.ModularActivity
3232
import com.example.nav3recipes.passingarguments.basicviewmodels.BasicViewModelsActivity
3333
import com.example.nav3recipes.passingarguments.injectedviewmodels.InjectedViewModelsActivity
3434
import com.example.nav3recipes.scenes.materiallistdetail.MaterialListDetailActivity

app/src/main/java/com/example/nav3recipes/modular/AppModule.kt renamed to app/src/main/java/com/example/nav3recipes/modular/hilt/AppModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.nav3recipes.modular
1+
package com.example.nav3recipes.modular.hilt
22

33
import dagger.Module
44
import dagger.Provides

app/src/main/java/com/example/nav3recipes/modular/CommonModule.kt renamed to app/src/main/java/com/example/nav3recipes/modular/hilt/CommonModule.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
package com.example.nav3recipes.modular
1+
package com.example.nav3recipes.modular.hilt
22

33
import androidx.compose.runtime.mutableStateListOf
44
import androidx.compose.runtime.snapshots.SnapshotStateList
55
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
106
import dagger.hilt.android.scopes.ActivityRetainedScoped
117
import javax.inject.Inject
128

app/src/main/java/com/example/nav3recipes/modular/ConversationModule.kt renamed to app/src/main/java/com/example/nav3recipes/modular/hilt/ConversationModule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.nav3recipes.modular
1+
package com.example.nav3recipes.modular.hilt
22

33
import androidx.compose.foundation.background
44
import androidx.compose.foundation.clickable
@@ -16,7 +16,6 @@ import androidx.compose.material3.ListItemDefaults
1616
import androidx.compose.material3.MaterialTheme
1717
import androidx.compose.material3.Text
1818
import androidx.compose.runtime.Composable
19-
import androidx.compose.runtime.snapshots.SnapshotStateList
2019
import androidx.compose.ui.Alignment
2120
import androidx.compose.ui.Modifier
2221
import androidx.compose.ui.graphics.Color

app/src/main/java/com/example/nav3recipes/modular/ModularActivity.kt renamed to app/src/main/java/com/example/nav3recipes/modular/hilt/ModularActivity.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
package com.example.nav3recipes.modular
1+
package com.example.nav3recipes.modular.hilt
22

33
import android.os.Bundle
44
import androidx.activity.ComponentActivity
55
import androidx.activity.compose.setContent
66
import androidx.compose.foundation.layout.padding
77
import androidx.compose.material3.Scaffold
8-
import androidx.compose.runtime.snapshots.SnapshotStateList
98
import androidx.compose.ui.Modifier
109
import androidx.navigation3.ui.NavDisplay
11-
import androidx.navigation3.runtime.EntryProviderBuilder
1210
import androidx.navigation3.runtime.entryProvider
1311
import com.example.nav3recipes.ui.setEdgeToEdgeConfig
1412
import dagger.hilt.android.AndroidEntryPoint
1513
import javax.inject.Inject
1614

1715
/**
1816
* 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.
2019
*
2120
* Features (Conversation and Profile) are split into two modules:
2221
* - api: defines the public facing routes for this feature

app/src/main/java/com/example/nav3recipes/modular/ProfileModule.kt renamed to app/src/main/java/com/example/nav3recipes/modular/hilt/ProfileModule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.nav3recipes.modular
1+
package com.example.nav3recipes.modular.hilt
22

33
import androidx.compose.foundation.background
44
import androidx.compose.foundation.layout.Arrangement
@@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.padding
88
import androidx.compose.material3.MaterialTheme
99
import androidx.compose.material3.Text
1010
import androidx.compose.runtime.Composable
11-
import androidx.compose.runtime.snapshots.SnapshotStateList
1211
import androidx.compose.ui.Alignment
1312
import androidx.compose.ui.Modifier
1413
import androidx.compose.ui.unit.dp

0 commit comments

Comments
 (0)