Fix list colors
This commit is contained in:
parent
12c87eb74b
commit
b41288f7b8
16 changed files with 37 additions and 1083 deletions
|
@ -99,7 +99,8 @@ class HomeAdapter(
|
|||
fun bindView(home: Home) {
|
||||
recyclerView.apply {
|
||||
layoutManager = GridLayoutManager(activity, 1, GridLayoutManager.HORIZONTAL, false)
|
||||
val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList<Artist>, PreferenceUtil.getInstance(activity).getHomeGridStyle(context!!), false, null)
|
||||
val artistAdapter = ArtistAdapter(activity, home.arrayList as ArrayList<Artist>,
|
||||
PreferenceUtil.getInstance(activity).getHomeGridStyle(activity), false, null)
|
||||
adapter = artistAdapter
|
||||
}
|
||||
|
||||
|
|
|
@ -97,12 +97,13 @@ open class AlbumAdapter(protected val activity: AppCompatActivity,
|
|||
}
|
||||
|
||||
protected open fun setColors(color: Int, holder: ViewHolder) {
|
||||
holder.paletteColorContainer?.let {
|
||||
it.setBackgroundColor(color)
|
||||
if (holder.paletteColorContainer != null) {
|
||||
holder.title?.setTextColor(
|
||||
MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)))
|
||||
holder.text?.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)))
|
||||
holder.paletteColorContainer?.setBackgroundColor(color)
|
||||
}
|
||||
|
||||
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
|
||||
}
|
||||
|
||||
|
@ -121,10 +122,7 @@ open class AlbumAdapter(protected val activity: AppCompatActivity,
|
|||
}
|
||||
|
||||
override fun onColorReady(color: Int) {
|
||||
if (usePalette)
|
||||
setColors(color, holder)
|
||||
else
|
||||
setColors(defaultFooterColor, holder)
|
||||
setColors(color, holder)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class ArtistAdapter(val activity: AppCompatActivity,
|
|||
@LayoutRes var itemLayoutRes: Int,
|
||||
var usePalette: Boolean,
|
||||
cabHolder: CabHolder?
|
||||
) : AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist>(activity, cabHolder, code.name.monkey.retromusic.R.menu.menu_media_selection), FastScrollRecyclerView.SectionedAdapter {
|
||||
) : AbsMultiSelectAdapter<ArtistAdapter.ViewHolder, Artist>(activity, cabHolder, R.menu.menu_media_selection), FastScrollRecyclerView.SectionedAdapter {
|
||||
|
||||
fun swapDataSet(dataSet: ArrayList<Artist>) {
|
||||
this.dataSet = dataSet
|
||||
|
@ -67,10 +67,11 @@ class ArtistAdapter(val activity: AppCompatActivity,
|
|||
}
|
||||
|
||||
fun setColors(color: Int, holder: ViewHolder) {
|
||||
holder.paletteColorContainer?.let {
|
||||
it.setBackgroundColor(color)
|
||||
if (holder.paletteColorContainer != null) {
|
||||
holder.paletteColorContainer?.setBackgroundColor(color)
|
||||
holder.title?.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)))
|
||||
}
|
||||
|
||||
holder.mask?.backgroundTintList = ColorStateList.valueOf(color)
|
||||
}
|
||||
|
||||
|
@ -87,10 +88,7 @@ class ArtistAdapter(val activity: AppCompatActivity,
|
|||
}
|
||||
|
||||
override fun onColorReady(color: Int) {
|
||||
if (usePalette)
|
||||
setColors(color, holder)
|
||||
else
|
||||
setColors(defaultFooterColor, holder)
|
||||
setColors(color, holder)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue