Skip to content

Commit

Permalink
[chore] #15 themes, PingleChip 되돌리기
Browse files Browse the repository at this point in the history
  • Loading branch information
HAJIEUN02 committed Jan 7, 2024
1 parent a8005a7 commit 9163fd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/src/main/java/org/sopt/pingle/util/component/PingleChip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ import org.sopt.pingle.util.view.stringOf
class PingleChip @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = R.style.Theme_Pingle_Chip,
defStyleAttr: Int = R.style.Theme_Pingle_Chip_All,
) : Chip(context, attrs, defStyleAttr) {
private lateinit var _categoryType: CategoryType
val categoryType get() = _categoryType

private fun setColorStateList(
context: Context,
activatedColorRes: Int,
inactivatedColorRes: Int,
inactivatedColorRes: Int
) =
ColorStateList(
arrayOf(
intArrayOf(android.R.attr.state_checked),
intArrayOf(-android.R.attr.state_checked),
intArrayOf(-android.R.attr.state_checked)
),
intArrayOf(
colorOf(activatedColorRes),
colorOf(inactivatedColorRes)
)
),
)

fun setChipCategoryType(categoryType: CategoryType) {
Expand All @@ -51,13 +51,13 @@ class PingleChip @JvmOverloads constructor(
chipBackgroundColor = setColorStateList(
context = context,
activatedColorRes = categoryType.backgroundChipColor,
inactivatedColorRes = inactivatedChipColor,
inactivatedColorRes = inactivatedChipColor
)
setTextColor(
setColorStateList(
context = context,
activatedColorRes = categoryType.textColor,
inactivatedColorRes = inactivatedTextColor,
inactivatedColorRes = inactivatedTextColor
),
)
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</style>

<style name="Theme.Pingle" parent="Base.Theme.Pingle" />

<!-- Button -->
<style name="Theme.Pingle.Button" parent="Widget.Material3.Button">
<item name="android:insetTop">0dp</item>
Expand Down

0 comments on commit 9163fd6

Please sign in to comment.