Fix home shortcuts color

This commit is contained in:
h4h13 2019-10-09 20:04:01 +05:30
parent 3f50a118f7
commit 87e4f78a1f
5 changed files with 13 additions and 13 deletions

View file

@ -60,7 +60,6 @@ class BannerHomeFragment : AbsMainActivityFragment(), MainActivityFragmentCallba
if (sections.isEmpty()) {
showEmptyView()
shortcuts.visibility = View.GONE
} else {
emptyContainer.hide()
}

View file

@ -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()
}