Skip to content

Commit

Permalink
Move to Compose 1.0.0 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyl1216 authored Jul 30, 2021
1 parent 0b2e3f7 commit 4b98a63
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ComposeSamples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ To learn how to load apps on the Surface Duo emulator, see the [documentation](h

## Prerequisites

- Jetpack Compose version: `1.0.0-beta09`
- Jetpack Compose version: `1.0.0`

- AndroidX WindowManager version: `1.0.0-alpha08`
- AndroidX WindowManager version: `1.0.0-alpha09`

## Contents

Expand Down
10 changes: 5 additions & 5 deletions ComposeSamples/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

ext {
gradlePluginVersion = '7.0.0-beta05'
gradlePluginVersion = '7.0.0'
kotlinVersion = "1.5.10"
compileSdkVersion = 30
targetSdkVersion = compileSdkVersion
Expand All @@ -31,9 +31,9 @@ ext {
window : "androidx.window:window:$windowVersion",
]

composeVersion = "1.0.0-rc02"
activityComposeVersion = "1.3.0-rc01"
navigationComposeVersion = "2.4.0-alpha04"
composeVersion = "1.0.0"
activityComposeVersion = "1.3.0"
navigationComposeVersion = "2.4.0-alpha05"

composeDependencies = [
composeRuntime : "androidx.compose.runtime:runtime-livedata:$composeVersion",
Expand All @@ -45,7 +45,7 @@ ext {
]

//Google dependencies
materialVersion = "1.3.0"
materialVersion = "1.5.0-alpha01"

googleDependencies = [
material: "com.google.android.material:material:$materialVersion"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Jetpack Compose sample code CI](https://github.com/microsoft/surface-duo-app-samples/workflows/App%20samples%20CI/badge.svg) ![Compose Version](https://img.shields.io/badge/Jetpack%20Compose-1.0.0%20rc02-brightgreen)
![Jetpack Compose sample code CI](https://github.com/microsoft/surface-duo-app-samples/workflows/App%20samples%20CI/badge.svg) ![Compose Version](https://img.shields.io/badge/Jetpack%20Compose-1.0.0-brightgreen)

# Surface Duo Jetpack Compose

Expand Down
17 changes: 14 additions & 3 deletions TwoPaneLayout/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# TwoPaneLayout - Surface Duo Compose SDK

**TwoPaneLayout** is a UI component built in Jetpack Compose, which contains the layouts that help you create UI for dual-screen, foldable and large-screen devices. TwoPaneLayout provides a two-pane layout for use at the top level of a UI. The two panes can be horizontal or vertical, based on the orientation of the device. TwoPaneLayout supports the use of the layout parameter layout_weight on child views to determine how to divide two panes to cover the whole display area.
**TwoPaneLayout** is a UI component for Jetpack Compose, which contains the layouts that help you create UI for dual-screen, foldable, and large-screen devices. TwoPaneLayout provides a two-pane layout for use at the top level of a UI. The component will place two panes side-by-side on dual-screen, foldable and large-screen devices and one pane only on regular single-screen devices. The two panes can be horizontal or vertical, based on the orientation of the device, unless `paneMode` is configured.

Please refer to [user interface patterns](https://docs.microsoft.com/dual-screen/introduction#dual-screen-app-patterns) to learn some common use case for the two panes.
The elements will be layout based on the order, which means the first element will be placed in the first pane and the second element will be placed in the second pane. The TwoPaneLayout is able to assign children widths according to their weights provided using the `TwoPaneScope.weight` modifier.

```
@Composable
fun TwoPaneLayout(
modifier: Modifier = Modifier,
paneMode: TwoPaneMode = TwoPaneMode.TwoPane,
content: TwoPaneScope.() -> Unit
)
```

Please refer to [user interface patterns](https://docs.microsoft.com/dual-screen/introduction#dual-screen-app-patterns) to learn about some common use case for the two panes.

##

Expand All @@ -21,7 +32,7 @@ Please refer to [user interface patterns](https://docs.microsoft.com/dual-screen
2. Add dependencies to the module-level **build.gradle** file (current version may be different from what's shown here).
```gradle
implementation "com.microsoft.device.dualscreen:twopanelayout:1.0.0-alpha02"
implementation "com.microsoft.device.dualscreen:twopanelayout:1.0.0-alpha04"
```
3. Also ensure the compileSdkVersion and targetSdkVersion are set to API 30 or newer in the module-level build.gradle file
Expand Down
13 changes: 7 additions & 6 deletions TwoPaneLayout/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ ext {

// TwoPaneLayout library version code:
// If you want to publish a new version, bump in one (1) the specific line(s)
twoPaneLayoutVersionCode = 3
twoPaneLayoutVersionCode = 4

// TwoPaneLayout library version name:
// If you want to publish a new version, bump the specific line
twoPaneLayoutVersionName = '1.0.0-alpha03'
twoPaneLayoutVersionName = '1.0.0-alpha04'

// ----------------------------------

gradlePluginVersion = '7.0.0-beta05'
gradlePluginVersion = '7.0.0'
kotlinVersion = "1.5.10"
compileSdkVersion = 30
targetSdkVersion = compileSdkVersion
Expand All @@ -49,8 +49,9 @@ ext {
window : "androidx.window:window:$windowVersion",
]

composeVersion = "1.0.0-rc02"
activityComposeVersion = "1.3.0-rc01"
composeVersion = "1.0.0"
activityComposeVersion = "1.3.0"
navigationComposeVersion = "2.4.0-alpha05"

composeDependencies = [
composeMaterial : "androidx.compose.material:material:$composeVersion",
Expand All @@ -67,7 +68,7 @@ ext {
]

//Google dependencies
materialVersion = "1.2.1"
materialVersion = "1.5.0-alpha01"

googleDependencies = [
material: "com.google.android.material:material:$materialVersion"
Expand Down

0 comments on commit 4b98a63

Please sign in to comment.