Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hud10837/session init and permissions #595

Merged

Conversation

hud10837
Copy link
Collaborator

@hud10837 hud10837 commented Sep 30, 2024

Related to issue: https://devtopia.esri.com/runtime/kotlin/issues/4680

Description:

Adds session initialization and automatic permission requests to the TableTopSceneView. Note that while the session is initialized by the component, the user will have to manually ensure that Google Play Services for AR is installed. This is demonstrated in the microapp

Summary of changes:

  • Adds a new TableTopSceneViewInitializationStatus and associated lambda callback parameter on the TableTopSceneView so the user can be notified when the TableTopSceneView is ready and when any error occurs, such as if Google Play Services for AR is not installed
  • Requests camera permissions automatically using a new function rememberCameraPermission. The user can specify whether the component should actually perform the permission request by specificying the parameter requestCameraPermissionAutomatically. If this is set to false, then when the permission is required, TableTopSceneViewInitializationStatus will be set to FailedToInitialize. The user may want to specify this as false if they want to show a rationale for the permission.
  • Modifies how the component is displayed when the permission is not granted or ARCore is not available
  • Modifies the microapp to demonstrate how to setup ARCore
  • Fixes an issue with the resources file, which was located in the wrong place

Pre-merge Checklist

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shader files were moved because the code from the feature branch wasn't compiling

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will they be re-added in a subsequent PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They haven't been removed, just changed the location of the assets directory

@hud10837 hud10837 marked this pull request as ready for review October 1, 2024 09:53
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused import

private var userRequestedInstall: Boolean = true

private val _isGooglePlayServicesArInstalled = MutableStateFlow(false)
private val isGooglePlayServicesArInstalled = _isGooglePlayServicesArInstalled.asStateFlow()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for a read-only flow here, since this is not API. Having the MutableStateFlow should be sufficient

@@ -18,4 +18,6 @@

<resources>
<string name="app_name">ArTabletopApp</string>
<string name="google_play_services_for_ar_must_be_installed_to_run_this_app">Google Play Services for AR must be installed to run this app.</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make that name shorter, something like:

Suggested change
<string name="google_play_services_for_ar_must_be_installed_to_run_this_app">Google Play Services for AR must be installed to run this app.</string>
<string name="arcore_installed_message">Google Play Services for AR must be installed to run this app.</string>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will they be re-added in a subsequent PR?

@@ -102,62 +122,150 @@ fun TableTopSceneView(
onDrawStatusChanged: ((DrawStatus) -> Unit)? = null,
content: (@Composable TableTopSceneViewScope.() -> Unit)? = null
) {
val lifecycleOwner = LocalLifecycleOwner.current
Box(modifier = modifier) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this Box moved up here again?

}
}
}
if (arCoreInstalled) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be:

