mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Remove unneeded code
This commit is contained in:
parent
932f1770ff
commit
cbe3a04b5a
1 changed files with 3 additions and 9 deletions
|
|
@ -95,7 +95,6 @@ class ShelfListener : InteractionListener {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val itemsPerPage = 4
|
val itemsPerPage = 4
|
||||||
val totalPages = (shelfItemsNames.size + itemsPerPage - 1) / itemsPerPage // Total number of pages
|
|
||||||
|
|
||||||
when (stage) {
|
when (stage) {
|
||||||
0, shelfItemsNames.size + 1 -> { // Initial stage or final more button clicked
|
0, shelfItemsNames.size + 1 -> { // Initial stage or final more button clicked
|
||||||
|
|
@ -106,14 +105,9 @@ class ShelfListener : InteractionListener {
|
||||||
val currentPage = stage / (itemsPerPage + 1)
|
val currentPage = stage / (itemsPerPage + 1)
|
||||||
val startIndex = currentPage * itemsPerPage
|
val startIndex = currentPage * itemsPerPage
|
||||||
|
|
||||||
if (buttonID == itemsPerPage + 1) { // "More" button clicked
|
if (buttonID == itemsPerPage + 1) { // "More" button clicked (but not the last one)
|
||||||
if (currentPage < totalPages) {
|
|
||||||
val topics = createTopics(currentPage + 1, itemsPerPage)
|
val topics = createTopics(currentPage + 1, itemsPerPage)
|
||||||
showTopics(*topics.toTypedArray()).also { stage = currentPage*4 + 1 }
|
showTopics(*topics.toTypedArray()).also { stage = currentPage*4 + 1 }
|
||||||
} else { // Last page, loop back to the first page
|
|
||||||
val topics = createTopics(1, itemsPerPage)
|
|
||||||
showTopics(*topics.toTypedArray()).also { stage = 1 }
|
|
||||||
}
|
|
||||||
} else { // Handle item selection
|
} else { // Handle item selection
|
||||||
val itemIndex = startIndex + (buttonID - 1)
|
val itemIndex = startIndex + (buttonID - 1)
|
||||||
if (itemIndex < shelfItemsNames.size) {
|
if (itemIndex < shelfItemsNames.size) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue