All Projects → vinaygaba → Learn Jetpack Compose By Example

vinaygaba / Learn Jetpack Compose By Example

Licence: apache-2.0
🚀 This project contains various examples that show how you would do things the "Jetpack Compose" way

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Learn Jetpack Compose By Example

JetComposer
Collection of UIs and Animations built with Jetpack Compose for Android
Stars: ✭ 294 (-77.71%)
Mutual labels:  declarative-ui, android-ui, compose
Jetquotes
🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI
Stars: ✭ 179 (-86.43%)
Mutual labels:  declarative-ui, android-ui, compose
Composecookbook
A Collection on all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential
Stars: ✭ 3,516 (+166.57%)
Mutual labels:  declarative-ui, android-ui, compose
Jetpack-compose-sample
Forget about bunch of XML files for maintaining UIs. Jetpack Compose is Android’s modern toolkit for building native UI. Here is a small example to get started.
Stars: ✭ 29 (-97.8%)
Mutual labels:  sample-app, declarative-ui, compose
Coffeegram
Android app using Jetpack Compose together with StateFlow and MVI
Stars: ✭ 155 (-88.25%)
Mutual labels:  declarative-ui, android-ui, compose
Jetpack Compose Playground
Community-driven collection of Jetpack Compose example code and tutorials 🚀 https://foso.github.io/compose
Stars: ✭ 969 (-26.54%)
Mutual labels:  sample-app, compose
Einsen
🎯 Einsen is a prioritization app that uses Eisenhower matrix technique as workflow to prioritize a list of tasks & built to Demonstrate use of Jetpack Compose with Modern Android Architecture Components & MVVM Architecture.
Stars: ✭ 821 (-37.76%)
Mutual labels:  declarative-ui, android-ui
Aboutlibraries
AboutLibraries automatically detects all dependencies of a project and collects their information including the license. Optionally visualising it via the provided ui components.
Stars: ✭ 2,777 (+110.54%)
Mutual labels:  android-ui, compose
Compose Jb
Jetpack Compose for Desktop and Web, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Stars: ✭ 7,562 (+473.31%)
Mutual labels:  compose, declarative-ui
Plasma
An Android Application written using latest Android Jetpack components and best practices, which displays trending movies/TV shows and cast, user can search movies and TV shows and also add them to watchlist.
Stars: ✭ 67 (-94.92%)
Mutual labels:  declarative-ui, compose
Cwac Layouts
CWAC Layouts: Custom Containers, Concisely Coded
Stars: ✭ 76 (-94.24%)
Mutual labels:  android-ui
Cycleviewpager2
使用 ViewPager2 实现无限轮播效果,可以用来实现 banner 以及上下滚动文字广告等。Implementing android cycle viewPager with ViewPager2
Stars: ✭ 76 (-94.24%)
Mutual labels:  android-ui
Smartchart
智能折线图、柱状图,支持水平垂直滚动拉伸,自适应屏幕(解决与scrollview滑动冲突),x轴y轴自定义刻度以及标题,双向滚动列表;增加一周天气折线图以及24小时天气预报
Stars: ✭ 85 (-93.56%)
Mutual labels:  android-ui
Statelayout
StateLayout is a simple-use Android layout library which handles Loading, Content and Error states
Stars: ✭ 88 (-93.33%)
Mutual labels:  android-ui
Cordova Plugin Camera Preview Sample App
cordova-plugin-camera-preview Sample App
Stars: ✭ 76 (-94.24%)
Mutual labels:  sample-app
Recyclercalendarandroid
A simple DIY library to generate your own custom Calendar View using RecyclerView, written in Kotlin
Stars: ✭ 83 (-93.71%)
Mutual labels:  android-ui
Swiftgui
SwiftGUI is an API inspired by SwiftUI DSL, using Dear ImGui as renderer and running on macOS 10.13+ and iOS 11+
Stars: ✭ 74 (-94.39%)
Mutual labels:  declarative-ui
Kitchensink V2
An Alloy-based Titanium sample app using ES6+ and more!
Stars: ✭ 73 (-94.47%)
Mutual labels:  sample-app
Edxposedmanager
Companion Android application for EdXposed
Stars: ✭ 1,172 (-11.14%)
Mutual labels:  android-ui
Facebook Timeline Compose Android
Facebook Timeline UI with Pure Kotlin Jetpack Compose
Stars: ✭ 90 (-93.18%)
Mutual labels:  android-ui

Learn Jetpack Compose By Example

Android CI Compose Version Android Weekly

Feature Image

