allow unlimited sized widget

but limit the max items to 50, just incase someone on a tablet makes it fullscreen
This commit is contained in:
Jays2Kings 2023-10-19 23:21:48 -07:00
parent de0f57e86f
commit 95e58a7d89
2 changed files with 2 additions and 3 deletions

View file

@ -39,6 +39,7 @@ import kotlinx.coroutines.MainScope
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.util.Calendar import java.util.Calendar
import java.util.Date import java.util.Date
import kotlin.math.min
class UpdatesGridGlanceWidget : GlanceAppWidget() { class UpdatesGridGlanceWidget : GlanceAppWidget() {
private val app: Application by injectLazy() private val app: Application by injectLazy()
@ -76,7 +77,7 @@ class UpdatesGridGlanceWidget : GlanceAppWidget() {
.flatMap { manager.getAppWidgetSizes(it) } .flatMap { manager.getAppWidgetSizes(it) }
.maxBy { it.height.value * it.width.value } .maxBy { it.height.value * it.width.value }
.calculateRowAndColumnCount() .calculateRowAndColumnCount()
val processList = list ?: RecentsPresenter.getRecentManga(customAmount = rowCount * columnCount) val processList = list ?: RecentsPresenter.getRecentManga(customAmount = min(50, rowCount * columnCount))
data = prepareList(processList, rowCount * columnCount) data = prepareList(processList, rowCount * columnCount)
ids.forEach { update(app, it) } ids.forEach { update(app, it) }

View file

@ -7,8 +7,6 @@
android:minHeight="60dp" android:minHeight="60dp"
android:minResizeWidth="80dp" android:minResizeWidth="80dp"
android:minResizeHeight="40dp" android:minResizeHeight="40dp"
android:maxResizeWidth="600dp"
android:maxResizeHeight="600dp"
android:targetCellWidth="4" android:targetCellWidth="4"
android:targetCellHeight="2" android:targetCellHeight="2"
android:resizeMode="horizontal|vertical" android:resizeMode="horizontal|vertical"