Skip to content

Instantly share code, notes, and snippets.

@shibuiwilliam
Last active February 16, 2020 05:59
Show Gist options
  • Save shibuiwilliam/14b934cdcd5ca5b1c63e17837afab01a to your computer and use it in GitHub Desktop.
Save shibuiwilliam/14b934cdcd5ca5b1c63e17837afab01a to your computer and use it in GitHub Desktop.
private fun tapDistanceOfMultiplePoints(hitResult: HitResult){
if (placedAnchorNodes.size >= Constants.maxNumMultiplePoints){
clearAllAnchors()
}
ViewRenderable
.builder()
.setView(this, R.layout.point_text_layout)
.build()
.thenAccept{
it.isShadowReceiver = false
it.isShadowCaster = false
pointTextView = it.getView() as TextView
pointTextView.setText(placedAnchors.size.toString())
placeAnchor(hitResult, it)
}
.exceptionally {
val builder = AlertDialog.Builder(this)
builder.setMessage(it.message).setTitle("Error")
val dialog = builder.create()
dialog.show()
return@exceptionally null
}
Log.i(TAG, "Number of anchors: ${placedAnchorNodes.size}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment