mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-01 21:29:07 +08:00
[android] improve missing controller error and align AGP/Gradle
This commit is contained in:
parent
e2cea180b7
commit
863f08503b
@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
agp = "8.3.1"
|
||||
agp = "8.11.2"
|
||||
kotlin = "1.9.0"
|
||||
coreKtx = "1.10.1"
|
||||
junit = "4.13.2"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#Thu Apr 25 11:12:13 CEST 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@ -351,10 +351,18 @@ public class SpineView extends View implements Choreographer.FrameCallback {
|
||||
}
|
||||
|
||||
private void loadFrom (AndroidSkeletonDrawableLoader loader) {
|
||||
if (controller == null) {
|
||||
throw new IllegalStateException(
|
||||
"SpineController is not set. When using SpineView from XML, call setController(...) before loadFromAsset/loadFromFile/loadFromHttp/loadFromDrawable.");
|
||||
}
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Thread backgroundThread = new Thread( () -> {
|
||||
final AndroidSkeletonDrawable skeletonDrawable = loader.load();
|
||||
mainHandler.post( () -> {
|
||||
if (controller == null) {
|
||||
throw new IllegalStateException(
|
||||
"SpineController became null before initialization. Ensure setController(...) is called and not cleared until loading completes.");
|
||||
}
|
||||
computedBounds = boundsProvider.computeBounds(skeletonDrawable);
|
||||
updateCanvasTransform();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user