Themes 파일에서 아래와 같이 설정되어 있고,
parent="Theme.MaterialComponents.Light.NoActionBar"
fragment_home.xml 파일에서 아래와 같이 chip을 만들어 주었습니다.
<com.google.android.material.chip.Chip
android:id="@+id/chip_Front"
style="@style/Widget.MaterialComponents.Chip.Choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="Front-end"
android:textSize="14sp" />
chipBackgroundColor 를 통해 배경색을 바꾸어 줄 수 있지만, check상태에서도 그 색을 유지하더라구요.
저는 check를 했을 때와 안했을 때 색상 차이를 주고싶어서 HomeFragment.kt에서 코드를 통해 변경해주는 방법을 찾았고
아래와 같이 적용을 시켜주었습니다.
val chip_Front = view.findViewById<Chip>(R.id.chip_Front)
chip_Front.apply {
isCheckable = false
chipBackgroundColor = ColorStateList(
arrayOf(
intArrayOf(-android.R.attr.state_checked), intArrayOf(android.R.attr.state_checked)
),
intArrayOf(R.color.gray1, R.color.front_end)
)
}
색은 변경이 되더라구요 제가 원하는건 check가 아닐 때 회색이고, check 상태일 때 원하는 색으로 하고싶은데

이렇게 제가 설정도 안한 색으로 변경이 됩니다. isCheckable=false 를 통해 처음 시작부터 체크를 푼 상태에서 들어갔는데
회색이 아닌 저 색이 나오고, 저는 눌렀을 때 하늘색이 나오도록 설정했는데, 저런 보라색만 나옵니다.
어떻게 해결해야 할까요? 커스텀 chip 에 관한 내용은 많지 않아서 혼자 해결하는데 힘이 드네요
도움을 구하고 싶습니다!