mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-01 00:39:54 +00:00
android: workaround of pager's bug (#3988)
This commit is contained in:
+3
-2
@@ -1392,11 +1392,12 @@ private fun providerForGallery(
|
||||
return null
|
||||
}
|
||||
|
||||
var initialIndex = Int.MAX_VALUE / 2
|
||||
// Pager has a bug with overflowing when total pages is around Int.MAX_VALUE. Using smaller value
|
||||
var initialIndex = 10000 / 2
|
||||
var initialChatId = cItemId
|
||||
return object: ImageGalleryProvider {
|
||||
override val initialIndex: Int = initialIndex
|
||||
override val totalMediaSize = mutableStateOf(Int.MAX_VALUE)
|
||||
override val totalMediaSize = mutableStateOf(10000)
|
||||
override fun getMedia(index: Int): ProviderMedia? {
|
||||
val internalIndex = initialIndex - index
|
||||
val item = item(internalIndex, initialChatId)?.second ?: return null
|
||||
|
||||
Reference in New Issue
Block a user