mirror of
https://github.com/melihaksoy/Android-Kotlin-Modulerized-CleanArchitecture.git
synced 2026-03-17 23:14:07 +01:00
Fixed detekt findings, removed test code
This commit is contained in:
@@ -39,4 +39,4 @@ interface InteractorParameters
|
||||
/**
|
||||
* Symbolizes absence of parameters for an [interactor][BaseInteractor]
|
||||
*/
|
||||
class None : Any(), InteractorParameters
|
||||
class None : InteractorParameters
|
||||
|
||||
@@ -143,21 +143,18 @@ internal class LaunchesSource @Inject constructor(
|
||||
launch
|
||||
}
|
||||
|
||||
private fun transformImageUrl(imageUrl: String, supportedSizes: IntArray) =
|
||||
try {
|
||||
val urlSplit = imageUrl.split("_")
|
||||
val url = urlSplit[0]
|
||||
val format = urlSplit[1].split(".")[1]
|
||||
private fun transformImageUrl(imageUrl: String, supportedSizes: IntArray): String {
|
||||
val urlSplit = imageUrl.split("_")
|
||||
val url = urlSplit[0]
|
||||
val format = urlSplit[1].split(".")[1]
|
||||
|
||||
val requestedSize = if (!supportedSizes.contains(DEFAULT_IMAGE_SIZE)) {
|
||||
supportedSizes.last { it < DEFAULT_IMAGE_SIZE }
|
||||
} else {
|
||||
DEFAULT_IMAGE_SIZE
|
||||
}
|
||||
|
||||
"${url}_$requestedSize.$format"
|
||||
} catch (e: Exception) {
|
||||
imageUrl
|
||||
val requestedSize = if (!supportedSizes.contains(DEFAULT_IMAGE_SIZE)) {
|
||||
supportedSizes.last { it < DEFAULT_IMAGE_SIZE }
|
||||
} else {
|
||||
DEFAULT_IMAGE_SIZE
|
||||
}
|
||||
|
||||
return "${url}_$requestedSize.$format"
|
||||
}
|
||||
//endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user