Skip to content

Commit 5cded94

Browse files
1. Added below modules such as Common, Data, CoreUi, Test, Feature
2. Moved YCoreUiLib into Core ui 3. Added Hilt dependency 4. Code cleaning
1 parent 55505bb commit 5cded94

File tree

62 files changed

+522
-620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+522
-620
lines changed

YCoreUILib/build.gradle.kts

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

YCoreUILib/src/test/java/co/yml/ycoreui/ExampleUnitTest.kt

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

app/build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id("co.yml.coreui.application")
44
id("co.yml.coreui.application.jacoco")
55
id("co.yml.coreui.application.compose")
6+
id("co.yml.coreui.hilt")
67
}
78

89
android {
@@ -11,21 +12,22 @@ android {
1112
applicationId = "co.yml.coreui"
1213
versionCode = 1
1314
versionName = "1.0"
14-
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1515
}
1616
}
1717

1818
dependencies {
19+
implementation(versionCatalogLibs.hilt.nav.compose)
1920
implementation(versionCatalogLibs.androidx.lifecycle.viewModelCompose)
2021

21-
implementation(project(mapOf("path" to ":YCoreUILib")))
22+
implementation(project(mapOf("path" to ":core:ui")))
23+
implementation(project(mapOf("path" to ":feature:ytag")))
2224

23-
androidTestImplementation(versionCatalogLibs.androidx.junit)
2425
androidTestImplementation(versionCatalogLibs.androidx.test.core)
2526
androidTestImplementation(versionCatalogLibs.androidx.test.core.ktx)
2627
androidTestImplementation(versionCatalogLibs.androidx.test.ext)
2728
androidTestImplementation(versionCatalogLibs.androidx.test.runner)
2829
androidTestImplementation(versionCatalogLibs.androidx.test.rules)
29-
3030
debugImplementation("androidx.compose.ui:ui-test-manifest:${versionCatalogLibs.versions.compose.ui.testing}")
31+
32+
androidTestImplementation(project(mapOf("path" to ":core:test")))
3133
}

app/src/androidTest/java/co/yml/coreui/MainActivityTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import androidx.test.core.app.launchActivity
66
import androidx.test.ext.junit.rules.activityScenarioRule
77
import androidx.test.ext.junit.runners.AndroidJUnit4
88
import androidx.test.platform.app.InstrumentationRegistry
9+
import dagger.hilt.android.testing.HiltAndroidRule
10+
import dagger.hilt.android.testing.HiltAndroidTest
911
import org.junit.Assert
1012
import org.junit.Rule
1113
import org.junit.Test
@@ -16,8 +18,12 @@ import org.junit.runner.RunWith
1618
*
1719
* @constructor Create empty Main activity test
1820
*/
21+
@HiltAndroidTest
1922
@RunWith(AndroidJUnit4::class)
2023
class MainActivityTest {
24+
@get:Rule(order = 0)
25+
var hiltRule = HiltAndroidRule(this)
26+
2127
@get:Rule(order = 1)
2228
var activityScenarioRule = activityScenarioRule<MainActivity>()
2329

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<category android:name="android.intent.category.LAUNCHER" />
2727
</intent-filter>
2828
</activity>
29-
<activity android:name=".ui.presentation.YTagActivity"/>
29+
<activity android:name=".feature.ytag.ui.YTagActivity"/>
3030
</application>
3131

3232
</manifest>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package co.yml.coreui
22

33
import android.app.Application
4+
import dagger.hilt.android.HiltAndroidApp
45

56
/**
67
* Application class.
78
*/
9+
@HiltAndroidApp
810
class CoreUICatalog : Application()

app/src/main/java/co/yml/coreui/MainActivity.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ import androidx.compose.foundation.layout.padding
1111
import androidx.compose.material3.ExperimentalMaterial3Api
1212
import androidx.compose.material3.Scaffold
1313
import androidx.compose.ui.Modifier
14-
import co.yml.coreui.ui.compositions.AppBar
14+
import co.yml.coreui.feature.ytag.ui.YTagActivity
15+
import co.yml.coreui.core.ui.templates.AppBar
16+
import co.yml.coreui.core.ui.theme.CoreUICatalogTheme
17+
import co.yml.coreui.ui.R
1518
import co.yml.coreui.ui.presentation.CoreUIComponents
16-
import co.yml.coreui.ui.presentation.YTagActivity
17-
import co.yml.coreui.ui.theme.CoreUICatalogTheme
19+
import dagger.hilt.android.AndroidEntryPoint
1820

1921
/**
20-
* Main activity: Launcher Activity
22+
* [MainActivity]: Launcher Activity
2123
*
2224
* @constructor Create empty Main activity
2325
*/
26+
@AndroidEntryPoint
2427
class MainActivity : ComponentActivity() {
2528
@OptIn(ExperimentalMaterial3Api::class)
2629
override fun onCreate(savedInstanceState: Bundle?) {

app/src/main/java/co/yml/coreui/ui/presentation/CoreUIComponents.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import androidx.compose.runtime.Composable
88
import androidx.compose.ui.Modifier
99
import androidx.compose.ui.res.dimensionResource
1010
import androidx.compose.ui.unit.dp
11-
import co.yml.coreui.R
12-
import co.yml.coreui.ui.theme.CoreUICatalogTheme
11+
import co.yml.coreui.core.ui.theme.CoreUICatalogTheme
12+
import co.yml.coreui.ui.R
1313

1414
@Composable
1515
fun CoreUIComponents(title: String, onClick: () -> Unit) {

app/src/main/java/co/yml/coreui/ui/theme/AppDimensions.kt

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

app/src/main/java/co/yml/coreui/ui/theme/Color.kt

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

0 commit comments

Comments
 (0)