color.xml 파일에 있는 색상 코틀린 파일에서 사용하기
btnNutrition.setTextColor(ContextCompat.getColor(requireContext(), R.color.red))
color = resources.getColor(R.color.orange)
bottom sheet 구현 중 화면에 둥근 모서리 적용이 안되는 경우
- themes.xml에 다음 코드를 입력하고 style을 적용시키면 해결된다.
<style name="DialogCustomTheme" parent="android:Theme.Holo.Dialog.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
</style>
val bottomSheetFragment = BottomSheetFragment()
val bundle = Bundle()
bundle.putInt("position", position)
bottomSheetFragment.arguments = bundle
bottomSheetFragment.setStyle(STYLE_NORMAL, R.style.DialogCustomTheme)
bottomSheetFragment.show(childFragmentManager, bottomSheetFragment.tag)