Navigate to previous page if current one is empty

This commit is contained in:
Ensar Sarajčić 2023-07-20 12:09:28 +02:00
parent 9906ef05af
commit 35fe1da420
1 changed files with 9 additions and 0 deletions

View File

@ -169,6 +169,11 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
}
gridItems.removeIf { it.id == item.id }
if (currentPage > getMaxPage()) {
post {
prevPage()
}
}
redrawGrid()
}
}
@ -529,6 +534,10 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
} else {
removeItemFromHomeScreen(item)
}
if (currentPage > getMaxPage()) {
prevPage(redraw = true)
}
}
}
}