Skip to content

Commit

Permalink
fix big hint background not showing on low apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Razeeman committed Feb 11, 2024
1 parent d92ea55 commit 345c86d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.example.util.simpletimetracker.feature_views

import android.content.Context
import android.content.res.ColorStateList
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.isVisible
import com.example.util.simpletimetracker.feature_views.databinding.HintBigViewLayoutBinding
import com.example.util.simpletimetracker.feature_views.extension.getThemedAttr
import com.example.util.simpletimetracker.feature_views.extension.setOnClick

class HintBigView @JvmOverloads constructor(
Expand Down Expand Up @@ -42,20 +40,13 @@ class HintBigView @JvmOverloads constructor(
}

init {
initProps()
initAttrs(context, attrs, defStyleAttr)
}

fun setOnCloseClick(action: () -> Unit) {
binding.btnHintBigClose.setOnClick(action)
}

private fun initProps() {
setBackgroundResource(R.drawable.bg_rounded_corners)
val backgroundTint = context.getThemedAttr(R.attr.appActiveColor)
backgroundTintList = ColorStateList.valueOf(backgroundTint)
}

private fun initAttrs(
context: Context,
attrs: AttributeSet?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
android:id="@+id/containerChangeRecordUntrackedHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:background="@drawable/bg_rounded_corners"
tools:backgroundTint="?appActiveColor"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">

<androidx.appcompat.widget.AppCompatImageView
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/bg_rounded_corners"
android:backgroundTint="?appActiveColor"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivHintBigIcon"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 345c86d

Please sign in to comment.