Small new user improvements (#1143)

- Changed empty library string
- Added empty view for Categories
This commit is contained in:
Bram van de Kerkhof
2018-01-01 14:57:20 +01:00
committed by GitHub
parent 0eae817aa6
commit bdcc6e52e6
8 changed files with 33 additions and 10 deletions

View File

@ -107,9 +107,14 @@ class CategoryController : NucleusController<CategoryPresenter>(),
fun setCategories(categories: List<CategoryItem>) {
actionMode?.finish()
adapter?.updateDataSet(categories)
val selected = categories.filter { it.isSelected }
if (selected.isNotEmpty()) {
selected.forEach { onItemLongClick(categories.indexOf(it)) }
if (categories.isNotEmpty()) {
empty_view.hide()
val selected = categories.filter { it.isSelected }
if (selected.isNotEmpty()) {
selected.forEach { onItemLongClick(categories.indexOf(it)) }
}
} else {
empty_view.show(R.drawable.ic_shape_black_128dp, R.string.information_empty_category)
}
}