Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

KFSM Adroid Compose Traffic Intersection Demo

NotificationsYou must be signed in to change notification settings

open-jumpco/kfsm-android-compose-traffic

Repository files navigation

This application demonstrates using 2 state machines to provide a solution.The traffic light state machine operates the light and only has a stop and go event. The stop event will switch to amber and after a timeout switch to red and generate a stopped notification.

The intersection state machine cycles through controlling the lights in order, sending go to current light and then waiting after stopped before switching to next light sending the go event.

TheTrafficIntersectionModel can be created by providing a different number of lights.

The application illustrates how to create a view models that usesLiveData to represent the changing values and states so that compose can update the UI efficiently.

Demo

Two Traffic Lights

Two Traffic Lights

Three Traffic Lights

Three Traffic Lights

Traffic Intersection Classes

Static

Generated Traffic Light Models

Simple State Diagram

Static

Detailed State Diagram

Static

Generated Intersection Models

Simple State Diagram

Static

About

KFSM Adroid Compose Traffic Intersection Demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp