This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

Overview

JetBMICalculator

This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

Alt text

Alt text

Alt text

There are two forms on the screen and hence two composables for the same.

Top : BMI Calculator Form

Bottom: BMI Result Form

MainContent() {

  BMICalculatorForm()

  BMIResultForm()  
}

Height and Weight are the two states used by BMI Calculator form composable, however these are local to this composable. Hence not hoisted by parent composable (MainContent()). Only when Calculate button is clicked, latest value is passed via onClick.

However, other two states - showBmiResult and bmiResult - are modified by actions inside BMICalculatorForm(), but are used by BMIResultForm() to display on UI. Hence both of these are hoisted by their parent composable (MainContent()).

You might also like...
A lightweight state management library for Compose Multiplatform.

Staccato A lightweight state management library for Compose Multiplatform. The term staccato (pronounced "stuh-caw-toe") means detached, or separated,

Compose-buttons - A set of Loading animations used in Buttons to convey a
Compose-buttons - A set of Loading animations used in Buttons to convey a "loading" state after the button is clicked.

Loading Buttons A set of Loading animations used in Buttons to convey a "loading" state after the button is clicked. A simple demo application that sh

Undo snapshot state changes in Compose.

compose-undo Track changes to any snapshot state object and restore state from any point in the past. Usage implementation 'com.zachklipp.compose-undo

Field state manager and basic set of validation, fields
Field state manager and basic set of validation, fields

Compose Forms Field state manager and basic set of validation, fields

JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.
JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.

JetFlix A clone of Android NetFlix app in Android built using Jetpack compose. This sample app showcases the following: MVVM Architecture (ViewModel +

This app can be used to track open slots for vaccination. This is built using Jetpack Compose.
This app can be used to track open slots for vaccination. This is built using Jetpack Compose.

Covid Vaccine This projects used the Cowin APIs provided by the government. Screenshots Tech Stack Used Kotlin Dagger Hilt Clean Architecture with Mod

An android library to highlight different features of the app built using Jetpack Compose.
An android library to highlight different features of the app built using Jetpack Compose.

An android library to highlight different features of the app built using Jetpack Compose.

Formula 1 app to show current Standings from a REST API.Built using jetpack compose and kotlin.
Formula 1 app to show current Standings from a REST API.Built using jetpack compose and kotlin.

Formula1 Formula 1 app to show Standings fetching data from REST API 📸 Screenshots Tech Stack. Kotlin - Kotlin is a programming language that can run

🧱  A tetris game fully built using Jetpack Compose
🧱 A tetris game fully built using Jetpack Compose

A tetris game fully built using Jetpack Compose, almost all UI elements are created by code, including the following app icon, which is also generated by Composable with @Preview.

Releases(v1.0)
Owner
BHAVNA THACKER
Senior Android Developer Remote, Youtuber - LearnAndroid, Tutorial Editor and Video Content Creator @raywenderlich.com, WTM member.
BHAVNA THACKER
Instagram Clone built in Android using concept of Jetpack compose.

Instagram_Clone Instagram clone is an app build using new technologies/trends and other advanced Jetpack compose specific concepts. Following are the

raj narayan mishra 4 Dec 2, 2022
📱 WhatsApp clone project demonstrates modern Android development built with Jetpack Compose and Stream Chat SDK for Compose.

This is a WhatsApp clone app built with Jetpack Compose and Stream Chat SDK for Compose. The purpose of this repository is to demonstrate below: Imple

Stream 689 Dec 25, 2022
Sample repo that demonstrates various options for testing Jetpack Compose applications.

Composing With Confidence This is the sample repository for the Composing With Confidence presentation from Droidcon NYC in 2022. If you run the sampl

Adam McNeilly 9 Dec 2, 2022
Demonstrates using Compose with pre-releases of KotlinCompiler and ComposeCompiler

Using Compose Compiler to support different versions of Kotlin For the purposes of testing, development, or just living on the edge... some people wan

null 26 Aug 19, 2022
An android app that demonstrates Snapchat's Creative kit integration with Jetpack compose

Snap Creative kit Sample An android app that demonstrates Snapchat's creative kit integration with Jetpack compose ?? Requirements To try out this sam

Dishant Gandhi 1 Oct 28, 2021
PapriCoin demonstrates Jetpack Compose usage to build modern app based on Clean Architecture and newest Tech-Stack

PapriCoin demonstrates Jetpack Compose usage to build modern app based on Clean Architecture and newest Tech-Stack. Repository also has loca

Malik Mukhametzyanov 15 Nov 9, 2022
Using State in Jetpack Compose Codelab

Using State in Jetpack Compose Codelab This folder contains the source code for the Using State in Jetpack Compose codelab. In this codelab, you will

Jose Javier 0 Nov 17, 2021
Foldable-chat-android - Foldable chat Android demonstrates adaptive and responsive UIs with Jetpack WindowManager API

Foldable Chat Android A foldable chat Android demonstrates adaptive and responsi

Stream 31 Oct 29, 2022
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
Android Clean Architecture That Screams (MVVM + JetPack Compose UI + Flow + State)

Android Clean Architecture That Screams (MVVM + JetPack Compose UI + Flow + State)

Praveen Sharma 9 May 11, 2022