jflavio11 / ArchitectureAndState-ComposeCamp

Open source project for the Compose Camp event of Kotlin La Paz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Architecture and State

This repository is based on a talk I gave for the Compose Camp online event promoted by the Kotlin La Paz community. The Architecture and State topic is based on the third pathway of the Jetpack Compose course from Google. You can check it out here: Jetpack Compose for Android Developers.




Main concepts

State

It answers the questions: How is my app right now? What is showing? What is the value of the variable X? The state is the configuration or value of our app in a given moment of time.


Event

Any interaction with our app. It can be done by a user or from an external component. An event can change the state of our app.


Unidirectional Data Flow | UDF

Design pattern that can be applied with the Declarative Paradigm. It decouples the UI from who is handling the state. It allow us to write unit tests for each layer of our presentation side, that is, tests for our composable functions and tests for our UI logic or State logic handler.


Why the state is important in Jetpack Compose?

  • The state defines the UI.
  • The composable functions depends on variables that have an state.
  • The canvas drawn is a graphic representation of our app state.

Screenshot of a Progress Bar composable function



Useful Links

About

Open source project for the Compose Camp event of Kotlin La Paz

License:Apache License 2.0


Languages

Language:Kotlin 100.0%