diff --git a/core/designsystem/src/main/java/com/teamwable/designsystem/extension/composable/ImageExt.kt b/core/designsystem/src/main/java/com/teamwable/designsystem/extension/composable/ImageExt.kt new file mode 100644 index 00000000..b3a92684 --- /dev/null +++ b/core/designsystem/src/main/java/com/teamwable/designsystem/extension/composable/ImageExt.kt @@ -0,0 +1,9 @@ +package com.teamwable.designsystem.extension.composable + +import androidx.annotation.DrawableRes +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource + +@Composable +fun toImageVector(@DrawableRes id: Int): ImageVector = ImageVector.vectorResource(id = id) diff --git a/core/designsystem/src/main/java/com/teamwable/designsystem/theme/Theme.kt b/core/designsystem/src/main/java/com/teamwable/designsystem/theme/Theme.kt index 34cdace1..0e291282 100644 --- a/core/designsystem/src/main/java/com/teamwable/designsystem/theme/Theme.kt +++ b/core/designsystem/src/main/java/com/teamwable/designsystem/theme/Theme.kt @@ -8,8 +8,6 @@ import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.remember import androidx.compose.runtime.staticCompositionLocalOf -import com.teamwable.designsystem.extension.system.SetLightNavigationBar -import com.teamwable.designsystem.extension.system.SetStatusBarColor private val LocalWableColors = staticCompositionLocalOf { error("No WableColors provided") @@ -59,8 +57,6 @@ fun WableTheme( ) { val colors = wableLightColors() val typography = wableTypography() - SetStatusBarColor(color = colors.white) - SetLightNavigationBar() ProvideWableColorsAndTypography(colors, typography) { MaterialTheme( content = content, colorScheme = lightColorScheme(colors), diff --git a/feature/main-compose/src/main/java/com/teamwable/main_compose/MainComposeActivity.kt b/feature/main-compose/src/main/java/com/teamwable/main_compose/MainComposeActivity.kt index ecbbca7a..4e67b478 100644 --- a/feature/main-compose/src/main/java/com/teamwable/main_compose/MainComposeActivity.kt +++ b/feature/main-compose/src/main/java/com/teamwable/main_compose/MainComposeActivity.kt @@ -7,7 +7,10 @@ import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import com.teamwable.common.di.MAIN import com.teamwable.common.intentprovider.IntentProvider +import com.teamwable.designsystem.extension.system.SetLightNavigationBar +import com.teamwable.designsystem.extension.system.SetStatusBarColor import com.teamwable.designsystem.theme.WableTheme +import com.teamwable.designsystem.theme.WableTheme.colors import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject @@ -24,6 +27,8 @@ class MainComposeActivity : ComponentActivity() { setContent { WableTheme { val navigator: MainNavigator = rememberMainNavigator() + SetStatusBarColor(color = colors.white) + SetLightNavigationBar() MainScreen( navigator = navigator, intentProvider = intentProvider, diff --git a/feature/news/build.gradle.kts b/feature/news/build.gradle.kts index 0639f527..c46dca0d 100644 --- a/feature/news/build.gradle.kts +++ b/feature/news/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id("com.teamwable.wable.feature") id("com.teamwable.wable.test") + id("com.teamwable.wable.compose.feature") } android { namespace = "com.teamwable.news" @@ -9,9 +10,6 @@ android { dependencies { implementation(project(":core:ui")) - implementation(project(":core:common")) - implementation(project(":core:model")) - implementation(project(":core:data")) // AndroidX implementation(libs.fragment.ktx) diff --git a/feature/news/src/main/java/com/teamwable/news/model/NewsInfoModel.kt b/feature/news/src/main/java/com/teamwable/news/model/NewsInfoModel.kt new file mode 100644 index 00000000..797f2bc3 --- /dev/null +++ b/feature/news/src/main/java/com/teamwable/news/model/NewsInfoModel.kt @@ -0,0 +1,9 @@ +package com.teamwable.news.model + +data class NewsInfoModel( + val newsId: Int, + val newsTitle: String, + val newsText: String, + val newsImage: String, + val time: String, +) diff --git a/feature/news/src/main/java/com/teamwable/news/news/NewsNewsFragment.kt b/feature/news/src/main/java/com/teamwable/news/news/NewsNewsFragment.kt index 3a09d0bd..56b68c0d 100644 --- a/feature/news/src/main/java/com/teamwable/news/news/NewsNewsFragment.kt +++ b/feature/news/src/main/java/com/teamwable/news/news/NewsNewsFragment.kt @@ -1,5 +1,7 @@ package com.teamwable.news.news +import androidx.compose.ui.platform.ViewCompositionStrategy +import com.teamwable.designsystem.theme.WableTheme import com.teamwable.news.databinding.FragmentNewsNewsBinding import com.teamwable.ui.base.BindingFragment import dagger.hilt.android.AndroidEntryPoint @@ -7,6 +9,12 @@ import dagger.hilt.android.AndroidEntryPoint @AndroidEntryPoint class NewsNewsFragment : BindingFragment(FragmentNewsNewsBinding::inflate) { override fun initView() { - + binding.composeView.apply { + setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) + setContent { + WableTheme { + } + } + } } } diff --git a/feature/news/src/main/java/com/teamwable/news/news/NewsNewsRoute.kt b/feature/news/src/main/java/com/teamwable/news/news/NewsNewsRoute.kt new file mode 100644 index 00000000..33731252 --- /dev/null +++ b/feature/news/src/main/java/com/teamwable/news/news/NewsNewsRoute.kt @@ -0,0 +1,22 @@ +package com.teamwable.news.news + +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.teamwable.designsystem.theme.WableTheme + +@Composable +fun NewsNewsRoute() { +} + +@Composable +fun NewsNewsScreen(){ + +} + +@Preview(showBackground = true) +@Composable +fun GreetingPreview() { + WableTheme { + NewsNewsScreen() + } +} diff --git a/feature/news/src/main/res/layout/fragment_news_news.xml b/feature/news/src/main/res/layout/fragment_news_news.xml index 54319f9e..d470abbd 100644 --- a/feature/news/src/main/res/layout/fragment_news_news.xml +++ b/feature/news/src/main/res/layout/fragment_news_news.xml @@ -4,10 +4,10 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - , + options: ImmutableList, expanded: Boolean = false, selectedIndex: Int = 0, listState: LazyListState, @@ -80,7 +80,10 @@ fun WableExposedDropdownBox( contentPadding = PaddingValues(vertical = 4.dp), modifier = Modifier.fillMaxWidth(), ) { - itemsIndexed(options) { index, year -> + itemsIndexed( + items = options, + key = { _, year -> year }, + ) { index, year -> LckYearDropdownItem( year = year.toString(), onClick = { diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt index 9ca6ae3e..55e20b69 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt @@ -8,7 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid -import androidx.compose.foundation.lazy.grid.itemsIndexed +import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.grid.rememberLazyGridState import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -125,7 +125,10 @@ fun SelectLckTeamScreen( horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(top = 18.dp), ) { - itemsIndexed(shuffledTeams) { index, team -> + items( + items = shuffledTeams, + key = { team -> team.teamName }, + ) { team -> // 팀이 선택된 상태인지 확인 val isSelected = team == selectedTeam LckTeamItem(