Merge pull request #13207 from TobiGr/small-fixes
Small improvements to Image handling
This commit is contained in:
commit
df90d16d8d
2 changed files with 11 additions and 3 deletions
|
|
@ -216,9 +216,9 @@ public abstract class BaseDescriptionFragment extends BaseFragment {
|
||||||
|| image.getWidth() != Image.WIDTH_UNKNOWN
|
|| image.getWidth() != Image.WIDTH_UNKNOWN
|
||||||
// if even the resolution level is unknown, ?x? will be shown
|
// if even the resolution level is unknown, ?x? will be shown
|
||||||
|| image.getEstimatedResolutionLevel() == Image.ResolutionLevel.UNKNOWN) {
|
|| image.getEstimatedResolutionLevel() == Image.ResolutionLevel.UNKNOWN) {
|
||||||
urls.append(imageSizeToText(image.getHeight()));
|
|
||||||
urls.append('x');
|
|
||||||
urls.append(imageSizeToText(image.getWidth()));
|
urls.append(imageSizeToText(image.getWidth()));
|
||||||
|
urls.append('x');
|
||||||
|
urls.append(imageSizeToText(image.getHeight()));
|
||||||
} else {
|
} else {
|
||||||
switch (image.getEstimatedResolutionLevel()) {
|
switch (image.getEstimatedResolutionLevel()) {
|
||||||
case LOW -> urls.append(getString(R.string.image_quality_low));
|
case LOW -> urls.append(getString(R.string.image_quality_low));
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,15 @@ object ImageStrategy {
|
||||||
fun dbUrlToImageList(url: String?): List<Image> {
|
fun dbUrlToImageList(url: String?): List<Image> {
|
||||||
return when (url) {
|
return when (url) {
|
||||||
null -> listOf()
|
null -> listOf()
|
||||||
else -> listOf(Image(url, -1, -1, ResolutionLevel.UNKNOWN))
|
|
||||||
|
else -> listOf(
|
||||||
|
Image(
|
||||||
|
url,
|
||||||
|
Image.HEIGHT_UNKNOWN,
|
||||||
|
Image.WIDTH_UNKNOWN,
|
||||||
|
ResolutionLevel.UNKNOWN
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue