This is a sample Rive app for Android.

Related tags

App rive_piggy
Overview

rive_piggy

This is a sample Rive app for Android.

The RiveAnimationView view is great for simple use cases, but in this example we want to shows how to use the core parts of the animation library to make a custom animation loop with far more control!

App sample gif

piggy

Animation file setup file set up

The Piggy.riv file is split into 3 artboards

  • Background
  • Piggy
    • has a state machine "PiggyMachine" with a "Pressed" trigger input. The trigger input switches the pig from running the "idle" animation to running the "coin" animation.
  • Coin
    • has a state machine "CoinMachine" which runs an animation of a coin flying up and back down again.

This animation is setup so that you can draw the background first and layer the Piggy animation ontop of it. When you want to animate a coin, we add a new coin artboard onto our canvas and animate its coinmachine animation. This artboard will be removed once the animation is played. We also run the "Pressed" input for the PiggyMachine, to make the pig interact with the press events a little bit.

Code

Most of the code, and the animation loop live in PiggyDrawable, its wrapped up in a button class that we use to capture the touch events.

Same thing, but in JS

Luigi's original example of this for the web. There are great comments in the code here to understand how this works for javascript.

You might also like...
Sample app for tutorial: Pagination in Android Room Database using the Paging 3 Library

Demo Implementation of Paging 3 with Room DB Read the article. Demo implementation of Pagination in an Android Room Database using the Paging 3 Librar

Sample news app using Kotlin, Hilt, Coroutines, Coil, Room, Retrofit

Tech stack & News App libraries Navigation component - navigation graph for navigating and replacing screens/fragments DataBinding - allows to more ea

A sample app that uses CameraX and Milkit to scan multiple barcodes and QR code
A sample app that uses CameraX and Milkit to scan multiple barcodes and QR code

MLKit-QR-and-Barcode-Scanner This sample app uses Firebase MLKit to scan bar codes and QR Codes There are a number of types of barcodes, MLKKIt is abl

Sample app that displays a birthday card with text and an image

Birthday Card App Sample app that displays a birthday card with text and an image. Used in the Android Basics with Kotlin course. Pre-requisites Andro

MapSample - Just Sample App using Naver Map API

Sample Project: NaverMap 맛보기 Gradle Dependency // App 단위 Gradle dependencyResolu

A sample demo app which has Clean Architecture with MVVM , UI built with Jetpack Compose
A sample demo app which has Clean Architecture with MVVM , UI built with Jetpack Compose

A sample demo app (two screen todo list app) which has Clean Architecture with MVVM , UI built with Jetpack Compose and includes Modern Android Development Best Practices with components

📺 A sample app to showcase Twyper with GitHub repo search API
📺 A sample app to showcase Twyper with GitHub repo search API

swipe-search A sample app to showcase Twyper with GitHub repo search API 📺 Demo Screen.Recording.2022-02-20.at.9.36.10.PM.mov 📚 Tech Stack What How

A simple app to test your device input sample rate.
A simple app to test your device input sample rate.

Android touch sample rate test tool This tool can help you check the touch sample rate of the Android device. Supported input method: Touch Mouse Styl

☀️ 🌤 Sample weather app with Retrofit, Hilt and Coroutines ☀️ 🌤
☀️ 🌤 Sample weather app with Retrofit, Hilt and Coroutines ☀️ 🌤

WeatherAppsX app is a sample networking app showing weather forecast of the current day and the average forecast for the next four days.

Owner
Maxwell Talbot
Maxwell Talbot
Advanced Android Weather App using MVVM Architecture Sample (ViewModel + LiveData + Kotlin + volley) = Weather App

Advanced Android Weather App using MVVM Architecture Sample (ViewModel + LiveData + Kotlin + volley) = Weather App Video Weather.-.HD.720p.mov Introdu

wykee2 4 Jul 12, 2022
A sample app that shows how to easily encrypt the room database in an Android app

A sample app that shows how to easily encrypt the room database in an Android app. The password used for encryption is generated on the first use and saved in the Android EncryptedSharedPreferences.

Lenz Karbaumer 3 Oct 26, 2022
A sample app illustrating Android development using Kotlin with MVVM architecture, Android Jetpack, and other commonly used libraries.

Anime Facts A sample app illustrating Android development using Kotlin with MVVM architecture, Android Jetpack, and other commonly used libraries. Ani

Eugene Javiñas 0 Dec 5, 2021
Android app which fetches a sample movies list to display. Built using Kotlin and latest Android tech stack, with an approach to clean architecture.

movies-sample-app This is an Android app which fetches a sample movies list to display. Built using Kotlin and latest Android tech stack, with an appr

Nadeem Ahmed 1 Oct 21, 2021
A sample Android app which showcases advanced usage of Dagger among other open source libraries.

U+2020 A sample Android app which showcases advanced usage of Dagger among other open source libraries. Watch the corresponding talk or view the slide

Jake Wharton 5.7k Dec 27, 2022
How to apply meaningful and delightful motion in a sample Android app

Applying meaningful motion on Android How to apply meaningful and delightful motion in a sample Android app Read the complete post at https://medium.c

André Mion 167 Dec 19, 2022
Sample app demonstrating interop between Jetpack Compose and the Android UI toolkit, including SurfaceView

Wake Me Up Wake Me Up is a sample app showcased in the Google I/O 2021 Developer Keynote that demonstrates interoperability between Jetpack Compose an

Romain Guy 174 Dec 5, 2022
🚀 Sample Android Clean Architecture on Rorty App focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Clean Architecture Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development u

Mr.Sanchez 0 Dec 28, 2021
Dynamic-UI-From-JSON - A Sample Android app to show dynamic UI generation from Json

Dynamic UI from JSON Functionality The app's functionality includes: The app gen

Rafsan Ahmad 12 Dec 16, 2022
Note-app - A sample project that presents a modern approach to Android application development

Note-app - A sample project that presents a modern approach to Android application development

null 3 Aug 19, 2022