Small format fixes

This commit is contained in:
Melih Aksoy
2019-07-26 16:26:57 +02:00
parent c424dac57a
commit cd7f55046d
2 changed files with 5 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ abstract class BasePagingFactory<T> : DataSource.Factory<Int, T>() {
/**
* Invalidating the [currentSource]
* by calling [be.mediahuis.core.base.paging.BasePagingDataSource.invalidate]
* by calling [BasePagingDataSource.invalidate]
*/
fun invalidateDataSource() = currentSource.value?.invalidate()
// endregion

View File

@@ -102,10 +102,10 @@ internal class NetworkSource @Inject constructor(
val url = urlSplit[0]
val format = urlSplit[1].split(".")[1]
var requestedSize = DEFAULT_IMAGE_SIZE
if (!supportedSizes.contains(requestedSize)) {
requestedSize = supportedSizes.last { it < requestedSize }
val requestedSize = if (!supportedSizes.contains(DEFAULT_IMAGE_SIZE)) {
supportedSizes.last { it < DEFAULT_IMAGE_SIZE }
} else {
DEFAULT_IMAGE_SIZE
}
"${url}_$requestedSize.$format"