Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun buildAnimation(qiContext: QiContext?) {
- val animation = AnimationBuilder.with(qiContext) // Create the builder with the context.
- .withResources(R.raw.dance) // Set the animation resource.
- .build() // Build the animation.
- val animateAction = AnimateBuilder.with(qiContext) // Create the builder with the context.
- .withAnimation(animation) // Set the animation.
- .build() // Build the animate action.
- animateAction.addOnLabelReachedListener { label, time ->
- Log.d(TAG, "label reached : $label")
- val splitLabels = label.split(":").toTypedArray()
- when (splitLabels[0]) {
- "trajectory" -> startPmt()
- else -> {
- Log.d(TAG, "Unknown type of element : ${splitLabels[0]}")
- }
- }
- }
- animateAction.async().run()
- }
- private fun startPmt() {
- val animation = AnimationBuilder.with(qiContext)
- .withResources(R.raw.trajectory)
- .build()
- val pmtAnimate = AnimateBuilder.with(qiContext)
- .withAnimation(animation)
- .build()
- pmtAnimate.async().run()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement