Update dependencies for ComposeTesting and DragAndDrop libraries (#59)
* Update DragAndDrop dependencies * Update ComposeTesting dependencies * Bump release versions for DragAndDrop and ComposeTesting libraries * Update main repo readme * Address PR comment
This commit is contained in:
Родитель
1d6a820944
Коммит
40e6802df2
|
@ -18,7 +18,7 @@ The library is based on the [testing-kotlin](https://github.com/microsoft/surfac
|
|||
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.testing:testing-compose:1.0.0-alpha08"
|
||||
implementation "com.microsoft.device.dualscreen.testing:testing-compose:1.0.0-alpha09"
|
||||
```
|
||||
|
||||
3. Also ensure the compileSdkVersion is set to API 33 and the targetSdkVersion is set to API 32 or newer in the module-level build.gradle file.
|
||||
|
|
|
@ -14,19 +14,19 @@ ext {
|
|||
|
||||
// ComposeTesting library version code:
|
||||
// If you want to publish a new version, bump in one (1) the specific line(s)
|
||||
composeTestingVersionCode = 8
|
||||
composeTestingVersionCode = 9
|
||||
|
||||
// ComposeTesting library version name:
|
||||
// If you want to publish a new version, bump the specific line
|
||||
composeTestingVersionName = '1.0.0-alpha08'
|
||||
composeTestingVersionName = '1.0.0-alpha09'
|
||||
|
||||
// ----------------------------------
|
||||
|
||||
gradlePluginVersion = '7.3.0'
|
||||
kotlinVersion = '1.8.0'
|
||||
gradlePluginVersion = '8.0.0'
|
||||
kotlinVersion = '1.8.21'
|
||||
compileSdkVersion = 33
|
||||
targetSdkVersion = 32
|
||||
minSdkVersion = 23
|
||||
minSdkVersion = 24
|
||||
dokkaVersion = "1.6.0"
|
||||
|
||||
config = [
|
||||
|
@ -46,9 +46,9 @@ ext {
|
|||
]
|
||||
|
||||
// AndroidX dependencies
|
||||
appCompatVersion = '1.6.0'
|
||||
ktxCoreVersion = "1.9.0"
|
||||
windowVersion = '1.1.0-alpha04'
|
||||
appCompatVersion = '1.6.1'
|
||||
ktxCoreVersion = '1.10.0'
|
||||
windowVersion = '1.1.0-beta02'
|
||||
androidxDependencies = [
|
||||
appCompat : "androidx.appcompat:appcompat:$appCompatVersion",
|
||||
ktxCore : "androidx.core:core-ktx:$ktxCoreVersion",
|
||||
|
@ -56,10 +56,10 @@ ext {
|
|||
]
|
||||
|
||||
// Compose dependencies
|
||||
composeVersion = '1.3.3'
|
||||
composeMaterialVersion = '1.3.1'
|
||||
composeCompilerVersion = '1.4.0'
|
||||
activityComposeVersion = '1.6.1'
|
||||
composeVersion = '1.4.3'
|
||||
composeMaterialVersion = '1.4.3'
|
||||
composeCompilerVersion = '1.4.7'
|
||||
activityComposeVersion = '1.7.1'
|
||||
navigationComposeVersion = '2.5.3'
|
||||
composeDependencies = [
|
||||
composeMaterial : "androidx.compose.material:material:$composeMaterialVersion",
|
||||
|
@ -97,7 +97,7 @@ ext {
|
|||
]
|
||||
|
||||
// Microsoft dependencies
|
||||
twoPaneLayoutVersion = '1.0.1-alpha05'
|
||||
twoPaneLayoutVersion = '1.0.1-alpha06'
|
||||
kotlinTestingVersion = '1.0.0-alpha4'
|
||||
microsoftDependencies = [
|
||||
twoPaneLayout: "com.microsoft.device.dualscreen:twopanelayout:$twoPaneLayoutVersion",
|
||||
|
|
|
@ -21,4 +21,5 @@ kotlin.code.style=official
|
|||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.disableAutomaticComponentCreation=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonFinalResIds=false
|
|
@ -1,6 +1,6 @@
|
|||
#Fri Jan 28 10:29:08 PST 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
|
@ -26,16 +26,15 @@ class SwipeTest {
|
|||
|
||||
@Test
|
||||
fun span_showsTwoPanes() {
|
||||
if (!device.isSurfaceDuo())
|
||||
return
|
||||
|
||||
// Assert that only pane 1 is shown
|
||||
composeTestRule.onNodeWithText(composeTestRule.getString(R.string.pane1_text)).assertIsDisplayed()
|
||||
composeTestRule.onNodeWithText(composeTestRule.getString(R.string.pane2_text)).assertDoesNotExist()
|
||||
|
||||
// Span the app from start
|
||||
if (device.isSurfaceDuo()) {
|
||||
device.spanFromStart()
|
||||
} else {
|
||||
return
|
||||
}
|
||||
device.spanFromStart()
|
||||
|
||||
// Assert that both panes are now shown
|
||||
composeTestRule.onNodeWithText(composeTestRule.getString(R.string.pane1_text)).assertIsDisplayed()
|
||||
|
@ -56,11 +55,7 @@ class SwipeTest {
|
|||
composeTestRule.onNodeWithText(composeTestRule.getString(R.string.pane2_text)).assertIsDisplayed()
|
||||
|
||||
// Unspan the app to the end
|
||||
if (device.isSurfaceDuo()) {
|
||||
device.unspanToEnd()
|
||||
} else {
|
||||
return
|
||||
}
|
||||
device.unspanToEnd()
|
||||
|
||||
// Assert that only pane 1 is now shown
|
||||
composeTestRule.onNodeWithText(composeTestRule.getString(R.string.pane1_text)).assertIsDisplayed()
|
||||
|
|
|
@ -20,7 +20,7 @@ The component provides a drag container which represents the draggable area with
|
|||
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:draganddrop:1.0.0-alpha04"
|
||||
implementation "com.microsoft.device.dualscreen:draganddrop:1.0.0-alpha05"
|
||||
```
|
||||
|
||||
3. Also ensure the compileSdkVersion is set to API 33 and the targetSdkVersion is set to API 32 or newer in the module-level build.gradle file.
|
||||
|
|
|
@ -14,19 +14,19 @@ ext {
|
|||
|
||||
// DragAndDrop library version code:
|
||||
// If you want to publish a new version, bump in one (1) the specific line(s)
|
||||
dragAndDropVersionCode = 04
|
||||
dragAndDropVersionCode = 5
|
||||
|
||||
// DragAndDrop library version name:
|
||||
// If you want to publish a new version, bump the specific line
|
||||
dragAndDropVersionName = '1.0.0-alpha04'
|
||||
dragAndDropVersionName = '1.0.0-alpha05'
|
||||
|
||||
// ----------------------------------
|
||||
|
||||
gradlePluginVersion = '7.3.0'
|
||||
kotlinVersion = "1.8.0"
|
||||
gradlePluginVersion = '8.0.0'
|
||||
kotlinVersion = '1.8.21'
|
||||
compileSdkVersion = 33
|
||||
targetSdkVersion = 32
|
||||
minSdkVersion = 23
|
||||
minSdkVersion = 24
|
||||
dokkaVersion = "1.6.0"
|
||||
|
||||
config = [
|
||||
|
@ -44,18 +44,18 @@ ext {
|
|||
]
|
||||
|
||||
// AndroidX dependencies
|
||||
appCompatVersion = '1.5.1'
|
||||
ktxCoreVersion = '1.9.0'
|
||||
appCompatVersion = '1.6.1'
|
||||
ktxCoreVersion = '1.10.0'
|
||||
androidxDependencies = [
|
||||
appCompat : "androidx.appcompat:appcompat:$appCompatVersion",
|
||||
ktxCore : "androidx.core:core-ktx:$ktxCoreVersion",
|
||||
]
|
||||
|
||||
// Compose dependencies
|
||||
composeVersion = "1.3.0"
|
||||
composeMaterialVersion = "1.3.1"
|
||||
composeCompilerVersion = "1.4.0"
|
||||
activityComposeVersion = '1.6.1'
|
||||
composeVersion = '1.4.3'
|
||||
composeMaterialVersion = '1.4.3'
|
||||
composeCompilerVersion = "1.4.7"
|
||||
activityComposeVersion = '1.7.1'
|
||||
composeDependencies = [
|
||||
composeMaterial : "androidx.compose.material:material:$composeMaterialVersion",
|
||||
composeUI : "androidx.compose.ui:ui:$composeVersion",
|
||||
|
@ -64,7 +64,7 @@ ext {
|
|||
]
|
||||
|
||||
// Microsoft dependencies
|
||||
twoPaneLayoutVersion = '1.0.1-alpha03'
|
||||
twoPaneLayoutVersion = '1.0.1-alpha06'
|
||||
microsoftDependencies = [
|
||||
twoPaneLayout : "com.microsoft.device.dualscreen:twopanelayout:$twoPaneLayoutVersion",
|
||||
]
|
||||
|
|
|
@ -21,3 +21,5 @@ kotlin.code.style=official
|
|||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonFinalResIds=false
|
|
@ -1,6 +1,6 @@
|
|||
#Wed Jun 22 16:43:27 PDT 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
|
@ -19,7 +19,6 @@ import androidx.compose.runtime.setValue
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.input.pointer.consumeAllChanges
|
||||
import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.unit.IntSize
|
||||
|
@ -56,7 +55,7 @@ fun DragTarget(
|
|||
currentState.draggableContent = content
|
||||
},
|
||||
onDrag = { change, dragAmount ->
|
||||
change.consumeAllChanges()
|
||||
change.consume()
|
||||
currentState.dragOffset += Offset(dragAmount.x, dragAmount.y)
|
||||
},
|
||||
onDragEnd = {
|
||||
|
|
10
README.md
10
README.md
|
@ -1,4 +1,4 @@
|
|||
![build-test-check](https://github.com/microsoft/surface-duo-compose-sdk/actions/workflows/build_test_check.yml/badge.svg) ![Compose Version](https://img.shields.io/badge/Jetpack%20Compose-1.3.3-brightgreen)
|
||||
![build-test-check](https://github.com/microsoft/surface-duo-compose-sdk/actions/workflows/build_test_check.yml/badge.svg) ![Compose Version](https://img.shields.io/badge/Jetpack%20Compose-1.4.3-brightgreen)
|
||||
|
||||
# Surface Duo Jetpack Compose SDK
|
||||
|
||||
|
@ -8,9 +8,9 @@ Please read the [code of conduct](CODE_OF_CONDUCT.md) and [contribution guidelin
|
|||
|
||||
## Prerequisites
|
||||
|
||||
- Jetpack Compose version: `1.3.3`
|
||||
- Jetpack Window Manager version: `1.1.0-alpha04`
|
||||
- Android Studio version: Dolphin `2021.3.1`
|
||||
- Jetpack Compose version: `1.4.3`
|
||||
- Jetpack Window Manager version: `1.1.0-beta02`
|
||||
- Android Studio version: Flamingo `2022.2.1`
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
@ -32,7 +32,7 @@ A UI component that helps you build two-pane layout for dual-screen, foldable, a
|
|||
|
||||
A utility component that helps you easily get details about the window state of dual-screen, foldable, and large-screen devices.
|
||||
|
||||
#### Latest Update: [1.0.0-alpha08](https://github.com/microsoft/surface-duo-compose-sdk/releases/tag/windowstate_20230206_alpha08) (February 6th, 2023)
|
||||
#### Latest Update: [1.0.0-alpha09](https://github.com/microsoft/surface-duo-compose-sdk/releases/tag/windowstate_20230504_alpha09) (May 4th, 2023)
|
||||
|
||||
### [ComposeTesting](https://github.com/microsoft/surface-duo-compose-sdk/tree/main/ComposeTesting)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче