Fix home shortcuts color
This commit is contained in:
parent
3f50a118f7
commit
87e4f78a1f
5 changed files with 13 additions and 13 deletions
|
@ -60,7 +60,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
|
|||
|
||||
if (sections.isEmpty()) {
|
||||
showEmptyView()
|
||||
shortcuts.visibility = View.GONE
|
||||
} else {
|
||||
emptyContainer.hide()
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import android.content.res.ColorStateList
|
|||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
|
||||
|
@ -45,8 +46,13 @@ class ColorIconsImageView : AppCompatImageView {
|
|||
|
||||
private fun setIconBackgroundColor(color: Int) {
|
||||
setBackgroundResource(R.drawable.color_circle_gradient)
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f))
|
||||
imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f))
|
||||
if (ATHUtil.isWindowBackgroundDark(context)) {
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.72f))
|
||||
imageTintList = ColorStateList.valueOf(ATHUtil.resolveColor(context, R.attr.colorPrimary))
|
||||
} else {
|
||||
backgroundTintList = ColorStateList.valueOf(ColorUtil.adjustAlpha(color, 0.22f))
|
||||
imageTintList = ColorStateList.valueOf(ColorUtil.withAlpha(color, 0.75f))
|
||||
}
|
||||
requestLayout()
|
||||
invalidate()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue