Skip to content

Commit

Permalink
[MOVE/#15] core designsystem 패키지로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Jul 7, 2024
1 parent 2b42794 commit 4362d0f
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.terning.core.designsystem.topappbar

import androidx.compose.runtime.Composable

@Composable
fun BackButtonTopAppBar(
title: String, onBackButtonClick: (() -> Unit),
) {
TerningTopAppBar(
title = title,
showBackButton = true,
onBackButtonClick = { onBackButtonClick.invoke() },
)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.terning.feature.component.topappbar
package com.terning.core.designsystem.topappbar

import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import com.terning.feature.R
import com.terning.core.R

@Composable
fun LogoTopAppBar() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.terning.feature.component.topappbar
package com.terning.core.designsystem.topappbar

import androidx.compose.foundation.layout.Row
import androidx.compose.material3.Icon
Expand All @@ -9,8 +9,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.terning.core.R
import com.terning.core.designsystem.theme.TerningTypography
import com.terning.feature.R

@Composable
fun MyPageTopAppBar() {
Expand All @@ -30,7 +30,7 @@ fun MyPageTopAppBar() {
IconButton(onClick = {
}) {
Icon(
painter = painterResource(id = R.drawable.ic_20_right),
painter = painterResource(id = R.drawable.ic_right),
contentDescription = stringResource(id = R.string.ic_20_right)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.terning.feature.component.topappbar
package com.terning.core.designsystem.topappbar

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -13,16 +13,16 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.terning.core.R
import com.terning.core.designsystem.theme.TerningTypography
import com.terning.feature.R

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TerningTopAppBar(
title: String = "",
showBackButton: Boolean = false,
customActions: List<@Composable (() -> Unit)>? = null,
onBackButtonClick: (() -> Unit)? = null,
customActions: List<@Composable () -> Unit> = emptyList(),
onBackButtonClick: () -> Unit = {},
) {
CenterAlignedTopAppBar(
title = {
Expand All @@ -38,19 +38,19 @@ fun TerningTopAppBar(
navigationIcon = {
if (showBackButton) {
IconButton(onClick = {
onBackButtonClick?.invoke()
onBackButtonClick.invoke()
}) {
Icon(
painter = painterResource(id = R.drawable.ic_back),
contentDescription = stringResource(id = R.string.ic_back)
)
}
} else {
customActions?.getOrNull(0)?.invoke()
customActions.getOrNull(0)?.invoke()
}
},
actions = {
customActions?.drop(1)?.forEach { customAction ->
customActions.drop(1).forEach { customAction ->
customAction()
}
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- ContentDescription-->
<string name="ic_back">뒤로가기 버튼</string>
<string name="ic_logo">탑 바 로고</string>
<string name="ic_20_right">오른쪽 버튼</string>

<!-- MyPage-->
<string name="my_page_top_app_bar">프로필 수정</string>
</resources>

This file was deleted.

6 changes: 3 additions & 3 deletions feature/src/main/java/com/terning/feature/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.White
import com.terning.feature.calendar.navigation.calendarNavGraph
import com.terning.feature.component.topappbar.LogoTopAppBar
import com.terning.feature.component.topappbar.MyPageTopAppBar
import com.terning.feature.component.topappbar.TerningTopAppBar
import com.terning.core.designsystem.topappbar.LogoTopAppBar
import com.terning.core.designsystem.topappbar.MyPageTopAppBar
import com.terning.core.designsystem.topappbar.TerningTopAppBar
import com.terning.feature.home.navigation.homeNavGraph
import com.terning.feature.mypage.navigation.myPageNavGraph
import com.terning.feature.search.navigation.searchNavGraph
Expand Down
8 changes: 0 additions & 8 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@
<string name="bottom_nav_calendar">캘린더</string>
<string name="bottom_nav_search">탐색</string>
<string name="bottom_nav_my_page">마이페이지</string>

<!-- ContentDescription-->
<string name="ic_back">뒤로가기 버튼</string>
<string name="ic_logo">탑 바 로고</string>
<string name="ic_20_right">오른쪽 버튼</string>

<!-- MyPage-->
<string name="my_page_top_app_bar">프로필 수정</string>
</resources>

0 comments on commit 4362d0f

Please sign in to comment.