Suggested change
if (arCoreInstalled) {
if (arCoreInstalled && cameraPermissionGranted) {

)
}
if (requestCameraPermissionAutomatically) {
val requestPermissionLauncher =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can move into the if statement on line 253?

*
* @since 200.6.0
*/
sealed class TableTopSceneViewInitializationStatus {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest a shorter name:

Suggested change
sealed class TableTopSceneViewInitializationStatus {
sealed class TableTopSceneViewStatus {

* @since 200.6.0
*/
@Composable
internal fun rememberArSessionWrapper(applicationContext: Context): ArSessionWrapper = remember { ArSessionWrapper(applicationContext) }

This comment was marked as resolved.

This comment was marked as resolved.

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="camera_permission_not_granted">Camera permission not granted</string>
<string name="arcore_must_be_installed_to_use_tabletopsceneview_arcore_availability">ARCore must be installed to use TableTopSceneView. ARCore availability: %1$s</string>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, name could be shorter? Also we might want to reuse this string for FlyOver as well, so might be better to avoid "TableTopSceneView" in the message.

Suggested change
<string name="arcore_must_be_installed_to_use_tabletopsceneview_arcore_availability">ARCore must be installed to use TableTopSceneView. ARCore availability: %1$s</string>
<string name="arcore_installed_message">ARCore must be installed to use TableTopSceneView. ARCore availability: %1$s</string>

@gunt0001 gunt0001 self-requested a review October 1, 2024 14:30
Copy link
Collaborator

@gunt0001 gunt0001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hud10837 - looks good, a few minor comments/questions.

return
}
}
} catch (e: Exception) {

This comment was marked as resolved.

This comment was marked as resolved.


/**
* Displays a [SceneView] in a tabletop AR environment.
*
* @param requestCameraPermissionAutomatically whether to request the camera permission automatically.
* If set to `true`, the camera permission will be requested automatically when the composable is
* first displayed. The default value is `true`.

This comment was marked as resolved.

@@ -45,11 +51,15 @@ fun MainScreen() {
}
val tableTopSceneViewProxy = remember { TableTopSceneViewProxy() }
var tappedLocation by remember { mutableStateOf<Point?>(null) }
var initializationStatus: TableTopSceneViewStatus by remember { mutableStateOf(TableTopSceneViewStatus.Initializing) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be convenient to expose a rememberTableTopSceneViewStatus() helper function so users can just call:

Suggested change
var initializationStatus: TableTopSceneViewStatus by remember { mutableStateOf(TableTopSceneViewStatus.Initializing) }
var initializationStatus = rememberTableTopSceneViewStatus()

We can also use this internally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't be the same has remembering a mutable state though. Is there a need for us or for users to remember a non-state version of TableTopSceneViewStatus?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, what I had in mind would be a helper function that remembers mutable state:

@Composable
public fun rememberTableTopSceneViewStatus(): MutableState<TableTopSceneViewStatus> = 
    remember { mutableStateOf(TableTopSceneViewStatus.Initializing) }

The user then wouldn't have to worry about initializing the mutable state value with TableTopSceneViewStatus.Initializing

Comment on lines 125 to 129
var initializationStatus: TableTopSceneViewStatus by remember {
mutableStateOf(
TableTopSceneViewStatus.Initializing
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above, could use helper function:

Suggested change
var initializationStatus: TableTopSceneViewStatus by remember {
mutableStateOf(
TableTopSceneViewStatus.Initializing
)
}
var initializationStatus = rememberTableTopSceneViewStatus()

onInitializationStatusChanged?.invoke(newStatus)
}
}
onInitializationStatusChanged?.invoke(initializationStatus)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency I would make use of updateStatus here:

Suggested change
onInitializationStatusChanged?.invoke(initializationStatus)
updateStatus(TableTopSceneViewStatus.Initializing)

val updateStatus = remember {
{ newStatus: TableTopSceneViewStatus ->
initializationStatus = newStatus
onInitializationStatusChanged?.invoke(newStatus)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If onInitializationStatusChanged changes during recomposition, will the updated value be used here in the closure? Might be worth to test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were absolutely right. I added the callback as a parameter to this function, which fixes the problem.

}
}

Box(modifier = modifier) {
ArCameraFeed(arSessionWrapper = arSessionWrapper, onFrame = {}, onTap = {})
if (cameraPermissionGranted && arCoreInstalled) {
// invoked when the arCoreInstalled state changes to true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not at this point, it seems clear enough what is happening to me

SceneView(
arcGISScene = arcGISScene,
modifier = Modifier.fillMaxSize(),
onViewpointChangedForCenterAndScale = onViewpointChangedForCenterAndScale,
onViewpointChangedForBoundingGeometry = onViewpointChangedForBoundingGeometry,
graphicsOverlays = graphicsOverlays,
graphicsOverlays =
graphicsOverlays,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be moved into the line above, i.e. on a single line


var arCoreInstalled by remember { mutableStateOf(false) }

// invoked when the cameraPermissionGranted state changes to true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems out of date? Could be removed?

* Represents the initialization status of a [TableTopSceneView]. The status can be one of the following:
* - [Initializing]: The [TableTopSceneView] is initializing. The [TableTopSceneView] is not ready to be used yet.
* - [Initialized]: The [TableTopSceneView] is initialized successfully. The [TableTopSceneView] is ready to be used.
* - [FailedToInitialize]: The [TableTopSceneView] failed to initialize. The [error] property contains
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of these bullet points, better to move this doc directly on the individual enum values.

@hud10837 hud10837 requested a review from gunt0001 October 3, 2024 07:26
@@ -45,11 +51,15 @@ fun MainScreen() {
}
val tableTopSceneViewProxy = remember { TableTopSceneViewProxy() }
var tappedLocation by remember { mutableStateOf<Point?>(null) }
var initializationStatus: TableTopSceneViewStatus by remember { mutableStateOf(TableTopSceneViewStatus.Initializing) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, what I had in mind would be a helper function that remembers mutable state:

@Composable
public fun rememberTableTopSceneViewStatus(): MutableState<TableTopSceneViewStatus> = 
    remember { mutableStateOf(TableTopSceneViewStatus.Initializing) }

The user then wouldn't have to worry about initializing the mutable state value with TableTopSceneViewStatus.Initializing

initializationStatus = newStatus
callback?.invoke(newStatus)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option, instead of the cached lambda would be an extension function on MutableState<TableTopSceneViewStatus>. Personally I would find that more intuitive, but I will leave it to you, either works.

private fun MutableState<TableTopSceneViewStatus>.update(
    newStatus: TableTopSceneViewStatus,
    callback: ((TableTopSceneViewStatus) -> Unit)?
) {
    this.value = newStatus
    callback?.invoke(newStatus)
}

Then you could call this like that:

var initializationStatus: MutableState<TableTopSceneViewStatus> = remember {
        mutableStateOf(
            TableTopSceneViewStatus.Initializing
        )
}

...

initializationStatus.update(TableTopSceneViewStatus.Initializing, onInitializationStatusChanged)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered this but wasn't sure if it made much since to extend MutableState. I think what you showed here looks reasonable though so I will make this change

var arCoreInstalled by remember { mutableStateOf(false) }

LaunchedEffect(Unit) {
delay(10_000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this delay? Can we remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, that wasn't meant to be checked in

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ArcGISEnvironment.apiKey = ApiKey.create(BuildConfig.API_KEY)
setContent {
MicroAppTheme {
ArTabletopApp()
if (isGooglePlayServicesArInstalled.collectAsState().value) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may not make a big difference in this specific case but still good practice to use collectAsStateWithLifecycle:

Suggested change
if (isGooglePlayServicesArInstalled.collectAsState().value) {
if (isGooglePlayServicesArInstalled.collectAsStateWithLifecycle().value) {

Note, you would also need to update the comment above.

}

@Composable
public fun rememberTableTopSceneViewStatus(): MutableState<TableTopSceneViewStatus> = remember {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing doc

@hud10837 hud10837 merged commit 447f32f into feature-branches/tabletop-ar Oct 4, 2024
@hud10837 hud10837 deleted the hud10837/session-init-and-permissions branch October 4, 2024 09:08
hud10837 added a commit that referenced this pull request Oct 4, 2024
* mv assets folder to correct location

* out of the box permissions request

* rename camera permission function

* make request permission optional

* add initialization status

* add availability check

* update microapp

* extract string resources

* rm unnecessary changes

* don't use stateflow for microapp

* rename string res

* rename string resource

* don't require camera permission before checking arcore visibility

* mv box call

* add local function for update status

* simplify availability check

* rename status

* make status constructors internal

* use updateState for initial status

* mv status doc to member objects

* add remaining param doc

* fix remaining param doc

* add parameter for callback to lambda

* revert whitespace in manifest

* remove debug delay

* add factory rememberTableTopSceneViewStatus

* add extension fun to mutable state

* add extension fun to mutable state

* rename camera feed file

* use launchedeffect to ensure initializing status is only sent once

* Don't send callback on first status

* use side effects for callback

* use collectAsStateWithLifecycle

* add doc to rememberTableTopSceneViewStatus()
hud10837 added a commit that referenced this pull request Oct 14, 2024
* merge `Feature branches/forms` into v.next (#566)

* `Forms`: Add `TextFormElement` (#542)

* `Forms`: Add `TextFormElement` tests (#551)

* add tests

* updated feature form doc

* bump sdk version

* `Forms` : Add SubTypeFeatureLayer support (#559)

* `Forms`: Fix stale `LaunchedEffect`s (#563)

* fix stale launched effects

* use rememberupdatedstate

* update feature form doc (#565)

* Remove unnecessary creating the viewmodel in the main activity (#571)

* Set up Tabletop AR project (#545)

* prototype design options

* prototype tabletopSceneView

* remove unused implementations

* create readme

* add tabletopsceneviewproxy

* update microapp to use tabletop proxy

* add TableTopSceneViewScope

* apply Compose gradle plugin

* fix warnings

* rename microapp

* delete tests for microapp

* add copyright

* fix since years

* use swift doc on tabletopsceneview

* add proxy doc

* add scope doc

* fix references in proxy doc

* fix references in scope doc

* fix references in scope doc

* newlines

* rm unit test

* fix doc and imports

* fix doc and imports

* revert authentication changes

---------

Co-authored-by: Gunther Heppner <gheppner@esri.com>

* Hud10837/import render code (#580)

* import necessary files for rendering camera feed

* copyright

* rm obj dependency

* make kotlin classes internal

* make java classes non-public

* centralize logging and tag

* add doc links to hello ar

* make planerenderer companion internal

* Fix texture name

* add newline

* Tabletop AR: Add ArSurfaceView (#590)

* bring in existing implementation of ArSurfaceView

* bring in changes to TabletopSceneView and TableTopSceneViewState

* pare down changes to just implement ARSurfaceView and add lifecycle management wrappers for AR Session and GlSurfaceView

* rm camera controller line

* mv call to box

* mv ArSessionWrapper to internal

* fix since tags

* rename ARSurfaceView -> ArCameraFeed

* rename localLifecycleOwner -> lifecycleOwner

* mv initialization of sceneViewProxy to TableTopSceneViewProxy

* Hud10837/session init and permissions (#595)

* mv assets folder to correct location

* out of the box permissions request

* rename camera permission function

* make request permission optional

* add initialization status

* add availability check

* update microapp

* extract string resources

* rm unnecessary changes

* don't use stateflow for microapp

* rename string res

* rename string resource

* don't require camera permission before checking arcore visibility

* mv box call

* add local function for update status

* simplify availability check

* rename status

* make status constructors internal

* use updateState for initial status

* mv status doc to member objects

* add remaining param doc

* fix remaining param doc

* add parameter for callback to lambda

* revert whitespace in manifest

* remove debug delay

* add factory rememberTableTopSceneViewStatus

* add extension fun to mutable state

* add extension fun to mutable state

* rename camera feed file

* use launchedeffect to ensure initializing status is only sent once

* Don't send callback on first status

* use side effects for callback

* use collectAsStateWithLifecycle

* add doc to rememberTableTopSceneViewStatus()

* add new DetectingPlanes status

* create callback and set status for first plane detected

* add in scene placement logic

* add translation factor, anchor point, clipping distance

* rm initial viewpoint on scene

* display simple helper text while detecting planes

* use string res

* use string res for lat lon callout content

* enhance microapp with status messages

* use better data for microapp

* rm debug code

* use val instead of var for status

* cleanup

* use display rotation for lens intrinsics

* checkout unexpected files from feature branch

* checkout unexpected files from feature branch

* add doc to TextWithScrim

* use when statements and be exhaustive

* mv declarations of cameraController and arCoreAnchor

* add doc Pose.transformationMatrix

* use when (val status = ...

* use explicit api mode

* fix build warnings

---------

Co-authored-by: Kaushik Meesala <kaushik.pulagara@gmail.com>
Co-authored-by: Puneet Prakash <puneet_prakash@esri.com>
Co-authored-by: Gunther Heppner <gheppner@esri.com>
gunt0001 added a commit that referenced this pull request Nov 13, 2024
* Set up Tabletop AR project (#545)

* prototype design options

* prototype tabletopSceneView

* remove unused implementations

* create readme

* add tabletopsceneviewproxy

* update microapp to use tabletop proxy

* add TableTopSceneViewScope

* apply Compose gradle plugin

* fix warnings

* rename microapp

* delete tests for microapp

* add copyright

* fix since years

* use swift doc on tabletopsceneview

* add proxy doc

* add scope doc

* fix references in proxy doc

* fix references in scope doc

* fix references in scope doc

* newlines

* rm unit test

* fix doc and imports

* fix doc and imports

* revert authentication changes

---------

Co-authored-by: Gunther Heppner <gheppner@esri.com>

* Hud10837/import render code (#580)

* import necessary files for rendering camera feed

* copyright

* rm obj dependency

* make kotlin classes internal

* make java classes non-public

* centralize logging and tag

* add doc links to hello ar

* make planerenderer companion internal

* Fix texture name

* add newline

* Tabletop AR: Add ArSurfaceView (#590)

* bring in existing implementation of ArSurfaceView

* bring in changes to TabletopSceneView and TableTopSceneViewState

* pare down changes to just implement ARSurfaceView and add lifecycle management wrappers for AR Session and GlSurfaceView

* rm camera controller line

* mv call to box

* mv ArSessionWrapper to internal

* fix since tags

* rename ARSurfaceView -> ArCameraFeed

* rename localLifecycleOwner -> lifecycleOwner

* mv initialization of sceneViewProxy to TableTopSceneViewProxy

* Hud10837/session init and permissions (#595)

* mv assets folder to correct location

* out of the box permissions request

* rename camera permission function

* make request permission optional

* add initialization status

* add availability check

* update microapp

* extract string resources

* rm unnecessary changes

* don't use stateflow for microapp

* rename string res

* rename string resource

* don't require camera permission before checking arcore visibility

* mv box call

* add local function for update status

* simplify availability check

* rename status

* make status constructors internal

* use updateState for initial status

* mv status doc to member objects

* add remaining param doc

* fix remaining param doc

* add parameter for callback to lambda

* revert whitespace in manifest

* remove debug delay

* add factory rememberTableTopSceneViewStatus

* add extension fun to mutable state

* add extension fun to mutable state

* rename camera feed file

* use launchedeffect to ensure initializing status is only sent once

* Don't send callback on first status

* use side effects for callback

* use collectAsStateWithLifecycle

* add doc to rememberTableTopSceneViewStatus()

* Tabletop AR: scene placement (#602)

* merge `Feature branches/forms` into v.next (#566)

* `Forms`: Add `TextFormElement` (#542)

* `Forms`: Add `TextFormElement` tests (#551)

* add tests

* updated feature form doc

* bump sdk version

* `Forms` : Add SubTypeFeatureLayer support (#559)

* `Forms`: Fix stale `LaunchedEffect`s (#563)

* fix stale launched effects

* use rememberupdatedstate

* update feature form doc (#565)

* Remove unnecessary creating the viewmodel in the main activity (#571)

* Set up Tabletop AR project (#545)

* prototype design options

* prototype tabletopSceneView

* remove unused implementations

* create readme

* add tabletopsceneviewproxy

* update microapp to use tabletop proxy

* add TableTopSceneViewScope

* apply Compose gradle plugin

* fix warnings

* rename microapp

* delete tests for microapp

* add copyright

* fix since years

* use swift doc on tabletopsceneview

* add proxy doc

* add scope doc

* fix references in proxy doc

* fix references in scope doc

* fix references in scope doc

* newlines

* rm unit test

* fix doc and imports

* fix doc and imports

* revert authentication changes

---------

Co-authored-by: Gunther Heppner <gheppner@esri.com>

* Hud10837/import render code (#580)

* import necessary files for rendering camera feed

* copyright

* rm obj dependency

* make kotlin classes internal

* make java classes non-public

* centralize logging and tag

* add doc links to hello ar

* make planerenderer companion internal

* Fix texture name

* add newline

* Tabletop AR: Add ArSurfaceView (#590)

* bring in existing implementation of ArSurfaceView

* bring in changes to TabletopSceneView and TableTopSceneViewState

* pare down changes to just implement ARSurfaceView and add lifecycle management wrappers for AR Session and GlSurfaceView

* rm camera controller line

* mv call to box

* mv ArSessionWrapper to internal

* fix since tags

* rename ARSurfaceView -> ArCameraFeed

* rename localLifecycleOwner -> lifecycleOwner

* mv initialization of sceneViewProxy to TableTopSceneViewProxy

* Hud10837/session init and permissions (#595)

* mv assets folder to correct location

* out of the box permissions request

* rename camera permission function

* make request permission optional

* add initialization status

* add availability check

* update microapp

* extract string resources

* rm unnecessary changes

* don't use stateflow for microapp

* rename string res

* rename string resource

* don't require camera permission before checking arcore visibility

* mv box call

* add local function for update status

* simplify availability check

* rename status

* make status constructors internal

* use updateState for initial status

* mv status doc to member objects

* add remaining param doc

* fix remaining param doc

* add parameter for callback to lambda

* revert whitespace in manifest

* remove debug delay

* add factory rememberTableTopSceneViewStatus

* add extension fun to mutable state

* add extension fun to mutable state

* rename camera feed file

* use launchedeffect to ensure initializing status is only sent once

* Don't send callback on first status

* use side effects for callback

* use collectAsStateWithLifecycle

* add doc to rememberTableTopSceneViewStatus()

* add new DetectingPlanes status

* create callback and set status for first plane detected

* add in scene placement logic

* add translation factor, anchor point, clipping distance

* rm initial viewpoint on scene

* display simple helper text while detecting planes

* use string res

* use string res for lat lon callout content

* enhance microapp with status messages

* use better data for microapp

* rm debug code

* use val instead of var for status

* cleanup

* use display rotation for lens intrinsics

* checkout unexpected files from feature branch

* checkout unexpected files from feature branch

* add doc to TextWithScrim

* use when statements and be exhaustive

* mv declarations of cameraController and arCoreAnchor

* add doc Pose.transformationMatrix

* use when (val status = ...

* use explicit api mode

* fix build warnings

---------

Co-authored-by: Kaushik Meesala <kaushik.pulagara@gmail.com>
Co-authored-by: Puneet Prakash <puneet_prakash@esri.com>
Co-authored-by: Gunther Heppner <gheppner@esri.com>

* TableTop improvements (#607)

* stop rendering planes as soon as the anchor point is determined

* configure ARCore Session to only detect horizontal planes

* disable pan/zoom/rotate interaction

* make clippingDistance an optional parameter and ensure modifier is first optional param

* enhance comment

Co-authored-by: hud10837 <hmiears@esri.com>

---------

Co-authored-by: hud10837 <hmiears@esri.com>

* TableTop doc (#644)

* expand AR readme

* explain translationFactor

* update micro app to use simplified dataset

* cache arcGISSceneAnchor in the composition

* add prerequisites and usage sections

* doc fixes

* add AR to top level readme

* remove basemap and make surface opaque

* add screenshot

* update README

* improve doc on TableTopSceneView parameters

* add README for ARTableTop micro app

* improve doc on translationFactor

Co-authored-by: hud10837 <hmiears@esri.com>

* refine doc for prerequisites

* add snippet for AR required manifest

* fix spelling

Co-authored-by: hud10837 <hmiears@esri.com>

---------

Co-authored-by: hud10837 <hmiears@esri.com>

* Tabletop - disable navigation (#662)

* remove interaction options from TableTopSceneView

* remove setViewpoint functions from TableTopSceneViewProxy

* remove unused imports

* Tabletop callout fix & Session config (#663)

* cache _isManualRenderingEnabled and sync with SceneView when set

* invoke content lambda when SceneView ready or in manual rendering mode

* configure AR Session in onResume instead of upon construction

* change ArCameraFeed constructor to take a Session instead of ArSessionWrapper

* create Session in onResume, expose as StateFlow

* observe session state flow in order to render the ArCameraFeed

* lock the screen of the TableTop micro app

* roll back screen orientation lock

* sync manual rendering flag in sceneView property setter

* remove `onDrawStatusChanged` from TableTopSceneView

* fix link

* fix link

* fix link

---------

Co-authored-by: hud10837 <hmiears@esri.com>
Co-authored-by: Kaushik Meesala <kaushik.pulagara@gmail.com>
Co-authored-by: Puneet Prakash <puneet_prakash@esri.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants