hotfix for calculating of pages size in pagination
This commit is contained in:
parent
967aa21a9c
commit
1087558670
@ -8,4 +8,4 @@ uuidVersion=0.1.0
|
|||||||
|
|
||||||
gradle_bintray_plugin_version=1.8.4
|
gradle_bintray_plugin_version=1.8.4
|
||||||
|
|
||||||
core_version=0.4.0
|
core_version=0.4.1
|
||||||
|
@ -45,6 +45,4 @@ fun calculatePagesNumber(datasetSize: Long, pageSize: Int): Int {
|
|||||||
/**
|
/**
|
||||||
* Calculates pages count for given [datasetSize]
|
* Calculates pages count for given [datasetSize]
|
||||||
*/
|
*/
|
||||||
fun calculatePagesNumber(datasetSize: Int, pageSize: Int): Int {
|
fun calculatePagesNumber(datasetSize: Int, pageSize: Int): Int = calculatePagesNumber(datasetSize.toLong(), pageSize)
|
||||||
return ceil(datasetSize.toDouble() / pageSize).toInt()
|
|
||||||
}
|
|
||||||
|
@ -15,7 +15,7 @@ fun <T> List<T>.createPaginationResult(
|
|||||||
commonObjectsNumber: Long
|
commonObjectsNumber: Long
|
||||||
) = PaginationResult(
|
) = PaginationResult(
|
||||||
pagination.page,
|
pagination.page,
|
||||||
calculatePagesNumber(commonObjectsNumber, size),
|
calculatePagesNumber(commonObjectsNumber, pagination.size),
|
||||||
this,
|
this,
|
||||||
size
|
pagination.size
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user