properly update file/folder placeholder colors when text color changes
This commit is contained in:
parent
d2dcc5417f
commit
0a023dd0fa
2 changed files with 9 additions and 6 deletions
|
@ -97,7 +97,7 @@ class ItemsAdapter(activity: SimpleActivity, var fileDirItems: MutableList<FileD
|
||||||
|
|
||||||
override fun getItemCount() = fileDirItems.size
|
override fun getItemCount() = fileDirItems.size
|
||||||
|
|
||||||
private fun initDrawables() {
|
fun initDrawables() {
|
||||||
folderDrawable = activity.resources.getColoredDrawableWithColor(R.drawable.ic_folder, textColor)
|
folderDrawable = activity.resources.getColoredDrawableWithColor(R.drawable.ic_folder, textColor)
|
||||||
fileDrawable = activity.resources.getColoredDrawableWithColor(R.drawable.ic_file, textColor)
|
fileDrawable = activity.resources.getColoredDrawableWithColor(R.drawable.ic_file, textColor)
|
||||||
folderDrawable.alpha = 180
|
folderDrawable.alpha = 180
|
||||||
|
|
|
@ -75,12 +75,15 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
|
||||||
super.onResume()
|
super.onResume()
|
||||||
context!!.updateTextColors(mView as ViewGroup)
|
context!!.updateTextColors(mView as ViewGroup)
|
||||||
mView.items_fastscroller.updateHandleColor()
|
mView.items_fastscroller.updateHandleColor()
|
||||||
val newColor = context!!.config.textColor
|
val newTextColor = context!!.config.textColor
|
||||||
if (storedTextColor != newColor) {
|
if (storedTextColor != newTextColor) {
|
||||||
storedItems = ArrayList()
|
storedItems = ArrayList()
|
||||||
(items_list.adapter as? ItemsAdapter)?.updateTextColor(newColor)
|
(items_list.adapter as? ItemsAdapter)?.apply {
|
||||||
mView.breadcrumbs.updateColor(newColor)
|
updateTextColor(newTextColor)
|
||||||
storedTextColor = newColor
|
initDrawables()
|
||||||
|
}
|
||||||
|
mView.breadcrumbs.updateColor(newTextColor)
|
||||||
|
storedTextColor = newTextColor
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshItems()
|
refreshItems()
|
||||||
|
|
Loading…
Reference in a new issue