From bb7d990305c1e4dba01fc031642c7bf18e79f050 Mon Sep 17 00:00:00 2001 From: Noel Victor Date: Thu, 12 Dec 2019 14:06:40 -0500 Subject: [PATCH] Sceneform SDK v1.14.0 --- samples/animation/app/build.gradle | 4 +-- samples/animation/build.gradle | 2 +- samples/augmentedfaces/app/build.gradle | 4 +-- samples/augmentedfaces/build.gradle | 2 +- samples/augmentedimage/app/build.gradle | 2 +- samples/augmentedimage/build.gradle | 2 +- samples/chromakeyvideo/app/build.gradle | 2 +- samples/chromakeyvideo/build.gradle | 2 +- samples/hellosceneform/app/build.gradle | 4 +-- samples/hellosceneform/build.gradle | 2 +- samples/solarsystem/app/build.gradle | 2 +- samples/solarsystem/build.gradle | 2 +- samples/videorecording/app/build.gradle | 4 +-- samples/videorecording/build.gradle | 2 +- sceneformux/build.gradle | 2 +- sceneformux/ux/build.gradle | 2 +- .../ar/sceneform/ux/BaseArFragment.java | 28 +++++++++++++++++++ .../google/ar/sceneform/ux/BaseGesture.java | 3 +- .../ux/PlaneDiscoveryController.java | 2 +- 19 files changed, 51 insertions(+), 22 deletions(-) diff --git a/samples/animation/app/build.gradle b/samples/animation/app/build.gradle index 35e8d210..1d6d3576 100644 --- a/samples/animation/app/build.gradle +++ b/samples/animation/app/build.gradle @@ -26,8 +26,8 @@ dependencies { implementation 'com.android.support.constraint:constraint-layout:1.1.3' // Sceneform - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0" - implementation "com.google.ar.sceneform:animation:1.13.0" + implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0" + implementation "com.google.ar.sceneform:animation:1.14.0" implementation 'com.android.support:design:28.0.0' } diff --git a/samples/animation/build.gradle b/samples/animation/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/animation/build.gradle +++ b/samples/animation/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/samples/augmentedfaces/app/build.gradle b/samples/augmentedfaces/app/build.gradle index b1b37ba2..c9187834 100644 --- a/samples/augmentedfaces/app/build.gradle +++ b/samples/augmentedfaces/app/build.gradle @@ -42,13 +42,13 @@ android { dependencies { // Provides ArFragment, and other Sceneform UX resources: - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0" + implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0" // Use the Sceneform UX Package built from the source files included in the sceneformux folder. //api project(":sceneformux") // Alternatively, use ArSceneView without the UX dependency. - //implementation "com.google.ar.sceneform:core:1.13.0" + //implementation "com.google.ar.sceneform:core:1.14.0" implementation "com.android.support:appcompat-v7:28.0.0" } diff --git a/samples/augmentedfaces/build.gradle b/samples/augmentedfaces/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/augmentedfaces/build.gradle +++ b/samples/augmentedfaces/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/samples/augmentedimage/app/build.gradle b/samples/augmentedimage/app/build.gradle index ccde80c9..da1d2dac 100644 --- a/samples/augmentedimage/app/build.gradle +++ b/samples/augmentedimage/app/build.gradle @@ -48,7 +48,7 @@ dependencies { implementation 'com.android.support:design:28.0.0' // Use the Sceneform UX Package pre-built from Maven. - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0" + implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0" // Use the Sceneform UX Package built from the source files included in the sceneformux folder. //api project(":sceneformux") diff --git a/samples/augmentedimage/build.gradle b/samples/augmentedimage/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/augmentedimage/build.gradle +++ b/samples/augmentedimage/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/samples/chromakeyvideo/app/build.gradle b/samples/chromakeyvideo/app/build.gradle index 5810382e..41012b63 100644 --- a/samples/chromakeyvideo/app/build.gradle +++ b/samples/chromakeyvideo/app/build.gradle @@ -44,7 +44,7 @@ dependencies { implementation "com.android.support:design:28.0.0" // Use the Sceneform UX Package pre-built from Maven. - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0" + implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0" // Use the Sceneform UX Package built from the source files included in the sceneformux folder. //api project(":sceneformux") diff --git a/samples/chromakeyvideo/build.gradle b/samples/chromakeyvideo/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/chromakeyvideo/build.gradle +++ b/samples/chromakeyvideo/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/samples/hellosceneform/app/build.gradle b/samples/hellosceneform/app/build.gradle index 3f02a982..5d697366 100644 --- a/samples/hellosceneform/app/build.gradle +++ b/samples/hellosceneform/app/build.gradle @@ -42,13 +42,13 @@ android { dependencies { // Provides ArFragment, and other Sceneform UX resources: - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0" + implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0" // Use the Sceneform UX Package built from the source files included in the sceneformux folder. //api project(":sceneformux") // Alternatively, use ArSceneView without the UX dependency. - //implementation "com.google.ar.sceneform:core:1.13.0" + //implementation "com.google.ar.sceneform:core:1.14.0" implementation "com.android.support:appcompat-v7:28.0.0" } diff --git a/samples/hellosceneform/build.gradle b/samples/hellosceneform/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/hellosceneform/build.gradle +++ b/samples/hellosceneform/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/samples/solarsystem/app/build.gradle b/samples/solarsystem/app/build.gradle index c97e5389..ff838e96 100644 --- a/samples/solarsystem/app/build.gradle +++ b/samples/solarsystem/app/build.gradle @@ -40,7 +40,7 @@ android { } dependencies { - implementation "com.google.ar.sceneform:core:1.13.0" + implementation "com.google.ar.sceneform:core:1.14.0" implementation "com.android.support:appcompat-v7:28.0.0" implementation "com.android.support:design:28.0.0" } diff --git a/samples/solarsystem/build.gradle b/samples/solarsystem/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/solarsystem/build.gradle +++ b/samples/solarsystem/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/samples/videorecording/app/build.gradle b/samples/videorecording/app/build.gradle index 09375b96..815fae07 100644 --- a/samples/videorecording/app/build.gradle +++ b/samples/videorecording/app/build.gradle @@ -42,14 +42,14 @@ android { dependencies { // Provides ArFragment, and other Sceneform UX resources: - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.13.0" + implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0" // Use the Sceneform UX Package built from the source files included in the sceneformux folder. //api project(":sceneformux") // Alternatively, use ArSceneView without the UX dependency. - //implementation "com.google.ar.sceneform:core:1.13.0" + //implementation "com.google.ar.sceneform:core:1.14.0" implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' diff --git a/samples/videorecording/build.gradle b/samples/videorecording/build.gradle index dc11bd65..cf3bc88f 100644 --- a/samples/videorecording/build.gradle +++ b/samples/videorecording/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/sceneformux/build.gradle b/sceneformux/build.gradle index dc11bd65..cf3bc88f 100644 --- a/sceneformux/build.gradle +++ b/sceneformux/build.gradle @@ -23,7 +23,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.ar.sceneform:plugin:1.13.0' + classpath 'com.google.ar.sceneform:plugin:1.14.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/sceneformux/ux/build.gradle b/sceneformux/ux/build.gradle index aed2e59d..176eb6a0 100644 --- a/sceneformux/ux/build.gradle +++ b/sceneformux/ux/build.gradle @@ -39,7 +39,7 @@ android { } dependencies { - api "com.google.ar.sceneform:core:1.13.0" + api "com.google.ar.sceneform:core:1.14.0" implementation "com.android.support:appcompat-v7:28.0.0" implementation "com.android.support:design:28.0.0" } diff --git a/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseArFragment.java b/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseArFragment.java index 880f0039..3276c38d 100644 --- a/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseArFragment.java +++ b/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseArFragment.java @@ -68,6 +68,19 @@ public abstract class BaseArFragment extends Fragment implements Scene.OnPeekTouchListener, Scene.OnUpdateListener { private static final String TAG = BaseArFragment.class.getSimpleName(); + + /** Invoked when the ARCore Session is initialized. */ + public interface OnSessionInitializationListener { + /** + * The callback will only be invoked once after a Session is initialized and before it is + * resumed for the first time. + * + * @see #setOnSessionInitializationListener(OnTapArPlaneListener) + * @param session The ARCore Session. + */ + void onSessionInitialization(Session session); + } + /** Invoked when an ARCore plane is tapped. */ public interface OnTapArPlaneListener { /** @@ -92,6 +105,7 @@ public interface OnTapArPlaneListener { private FrameLayout frameLayout; private boolean isStarted; private boolean canRequestDangerousPermissions = true; + @Nullable private OnSessionInitializationListener onSessionInitializationListener; @Nullable private OnTapArPlaneListener onTapArPlaneListener; @SuppressWarnings({"initialization"}) @@ -118,6 +132,17 @@ public TransformationSystem getTransformationSystem() { return transformationSystem; } + /** + * Registers a callback to be invoked when the ARCore Session is initialized. The callback will + * only be invoked once after the Session is initialized and before it is resumed. + * + * @param onSessionInitializationListener the {@link OnSessionInitializationListener} to attach. + */ + public void setOnSessionInitializationListener( + @Nullable OnSessionInitializationListener onSessionInitializationListener) { + this.onSessionInitializationListener = onSessionInitializationListener; + } + /** * Registers a callback to be invoked when an ARCore Plane is tapped. The callback will only be * invoked if no {@link com.google.ar.sceneform.Node} was tapped. @@ -381,6 +406,9 @@ private Session createSession() if (session == null) { session = new Session(requireActivity()); } + if (this.onSessionInitializationListener != null) { + this.onSessionInitializationListener.onSessionInitialization(session); + } return session; } diff --git a/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseGesture.java b/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseGesture.java index fed13125..6a3b8b53 100644 --- a/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseGesture.java +++ b/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/BaseGesture.java @@ -66,7 +66,8 @@ public boolean wasCancelled() { return wasCancelled; } - public @Nullable Node getTargetNode() { + @Nullable + public Node getTargetNode() { return targetNode; } diff --git a/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/PlaneDiscoveryController.java b/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/PlaneDiscoveryController.java index 7a24a1e6..4298eee7 100644 --- a/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/PlaneDiscoveryController.java +++ b/sceneformux/ux/src/main/java/com/google/ar/sceneform/ux/PlaneDiscoveryController.java @@ -23,7 +23,7 @@ * planeDiscoveryView to override the default visual, or assign null to remove it. */ public class PlaneDiscoveryController { - private @Nullable View planeDiscoveryView; + @Nullable private View planeDiscoveryView; public PlaneDiscoveryController(@Nullable View planeDiscoveryView) { this.planeDiscoveryView = planeDiscoveryView;