Skip to content

Commit

Permalink
update to Compose 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Jul 27, 2022
1 parent 9775e72 commit 16b8174
Show file tree
Hide file tree
Showing 52 changed files with 58 additions and 81 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is an Jetpack Compose example project. I'm collecting a bunch of sample cod
[![jCenter](https://img.shields.io/badge/MIT-green.svg)](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
![Android Weekly](https://androidweekly.net/issues/issue-431/badge)
[![jCenter](https://img.shields.io/badge/Compose-1.1.1-green.svg
[![jCenter](https://img.shields.io/badge/Compose-1.2.0-green.svg
)](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
[![Contributors](https://img.shields.io/github/contributors/Foso/Jetpack-Compose-Playground.svg)](#contributors)
<a href="https://twitter.com/intent/tweet?text=Hey, check out Jetpack-Compose-Playground https://github.com/Foso/Jetpack-Compose-Playground via @jklingenberg_ #Android
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ android {
exclude("win32-x86-64/attach_hotspot_windows.dll")
pickFirst("META-INF/licenses/ASM")
}
compileSdkVersion 31
compileSdkVersion 32
defaultConfig {
applicationId "de.jensklingenberg.jetpackcomposeplayground"
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -83,7 +83,7 @@ subprojects {
}

dependencies {
def compose_version = "1.1.1"
def compose_version = "1.2.0"

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.appcompat:appcompat:1.4.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material.Card
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
Expand All @@ -16,13 +15,12 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun LazyVerticalGridDemo(){
val list = (1..10).map { it.toString() }

LazyVerticalGrid(
cells = GridCells.Adaptive(128.dp),
columns = GridCells.Adaptive(128.dp),

// content padding
contentPadding = PaddingValues(
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

buildscript {
ext {
compose_version = '1.1.1'
compose_version = '1.2.0'
kotlin_version = "1.7.0"
}
repositories {
Expand Down
2 changes: 1 addition & 1 deletion docs/activity/backhandler.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# BackHandler
Expand Down
2 changes: 1 addition & 1 deletion docs/animation/crossfade.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Crossfade

Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/get_android_context.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

You can use LocalContext.current to receive the context of your Android App inside a Compose Function
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/how_to_create_custom_shape.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## How to draw a custom shape?

!!! info
This is the API of version 1.1.1. Newer versions may have a different one
This is the API of version 1.2.0. Newer versions may have a different one

<p align="center">
<img src ="../../images/foundation/shape/triangleshape.png" />
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/loadimage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# How to load an image

Expand Down
2 changes: 1 addition & 1 deletion docs/cookbook/textfield_changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Handle changes to a TextField

Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/basictextfield.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# BasicTextField
Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/canvas.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# Canvas
Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/image.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Image

Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/layout/boxwithconstraints.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# BoxWithConstraints

Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/layout/spacer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# Spacer
Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/lazycolumn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# LazyColumn
Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/lazyrow.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# LazyRow
Expand Down
12 changes: 3 additions & 9 deletions docs/foundation/lazyverticalgrid.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# LazyVerticalGrid


!!! warning
Caution: The API is still ***experimental***. Experimental APIs can change in the future or may be removed entirely.


Jetpack Compose provides an API for displaying grid or grid elements.

# Example
Expand All @@ -23,13 +18,12 @@ The following example displays the items in a grid, using ``GridCells.Adaptive``
</p>

```kotlin
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun LazyVerticalGridDemo(){
val list = (1..10).map { it.toString() }

LazyVerticalGrid(
cells = GridCells.Adaptive(128.dp),
columns = GridCells.Adaptive(128.dp),

// content padding
contentPadding = PaddingValues(
Expand Down Expand Up @@ -64,7 +58,7 @@ fun LazyVerticalGridDemo(){

Apart from ``GridCells.Adaptive`` there are other types of cells that provide the number of columns per row. As follows
```
cells = GridCells.Fixed(2)
colums = GridCells.Fixed(2)
```
The above code will display 2 columns in 1 row.

Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/shape.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Shape
A Shape can be used to draw a Composable in specific shape.
Expand Down
2 changes: 1 addition & 1 deletion docs/foundation/text.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Text

Expand Down
15 changes: 0 additions & 15 deletions docs/general/compose_compiler

This file was deleted.

2 changes: 1 addition & 1 deletion docs/general/compose_lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Lifecycle

Expand Down
2 changes: 1 addition & 1 deletion docs/general/compositionlocal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# CompositionLocal

Expand Down
4 changes: 2 additions & 2 deletions docs/general/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android{
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.1.1"
kotlinCompilerExtensionVersion = "1.2.0"
}
}
Expand All @@ -25,7 +25,7 @@ Below are some Compose dependencies that are online available, can find the othe
```kotlin

dependencies {
val compose_version = "1.1.1"
val compose_version = "1.2.0"

implementation("androidx.compose.animation:animation-core:$compose_version")
implementation("androidx.compose.animation:animation:$compose_version")
Expand Down
2 changes: 1 addition & 1 deletion docs/general/modifier.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Modifier

Expand Down
2 changes: 1 addition & 1 deletion docs/general/state.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# State

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a community-driven collection of Jetpack Compose documentation/examples/

[![jCenter](https://img.shields.io/badge/MIT-green.svg)](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![jCenter](https://img.shields.io/badge/Compose-1.1.1-green.svg
[![jCenter](https://img.shields.io/badge/Compose-1.2.0-green.svg
)](https://github.com/Foso/Jetpack-Compose-Playground/blob/master/LICENSE)
![Android Weekly](https://androidweekly.net/issues/issue-431/badge)
[![Contributors](https://img.shields.io/github/contributors/Foso/Jetpack-Compose-Playground.svg)](#contributors)
Expand Down
2 changes: 1 addition & 1 deletion docs/layout/box.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Box

Expand Down
2 changes: 1 addition & 1 deletion docs/layout/column.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Column

Expand Down
2 changes: 1 addition & 1 deletion docs/layout/constraintlayout.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# ConstraintLayout
!!! tip
Expand Down
2 changes: 1 addition & 1 deletion docs/layout/row.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Row

Expand Down
2 changes: 1 addition & 1 deletion docs/material/alertdialog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# AlertDialog
Expand Down
2 changes: 1 addition & 1 deletion docs/material/button.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Button

Expand Down
2 changes: 1 addition & 1 deletion docs/material/card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Card

Expand Down
2 changes: 1 addition & 1 deletion docs/material/checkbox.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Checkbox

Expand Down
2 changes: 1 addition & 1 deletion docs/material/circularprogressindicator.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# CircularProgressIndicator

Expand Down
2 changes: 1 addition & 1 deletion docs/material/divider.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# Divider

Expand Down
2 changes: 1 addition & 1 deletion docs/material/dropdownmenu.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# DropdownMenu

Expand Down
2 changes: 1 addition & 1 deletion docs/material/floatingactionbutton.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# FloatingActionButton

Expand Down
2 changes: 1 addition & 1 deletion docs/material/linearprogressindicator.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# LinearProgressIndicator

Expand Down
2 changes: 1 addition & 1 deletion docs/material/modalbottomsheetlayout.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->

# ModalBottomSheetLayout
Expand Down
2 changes: 1 addition & 1 deletion docs/material/modaldrawer.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
This is the API of version 1.1.1
This is the API of version 1.2.0
-->
# ModalDrawer

Expand Down
Loading

0 comments on commit 16b8174

Please sign in to comment.