Skip to content

Commit 909253a

Browse files
authored
Merge pull request #77 from what3words/staging
2.0.1
2 parents 405d5ff + 45ae224 commit 909253a

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

.github/workflows/BuildTest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=5
6060

6161
- name: Upload test results
62-
uses: actions/upload-artifact@v3
62+
uses: actions/upload-artifact@v4
6363
with:
6464
name: test-results
6565
path: lib/build/outputs/androidTest-results

.github/workflows/Release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
echo "OSSRH_PASSWORD=${OSSRH_PASSWORD}">> ~/.gradle/gradle.properties
4141
echo "SIGNING_KEY=${GPG_SIGNING_KEY}">> ~/.gradle/gradle.properties
4242
echo "SIGNING_KEY_PWD=${SIGNING_KEY_PWD}">> ~/.gradle/gradle.properties
43-
cat ~/.gradle/gradle.properties
4443
4544
- name: Snapshot Release Check
4645
run: |
47-
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${CIRCLE_BRANCH}" =~ ^epic.* ]] && echo true || echo false )" >> gradle.properties
46+
echo -e "\nIS_SNAPSHOT_RELEASE=$( [[ "${{ github.ref_name }}" == epic/* ]] && echo true || echo false )" >> ~/.gradle/gradle.properties
47+
cat ~/.gradle/gradle.properties
4848
4949
- name: Publish to Maven
5050
run: ./gradlew assemble publish

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ kotlin.code.style=official
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
2424
android.nonFinalResIds=false
25-
LIBRARY_VERSION = 2.0.0
25+
LIBRARY_VERSION = 2.0.1

lib/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,19 @@ dependencies {
114114

115115
// what3words
116116
api("com.what3words:w3w-android-wrapper:4.0.2")
117-
api("com.what3words:w3w-android-design-library:2.0.3")
117+
api("com.what3words:w3w-android-design-library:2.0.4")
118118
api("com.what3words:w3w-core-android:1.1.0")
119119

120120
//compose
121-
implementation(platform("androidx.compose:compose-bom:2024.06.00"))
121+
implementation(platform("androidx.compose:compose-bom:2025.01.01"))
122122
implementation("androidx.compose.runtime:runtime")
123123
implementation("androidx.compose.ui:ui")
124124
implementation("androidx.compose.ui:ui-tooling")
125125
implementation("androidx.activity:activity-compose")
126126
implementation("androidx.compose.ui:ui-tooling-preview")
127-
implementation("androidx.constraintlayout:constraintlayout-compose")
128127
implementation("androidx.compose.material3:material3")
128+
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")
129+
129130

130131
// gms for module install
131132
implementation("com.google.android.gms:play-services-base:18.5.0")

lib/src/main/java/com/what3words/ocr/components/internal/W3WImageAnalyzer.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import androidx.camera.core.ExperimentalGetImage
66
import androidx.camera.core.ImageAnalysis
77
import androidx.camera.core.ImageProxy
88
import androidx.compose.ui.layout.LayoutCoordinates
9-
import androidx.compose.ui.layout.positionInRoot
9+
import androidx.compose.ui.layout.positionInParent
1010
import com.what3words.core.types.common.W3WError
1111
import com.what3words.core.types.image.W3WImage
1212
import com.what3words.ocr.components.extensions.BitmapUtils
@@ -28,10 +28,11 @@ internal class W3WImageAnalyzer(
2828
BitmapUtils.getBitmap(imageProxy)?.let { bitmap ->
2929
val bitmapToBeScanned = try {
3030
if (cropLayoutCoordinates.isAttached && cameraLayoutCoordinates.isAttached) {
31+
3132
val x1: Float =
32-
(cropLayoutCoordinates.positionInRoot().x * bitmap.width) / cameraLayoutCoordinates.size.width
33+
(cropLayoutCoordinates.positionInParent().x * bitmap.width) / cameraLayoutCoordinates.size.width
3334
val y1: Float =
34-
(cropLayoutCoordinates.positionInRoot().y * bitmap.height) / cameraLayoutCoordinates.size.height
35+
(cropLayoutCoordinates.positionInParent().y * bitmap.height) / cameraLayoutCoordinates.size.height
3536
val width1: Int =
3637
(cropLayoutCoordinates.size.width * bitmap.width) / cameraLayoutCoordinates.size.width
3738
val height1: Int =

lib/src/main/java/com/what3words/ocr/components/ui/OcrScanComposable.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import com.what3words.design.library.ui.components.What3wordsAddressListItem
7272
import com.what3words.design.library.ui.components.What3wordsAddressListItemDefaults
7373
import com.what3words.design.library.ui.models.DisplayUnits
7474
import com.what3words.design.library.ui.theme.W3WTheme
75+
import com.what3words.design.library.ui.theme.colors_blue_20
7576
import com.what3words.design.library.ui.theme.w3wColorScheme
7677
import com.what3words.ocr.components.R
7778
import com.what3words.ocr.components.internal.buildW3WImageAnalysis
@@ -140,13 +141,13 @@ object W3WOcrScannerDefaults {
140141
@Composable
141142
fun defaultColors(
142143
bottomDrawerBackground: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
143-
overlayBackground: Color = Color(0x990A3049),
144+
overlayBackground: Color = colors_blue_20.copy(0.6f),
144145
stateTextColor: Color = MaterialTheme.colorScheme.onSecondaryContainer,
145146
listHeaderTextColor: Color = MaterialTheme.colorScheme.onSurfaceVariant,
146147
gripColor: Color = MaterialTheme.colorScheme.outline,
147-
closeIconColor: Color = Color.White,
148-
logoColor: Color = Color.White,
149-
shutterInactiveColor: Color = Color.White,
148+
closeIconColor: Color = MaterialTheme.w3wColorScheme.onSurfaceWhite,
149+
logoColor: Color = MaterialTheme.w3wColorScheme.onSurfaceWhite,
150+
shutterInactiveColor: Color = MaterialTheme.w3wColorScheme.onSurfaceWhite,
150151
shutterActiveColor: Color = MaterialTheme.w3wColorScheme.success,
151152
): Colors {
152153
return Colors(

0 commit comments

Comments
 (0)