mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-17 12:10:47 +01:00
update Commons to 2.23.7
This commit is contained in:
parent
d6f367e845
commit
59eb2523cb
@ -32,7 +32,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.simplemobiletools:commons:2.21.12'
|
compile 'com.simplemobiletools:commons:2.23.7'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import android.view.MotionEvent
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.load.DecodeFormat
|
import com.bumptech.glide.load.DecodeFormat
|
||||||
|
import com.bumptech.glide.request.RequestOptions
|
||||||
import com.simplemobiletools.commons.extensions.getContrastColor
|
import com.simplemobiletools.commons.extensions.getContrastColor
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@ -89,13 +90,17 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
|||||||
Thread({
|
Thread({
|
||||||
val size = Point()
|
val size = Point()
|
||||||
activity.windowManager.defaultDisplay.getSize(size)
|
activity.windowManager.defaultDisplay.getSize(size)
|
||||||
mBackgroundBitmap = Glide.with(context)
|
val options = RequestOptions()
|
||||||
.load(path)
|
|
||||||
.asBitmap()
|
|
||||||
.format(DecodeFormat.PREFER_ARGB_8888)
|
.format(DecodeFormat.PREFER_ARGB_8888)
|
||||||
.fitCenter()
|
.fitCenter()
|
||||||
|
|
||||||
|
val builder = Glide.with(context)
|
||||||
|
.asBitmap()
|
||||||
|
.load(path)
|
||||||
|
.apply(options)
|
||||||
.into(size.x, size.y)
|
.into(size.x, size.y)
|
||||||
.get()
|
|
||||||
|
mBackgroundBitmap = builder.get()
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
invalidate()
|
invalidate()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user