diff --git a/core/ui/src/main/java/com/peonlee/core/ui/designsystem/chip/SmallChip.kt b/core/ui/src/main/java/com/peonlee/core/ui/designsystem/chip/SmallChip.kt index 79874944..34a81508 100644 --- a/core/ui/src/main/java/com/peonlee/core/ui/designsystem/chip/SmallChip.kt +++ b/core/ui/src/main/java/com/peonlee/core/ui/designsystem/chip/SmallChip.kt @@ -1,6 +1,7 @@ package com.peonlee.core.ui.designsystem.chip import android.content.Context +import android.content.res.ColorStateList import android.util.AttributeSet import android.view.LayoutInflater import com.peonlee.core.ui.R @@ -30,6 +31,21 @@ class SmallChip( context.theme ) ) + val chipBackgroundTint = getColor( + R.styleable.SmallChip_android_backgroundTint, + resources.getColor( + R.color.system_r50, + context.theme + ) + ) + /** + * TODO applyBackgroundAttributes Method 수정 필요 + * background, backgroundTint 둘 중에 하나만 설정할 수 있는 코드 + */ + binding.layoutSmallChipBackground.apply { + backgroundTintList = ColorStateList.valueOf(chipBackgroundTint) + } + applyTextAttributes( chipTitleText, chipTitleTextColor diff --git a/core/ui/src/main/res/values/attrs.xml b/core/ui/src/main/res/values/attrs.xml index 475e65c7..73fc1d0b 100644 --- a/core/ui/src/main/res/values/attrs.xml +++ b/core/ui/src/main/res/values/attrs.xml @@ -23,6 +23,7 @@ + diff --git a/feature/login/src/main/res/values-night/themes.xml b/feature/login/src/main/res/values-night/themes.xml index 8e89b598..f075cea5 100644 --- a/feature/login/src/main/res/values-night/themes.xml +++ b/feature/login/src/main/res/values-night/themes.xml @@ -3,5 +3,7 @@ \ No newline at end of file diff --git a/feature/main/build.gradle.kts b/feature/main/build.gradle.kts index 608a613c..c2eeb5ee 100644 --- a/feature/main/build.gradle.kts +++ b/feature/main/build.gradle.kts @@ -10,5 +10,6 @@ android { dependencies { implementation(project(":feature:home")) implementation(project(":feature:explore")) + implementation(project(":feature:user")) implementation(libs.bundles.fragment) } diff --git a/feature/user/.gitignore b/feature/user/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/feature/user/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/feature/user/build.gradle.kts b/feature/user/build.gradle.kts new file mode 100644 index 00000000..56d196a9 --- /dev/null +++ b/feature/user/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + id("peonlee.android.feature") +} + +android { + namespace = "com.peonlee.user" + viewBinding { enable = true } +} diff --git a/feature/user/src/main/AndroidManifest.xml b/feature/user/src/main/AndroidManifest.xml new file mode 100644 index 00000000..568741e5 --- /dev/null +++ b/feature/user/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/feature/user/src/main/java/com/peonlee/user/UserFragment.kt b/feature/user/src/main/java/com/peonlee/user/UserFragment.kt new file mode 100644 index 00000000..4f1794d0 --- /dev/null +++ b/feature/user/src/main/java/com/peonlee/user/UserFragment.kt @@ -0,0 +1,32 @@ +package com.peonlee.user + +import android.view.LayoutInflater +import android.view.ViewGroup +import com.peonlee.core.ui.base.BaseFragment +import com.peonlee.user.databinding.FragmentUserBinding + +/** + * 사용자 마이 페이지 Fragment + */ +class UserFragment : BaseFragment() { + override fun bindingFactory(parent: ViewGroup): FragmentUserBinding { + return FragmentUserBinding.inflate( + LayoutInflater.from(parent.context), + parent, + false + ) + } + + override fun initViews() = with(binding) { + // TODO 실제 사용자 정보로 대체 필요 + tvNickname.text = "꿈꾸는날다람쥐" + // 작성한 리뷰 개수 + tvCommentCount.text = getString(R.string.count, 24) + // 평가한 상품 개수 + tvEvaluateCount.text = getString(R.string.count, 102) + } + + companion object { + fun getInstance() = UserFragment() + } +} diff --git a/feature/user/src/main/res/layout/fragment_user.xml b/feature/user/src/main/res/layout/fragment_user.xml new file mode 100644 index 00000000..5548b801 --- /dev/null +++ b/feature/user/src/main/res/layout/fragment_user.xml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/feature/user/src/main/res/values/strings.xml b/feature/user/src/main/res/values/strings.xml new file mode 100644 index 00000000..1ae7925c --- /dev/null +++ b/feature/user/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + + + %d개 + \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 10679cc9..f82b242e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -48,3 +48,4 @@ include(":core:domain") include(":feature:detail") include(":core:model") include(":core:common") +include(":feature:user")