Skip to content

Commit 4a0fc79

Browse files
Merge pull request #1 from yml-org/CM-1225_YTag_View
YTag view implementation
2 parents 5839bfd + 5cded94 commit 4a0fc79

File tree

114 files changed

+1275
-3877
lines changed

Some content is hidden

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

114 files changed

+1275
-3877
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ dependencies {
2020
implementation(versionCatalogLibs.androidx.lifecycle.viewModelCompose)
2121

2222
implementation(project(mapOf("path" to ":core:ui")))
23-
implementation(project(mapOf("path" to ":feature:post")))
23+
implementation(project(mapOf("path" to ":feature:ytag")))
2424

2525
androidTestImplementation(versionCatalogLibs.androidx.test.core)
2626
androidTestImplementation(versionCatalogLibs.androidx.test.core.ktx)
2727
androidTestImplementation(versionCatalogLibs.androidx.test.ext)
2828
androidTestImplementation(versionCatalogLibs.androidx.test.runner)
2929
androidTestImplementation(versionCatalogLibs.androidx.test.rules)
30+
debugImplementation("androidx.compose.ui:ui-test-manifest:${versionCatalogLibs.versions.compose.ui.testing}")
3031

31-
debugImplementation("androidx.compose.ui:ui-test-manifest:${versionCatalogLibs.versions.compose}")
3232
androidTestImplementation(project(mapOf("path" to ":core:test")))
3333
}

app/src/androidTest/java/co/yml/coreui/ui/MainNavigationKtTest.kt

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

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
android:theme="@style/Theme.CoreUICatalog"
1818
tools:targetApi="31">
1919
<activity
20-
android:name="co.yml.coreui.MainActivity"
20+
android:name=".MainActivity"
2121
android:exported="true"
2222
android:theme="@style/Theme.CoreUICatalog">
2323
<intent-filter>
2424
<action android:name="android.intent.action.MAIN" />
2525

2626
<category android:name="android.intent.category.LAUNCHER" />
2727
</intent-filter>
28-
2928
</activity>
29+
<activity android:name=".feature.ytag.ui.YTagActivity"/>
3030
</application>
3131

32-
</manifest>
32+
</manifest>
Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,56 @@
11
package co.yml.coreui
22

3+
import android.content.Intent
34
import android.os.Bundle
45
import androidx.activity.ComponentActivity
56
import androidx.activity.compose.setContent
6-
import androidx.core.view.WindowCompat
7+
import androidx.compose.foundation.layout.Arrangement
8+
import androidx.compose.foundation.layout.Column
9+
import androidx.compose.foundation.layout.fillMaxSize
10+
import androidx.compose.foundation.layout.padding
11+
import androidx.compose.material3.ExperimentalMaterial3Api
12+
import androidx.compose.material3.Scaffold
13+
import androidx.compose.ui.Modifier
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
18+
import co.yml.coreui.ui.presentation.CoreUIComponents
719
import dagger.hilt.android.AndroidEntryPoint
8-
import co.yml.coreui.ui.AppScreen
920

1021
/**
11-
* Main activity: Launcher Activity
22+
* [MainActivity]: Launcher Activity
1223
*
1324
* @constructor Create empty Main activity
1425
*/
1526
@AndroidEntryPoint
1627
class MainActivity : ComponentActivity() {
28+
@OptIn(ExperimentalMaterial3Api::class)
1729
override fun onCreate(savedInstanceState: Bundle?) {
1830
super.onCreate(savedInstanceState)
19-
WindowCompat.setDecorFitsSystemWindows(window, true)
2031
setContent {
21-
// for larger screen get screen width size class here and pass it to app screen val widthSizeClass = calculateWindowSizeClass(this).widthSizeClass
22-
AppScreen()
32+
CoreUICatalogTheme {
33+
Scaffold(modifier = Modifier.fillMaxSize(),
34+
containerColor = CoreUICatalogTheme.colors.background,
35+
topBar = { AppBar() })
36+
{
37+
Column(
38+
modifier = Modifier
39+
.padding(it)
40+
.fillMaxSize(),
41+
verticalArrangement = Arrangement.Center
42+
) {
43+
CoreUIComponents(title = getString(R.string.title_y_tag), onClick = {
44+
startActivity(
45+
Intent(
46+
this@MainActivity,
47+
YTagActivity::class.java
48+
)
49+
)
50+
})
51+
}
52+
}
53+
}
2354
}
2455
}
2556
}

app/src/main/java/co/yml/coreui/ui/AppScreen.kt

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

app/src/main/java/co/yml/coreui/ui/MainNavigation.kt

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package co.yml.coreui.ui.presentation
2+
3+
import androidx.compose.foundation.layout.*
4+
import androidx.compose.material3.Button
5+
import androidx.compose.material3.ButtonDefaults
6+
import androidx.compose.material3.Text
7+
import androidx.compose.runtime.Composable
8+
import androidx.compose.ui.Modifier
9+
import androidx.compose.ui.res.dimensionResource
10+
import androidx.compose.ui.unit.dp
11+
import co.yml.coreui.core.ui.theme.CoreUICatalogTheme
12+
import co.yml.coreui.ui.R
13+
14+
@Composable
15+
fun CoreUIComponents(title: String, onClick: () -> Unit) {
16+
Column {
17+
Spacer(modifier = Modifier.height(dimensionResource(id = R.dimen.padding_normal_medium)))
18+
Button(
19+
modifier = Modifier
20+
.padding(
21+
end = dimensionResource(id = R.dimen.padding_normal_medium),
22+
start = dimensionResource(
23+
id = R.dimen.padding_normal_medium
24+
)
25+
)
26+
.fillMaxWidth()
27+
.height(48.dp), onClick = onClick,
28+
colors = ButtonDefaults.buttonColors(containerColor = CoreUICatalogTheme.colors.button)
29+
) {
30+
Text(
31+
text = title,
32+
style = CoreUICatalogTheme.typography.button,
33+
color = CoreUICatalogTheme.colors.text
34+
)
35+
}
36+
}
37+
}

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
<color name="teal_700">#FF018786</color>
88
<color name="black">#FF000000</color>
99
<color name="white">#FFFFFFFF</color>
10-
</resources>
10+
</resources>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
22
<string name="app_name">CoreUICatalogApp</string>
3-
</resources>
3+
</resources>

app/src/test/java/co/yml/coreui/ExampleUnitTest.kt

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

0 commit comments

Comments
 (0)