pass in the color value for the attribute instead of looking up again

This commit is contained in:
CarlosEsco 2020-04-22 13:00:19 -04:00
parent c035745b94
commit f0cf0f4106

View file

@ -38,12 +38,9 @@ class ReaderChapterSheet @JvmOverloads constructor(context: Context, attrs: Attr
fun setup(activity: ReaderActivity) {
presenter = activity.presenter
val primary = ColorUtils.setAlphaComponent(
activity.getResourceColor(
R.attr.colorSecondary
), 200
)
val fullPrimary = activity.getResourceColor(R.attr.colorSecondary)
val primary = ColorUtils.setAlphaComponent( fullPrimary, 200)
sheetBehavior = BottomSheetBehavior.from(this)
chapters_button.setOnClickListener {
if (sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) sheetBehavior?.state =