Over the course of the last few years Android development has gone through significant changes in how we structure our apps, the language we use for development, the tooling & libraries that help us speed up our development and the improvements in testing our apps. What had not changed in all these years is the Android UI toolkit. This changes with Jetpack Compose that aims to re-imagine what Android UI development would look like using declarative programming principles. It is heavily influenced by existing web and mobile frameworks such as React, Litho, Vue & Flutter and would be a paradigm shift in Android UI development as we know it.

This repository aims to show the Jetpack Compose way of building common Android UI that we are accustomed to building.

Talks

I've also used the examples listed in this repo and given talks at conferences. If video is your preferred medium of learning, you can head to the links below

360|AnDev 2020: Learning Jetpack Compose By Example Video| Slides

Android Summit 2020: Learn Jetpack Compose By Example v2 Slides

Setup

To try out this sample app, you need to at least use the Canary version of Android Studio 4.2, specifically Android Studio 4.2 Canary 15. You can download it here. In general, Jetpack Compose requires you to use the Canary version of Android Studio.

Examples

Each example is meant to be self contained and tries to explain all the concepts that its using with comments. Compose also comes with this nifty feature that lets you preview each component in the IntelliJ IDE itself. To do so, go to any of the examples and then click on the preview button in the top right corner. This is possible if your @Composable component has a corresponding @Preview method associated with it. Look at the examples below for all this to make a bit more sense.

Jetpack Compose Preview Functionality

General

Example Preview
How do I display text on the screen using Jetpack Compose?
How do I make a view clickable and do actions when clicked?
How do I add padding around a view?
How do I add an offset to a layout?
How do I enforce a layout to have a fixed aspect ratio?
How do I add a background color to any section of the screen?
Example 1
Example 2

How do I get FrameLayout like functionality to stack views on top of one another?
How do I do animation in Jetpack Compose?
Example: Rotation Animation
Example: Color Change Animation


How do styles & themes work in Jetpack Compose?
How do I add dark mode capability to my app?

State Management

Example Preview
How do I store state information in Jetpack Compose?
How do I retain state across process death & activity recreation(like orientation changes)?
How do I use LiveData/ViewModels with Jetpack Compose?
How do I use Coroutine Flow to update my components/views with Jetpack Compose?
How do you launch a Coroutine inside a Composable?
How do you do side-effects in Jetpack Compose?
How do you handle back press in Jetpack Compose?

Material Design

Example Preview
How do I add a Material Design Card?
How do I display a linear progress bar?
What about a circular progress bar?
How do I add a Snackbar?
How to add a Material Design Slider?
How to configure a two/three state checkbox?
How do I add a radio button group?
How do I add a Floating Action Button to my screen?
How do I create a Bottom App Bar?
How do I add a drawer to my screen?
How do I add Ripple effect to a view?
How do I add a Button to my screen?
How do I display an alert dialog/popup modal?
How do I make Material Filter Chips that overflow to multiple rows?
How do I add a shadow around my view?

Text

Example Preview
How do I style & customize my text?
How do you take text input from a user in Jetpack Compose?
How can I use a custom text style for a text input?
How can I change the keyboard type to accept numbers?
How can I create a Search bar?
How can I apply a visual transformation to an input text?
How can I provide a hint for the text input field?
Is there filled text field as per Material Design specification?
How do I animate parts of my text?
How do I describe parts of my text to be replaced by alternate views?

Images

Example Preview
How do I display an image in Jetpack Compose?
How to load an image from the resource folder?
How to make an image view with rounded corners?
How to load an image over the network using Picasso?
How to load an image over the network using Glide?

Lists

Example Preview
How do I display a list in my app?
Is there a RecyclerView equivalent?
How can I have a grid layout?
How can I build a horizontally scrollable carousel?
How can I add animations for insertion/deletion of a list item?

Flexible Layouts

Example Preview
How do I align the baseline of two views?

What's the layout weight equivalent in Jetpack Compose?
Example with equal weights
Example with unequal weights

How do I auto arrange my views similar to FlexBox?
Add space between views
Evenly distribute space
Add space around the views
Tightly packed centering of views
How do I use constraint layouts?
How do I use guidelines with constraint layouts?
How do I add barriers when using constraint layouts?
How do I add bias when using constraint layouts?

Custom Views

Example Preview
How do I draw using a canvas?
Example of a measuring scale component
How do I make a view zoomable?
How do I detect touch events in a custom view?

Interoperability

Example Preview
How can I use Jetpack Compose components inside existing screens?

Testing

Example Preview
How do I write a simple UI Test in Jetpack Compose?
How do I test "Composables"?

Credits

Author: Vinay Gaba ([email protected])

Follow me on Twitter Follow me on LinkedIn

License

Copyright 2020 Vinay Gaba

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].