summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Haibo Huang <hhb@google.com> 2019-05-23 20:53:17 -0700
committer Haibo Huang <hhb@google.com> 2019-05-28 17:23:44 +0000
commit11ab9505608befcfd97a7a942ed50bff3105a9a0 (patch)
tree50b1bfa601be073c74b1b3db56eba748904c6b27
parent70682e9f17e3569a6bf79ec2a75181c6ec4e0b37 (diff)
Fix compilation issues with new kotlin compiler
These code failed with kotlinc v1.3.31. 1) Drawable.draw is marked as @NotNull. The declaration in both side doesn't match. 2) Seems kotlin doesn't recognize getMatrix / setMatrix as a property now. This is a little weird but may also because of @NotNull annotation in setMatrix parameter. Test: build with old and new compiler Change-Id: Id7f34229e29bbceb6271a0648acf3512c10ed04c Merged-In: Id5a85c787876248e610cc668f54e7bd40629d4e0
-rw-r--r--packages/EasterEgg/src/com/android/egg/paint/BrushPropertyDrawable.kt4
-rw-r--r--packages/EasterEgg/src/com/android/egg/paint/Painting.kt4
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/EasterEgg/src/com/android/egg/paint/BrushPropertyDrawable.kt b/packages/EasterEgg/src/com/android/egg/paint/BrushPropertyDrawable.kt
index 4a02ee688cf4..d06e5ec634de 100644
--- a/packages/EasterEgg/src/com/android/egg/paint/BrushPropertyDrawable.kt
+++ b/packages/EasterEgg/src/com/android/egg/paint/BrushPropertyDrawable.kt
@@ -62,7 +62,7 @@ class BrushPropertyDrawable : Drawable {
return _size
}
- override fun draw(c: Canvas?) {
+ override fun draw(c: Canvas) {
c?.let {
val w = bounds.width().toFloat()
val h = bounds.height().toFloat()
@@ -90,4 +90,4 @@ class BrushPropertyDrawable : Drawable {
//
}
-} \ No newline at end of file
+}
diff --git a/packages/EasterEgg/src/com/android/egg/paint/Painting.kt b/packages/EasterEgg/src/com/android/egg/paint/Painting.kt
index a4a3d3d835e0..5431ae539ba1 100644
--- a/packages/EasterEgg/src/com/android/egg/paint/Painting.kt
+++ b/packages/EasterEgg/src/com/android/egg/paint/Painting.kt
@@ -333,11 +333,11 @@ public class Painting : View, SpotFilter.Plotter {
bits.width.toFloat()/oldBits.height,
bits.height.toFloat()/oldBits.width)
}
- c.matrix = matrix
+ c.setMatrix(matrix)
}
// paint the old artwork atop the new
c.drawBitmap(oldBits, 0f, 0f, _drawPaint)
- c.matrix = Matrix()
+ c.setMatrix(Matrix())
} else {
c.drawColor(paperColor)
}