Compare commits

...

2 Commits

Author SHA1 Message Date
Matéo Duparc d572a8d2dc
Update dependencies 2021-11-07 12:55:39 +01:00
Matéo Duparc 01a9c261f5
Fix image viewer 2021-11-07 12:53:38 +01:00
3 changed files with 17 additions and 5 deletions

View File

@ -57,7 +57,7 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "androidx.core:core-ktx:1.6.0"
implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "androidx.constraintlayout:constraintlayout:2.1.1"
@ -68,7 +68,7 @@ dependencies {
implementation "com.github.bumptech.glide:glide:4.12.0"
implementation "androidx.biometric:biometric:1.1.0"
def exoplayer_version = "2.15.1"
def exoplayer_version = "2.16.0"
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"

@ -1 +1 @@
Subproject commit bd5d53f50eb274ed084e9f363ccfbe30d9061039
Subproject commit 19731536027d0b64c19742846bf8dda6920110ba

View File

@ -150,8 +150,20 @@ class ImageViewer: FileViewerActivity() {
private fun loadImage(){
loadWholeFile(filePath)?.let {
bitmap = BitmapFactory.decodeByteArray(it, 0, it.size)
Glide.with(this).load(bitmap).into(binding.imageViewer)
val displayWithGlide = if (it.size < 5_000_000) {
true
} else {
val decodedBitmap = BitmapFactory.decodeByteArray(it, 0, it.size)
if (decodedBitmap == null) {
true
} else {
Glide.with(this).load(decodedBitmap).fitCenter().into(binding.imageViewer)
false
}
}
if (displayWithGlide) {
Glide.with(this).load(it).into(binding.imageViewer)
}
fileName = File(filePath).name
binding.textFilename.text = fileName
rotationAngle = 0F