diff --git a/LICENSE b/LICENSE index eeee762..c3ab817 100644 --- a/LICENSE +++ b/LICENSE @@ -755,9 +755,3 @@ JetBrains s.r.o. and Kotlin Programming Language contributors Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply See: https://github.com/JetBrains/kotlin/blob/master/license/README.md - - - PropertyLoader - Property annotation and loader for fields - [The Apache Software License, Version 2.0] - https://git.dorkbox.com/dorkbox/PropertyLoader - Copyright 2023 - Dorkbox LLC diff --git a/build.gradle.kts b/build.gradle.kts index 01df29c..5420fa1 100755 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,7 +104,7 @@ dependencies { api("com.dorkbox:TweenEngine:8.3.1") api("com.dorkbox:SwingActiveRender:1.3") api("com.dorkbox:Utilities:1.39") - api("com.dorkbox:PropertyLoader:1.1") + api("com.dorkbox:PropertyLoader:1.2") } publishToSonatype { diff --git a/src/dorkbox/notify/AppAccessor.kt b/src/dorkbox/notify/AppAccessor.kt index cec6b57..172640f 100644 --- a/src/dorkbox/notify/AppAccessor.kt +++ b/src/dorkbox/notify/AppAccessor.kt @@ -22,7 +22,8 @@ internal class AppAccessor : TweenAccessor { const val X_POS = 0 const val Y_POS = 1 const val X_Y_POS = 2 - const val PROGRESS = 3 + const val SHAKE = 3 + const val PROGRESS = 4 } override fun getValues(target: AppNotify, tweenType: Int, returnValues: FloatArray): Int { @@ -43,6 +44,12 @@ internal class AppAccessor : TweenAccessor { return 2 } + SHAKE -> { + returnValues[0] = target.x.toFloat() + returnValues[1] = target.y.toFloat() + return 2 + } + PROGRESS -> { returnValues[0] = target.progress.toFloat() return 1 @@ -68,6 +75,11 @@ internal class AppAccessor : TweenAccessor { return } + SHAKE -> { + target.setLocationInternal(newValues[0].toInt(), newValues[1].toInt()) + return + } + PROGRESS -> { target.progress = newValues[0].toInt() return diff --git a/src/dorkbox/notify/AppNotify.kt b/src/dorkbox/notify/AppNotify.kt index 0602633..5e4fb8b 100755 --- a/src/dorkbox/notify/AppNotify.kt +++ b/src/dorkbox/notify/AppNotify.kt @@ -259,7 +259,7 @@ internal class AppNotify(override val notification: Notify): Canvas(), NotifyTyp override fun doShake(count: Int, targetX: Float, targetY: Float) { if (shakeTween != null) { shakeTween!!.valueRelative(targetX, targetY) - .repeatAutoReverse(count, 0f) + .repeatAutoReverse(count, 0f) } else { val tween = tweenEngine .to(this, AppAccessor.X_Y_POS, tweenAccessor, 0.05f) diff --git a/src/dorkbox/notify/DesktopAccessor.kt b/src/dorkbox/notify/DesktopAccessor.kt index 977aa43..1c86881 100644 --- a/src/dorkbox/notify/DesktopAccessor.kt +++ b/src/dorkbox/notify/DesktopAccessor.kt @@ -22,7 +22,8 @@ internal class DesktopAccessor : TweenAccessor { const val X_POS = 0 const val Y_POS = 1 const val X_Y_POS = 2 - const val PROGRESS = 3 + const val SHAKE = 3 + const val PROGRESS = 4 } override fun getValues(target: DesktopNotify, tweenType: Int, returnValues: FloatArray): Int { @@ -43,6 +44,12 @@ internal class DesktopAccessor : TweenAccessor { return 2 } + SHAKE -> { + returnValues[0] = target.x.toFloat() + returnValues[1] = target.y.toFloat() + return 2 + } + PROGRESS -> { returnValues[0] = target.progress.toFloat() return 1 @@ -68,6 +75,11 @@ internal class DesktopAccessor : TweenAccessor { return } + SHAKE -> { + target.setLocationInternal(newValues[0].toInt(), newValues[1].toInt()) + return + } + PROGRESS -> { target.progress = newValues[0].toInt() return diff --git a/test/dorkbox/notify/NotifyTest.kt b/test/dorkbox/notify/NotifyTest.kt index 455608f..08fdef8 100755 --- a/test/dorkbox/notify/NotifyTest.kt +++ b/test/dorkbox/notify/NotifyTest.kt @@ -50,11 +50,11 @@ object NotifyTest { image!! - bottomRightInFrame(3, frame) - topLeftInFrame(2, frame) +// bottomRightInFrame(3, frame) +// topLeftInFrame(2, frame) - react() -// topRightMonitor(4) +// react() + topRightMonitor(4) // topAndBottomRightMonitor(1) // bottomLeftScaled(image) // bottomLeftStacking(3, image) @@ -94,12 +94,12 @@ object NotifyTest { // .setScreen(0) .theme(Theme.defaultDark) // .shake(1300, 4) - .shake(18300, 10) +// .shake(18300, 10) // .hideCloseButton() .onClickAction { System.err.println("Notification $i clicked on!") } - if (i == 0) { +// if (i == 0) { notify.hideAfter(2100) - } +// } notify.show() try { Thread.sleep(1000) @@ -229,7 +229,7 @@ object NotifyTest { // .setScreen(0) .theme(Theme.defaultDark) // .shake(1300, 4) -// .shake(1300, 10) + .shake(13200, 10) .attach(frame) // .hideCloseButton() .onClickAction { System.err.println("Notification $i clicked on!") }