SHARE
TWEET

Untitled

jossstuart Nov 18th, 2019 (edited) 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private fun buildAnimation(qiContext: QiContext?) {
  2.         val animation = AnimationBuilder.with(qiContext) // Create the builder with the context.
  3.             .withResources(R.raw.dance) // Set the animation resource.
  4.             .build() // Build the animation.
  5.  
  6.         val animateAction = AnimateBuilder.with(qiContext) // Create the builder with the context.
  7.             .withAnimation(animation) // Set the animation.
  8.             .build() // Build the animate action.
  9.  
  10.         animateAction.addOnLabelReachedListener { label, time ->
  11.             Log.d(TAG, "label reached : $label")
  12.  
  13.             val splitLabels = label.split(":").toTypedArray()
  14.             when (splitLabels[0]) {
  15.                 "trajectory" -> startPmt()
  16.                 else -> {
  17.                     Log.d(TAG, "Unknown type of element : ${splitLabels[0]}")
  18.                 }
  19.             }
  20.         }
  21.    
  22.         animateAction.async().run()
  23.     }
  24.  
  25. private fun startPmt() {
  26.         val animation = AnimationBuilder.with(qiContext)
  27.             .withResources(R.raw.trajectory)
  28.             .build()
  29.  
  30.         val pmtAnimate = AnimateBuilder.with(qiContext)
  31.             .withAnimation(animation)
  32.             .build()
  33.  
  34.         pmtAnimate.async().run()
  35.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top