Migrate to Glide (#1175)
* Replace Picasso library with Glide library tuskyapp#1082 * Replace Picasso library with Glide library tuskyapp#1082 * Update load emoji with glide * Update context used for Glide * Removed unused import * Replace deprecated SimpleTarget with CustomTarget * Fix crash at the view image fragment, remove override image size * Replace Single.create with Single.fromCallable * View image fragment refactor * Fix after merge * Try to load cached image first and show progress view on failure * Try to load cached image first and show progress view on failure
This commit is contained in:
parent
db51c23717
commit
76ce28980c
32 changed files with 260 additions and 322 deletions
|
|
@ -16,10 +16,8 @@
|
|||
package com.keylesspalace.tusky.util
|
||||
|
||||
import android.graphics.Matrix
|
||||
import android.widget.ImageView
|
||||
|
||||
import com.keylesspalace.tusky.entity.Attachment.Focus
|
||||
import com.squareup.picasso.Callback
|
||||
|
||||
/**
|
||||
* Calculates the image matrix needed to maintain the correct cropping for image views based on
|
||||
|
|
@ -88,10 +86,10 @@ object FocalPointUtil {
|
|||
*/
|
||||
fun calculateScaling(viewWidth: Float, viewHeight: Float,
|
||||
imageWidth: Float, imageHeight: Float): Float {
|
||||
if (isVerticalCrop(viewWidth, viewHeight, imageWidth, imageHeight)) {
|
||||
return viewWidth / imageWidth
|
||||
return if (isVerticalCrop(viewWidth, viewHeight, imageWidth, imageHeight)) {
|
||||
viewWidth / imageWidth
|
||||
} else { // horizontal crop:
|
||||
return viewHeight / imageHeight
|
||||
viewHeight / imageHeight
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue