#json #macro #no-std

no-std flip-ui

Rust integration for handling and compiling the UI built via the UI Flip UI Builder

4 releases

new 0.1.3 Jun 1, 2024
0.1.2 May 13, 2024
0.1.1 May 13, 2024
0.1.0 May 13, 2024

#207 in GUI

Download history 169/week @ 2024-05-07 137/week @ 2024-05-14 12/week @ 2024-05-21 209/week @ 2024-05-28

527 downloads per month

MIT license

8KB
78 lines

flip-ui

crates.io crates.io docs.rs

Rust integration for handling and compiling the UI built via the Website.

Features

  • JSON Integration: Easily import and manage your UI designs exported from the Flip UI Builder.
  • UI Rendering: Efficiently render user interface components on Flipper Zero devices.
  • Interaction Handling: Simplified event handling to manage user interactions within your applications.

Installation

Add this to your Cargo.toml:

[dependencies]
flip_ui = "0.1.3"

Example

#![no_main]
#![no_std]

// Required for panic handler
extern crate flipperzero_rt;

use core::ffi::CStr;
use flip_ui::flip_ui;
use flipperzero_rt::{entry, manifest};

// Define the FAP Manifest for this application
manifest!(
	name = "Flipper Zero Rust",
	app_version = 1,
	has_icon = false,
);

// Define the entry function
entry!(main);

// Getting UI data && events
flip_ui! {
	App,
	"src/main.json",
	next => next,
	close => close,
	back => back,
}

// Entry point
fn main(_args: Option<&CStr>) -> i32 {
	let mut app = App::create();

	app.show();

	0
}

Dependencies

~4MB
~93K SLoC