From bb91ca0cf1316e39c7c70d70d6420c4d9d4943bf Mon Sep 17 00:00:00 2001 From: masashi Date: Tue, 1 Sep 2026 11:39:46 +0900 Subject: [PATCH 1/4] Make bearing a clockwise map rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bearing を「値を増やすと地図が時計回りに回る」向きに統一し、ネイティブ SDK との変換をコアの CameraBearing に集約する。 --- .../java/com/mapconductor/here/MapCameraPosition.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/mapconductor/here/MapCameraPosition.kt b/src/main/java/com/mapconductor/here/MapCameraPosition.kt index 90150a7..94e9ead 100644 --- a/src/main/java/com/mapconductor/here/MapCameraPosition.kt +++ b/src/main/java/com/mapconductor/here/MapCameraPosition.kt @@ -7,6 +7,7 @@ import com.here.sdk.mapview.MapCameraUpdate import com.here.sdk.mapview.MapCameraUpdateFactory import com.here.sdk.mapview.MapMeasure import com.mapconductor.core.features.GeoPoint +import com.mapconductor.core.map.CameraBearing import com.mapconductor.core.map.MapCameraPosition import com.mapconductor.core.map.MapCameraPositionInterface import com.mapconductor.core.spherical.Spherical @@ -30,7 +31,7 @@ internal fun MapCameraPosition.toHereDisplayCamera(): HereDisplayCamera { target = GeoPoint.from(position), tiltDeg = tilt, hereZoomLevel = ZoomAltitudeConverter.googleZoomToHereZoom(zoom, position.latitude), - bearing = bearing, + bearing = CameraBearing.toNativeHeading(bearing), ) } // tilt < 0: HERE cannot represent upward pitch directly. @@ -40,13 +41,13 @@ internal fun MapCameraPosition.toHereDisplayCamera(): HereDisplayCamera { val hereZoomOrig = ZoomAltitudeConverter.googleZoomToHereZoom(zoom, position.latitude) val altitude = converter.zoomLevelToAltitude(hereZoomOrig, position.latitude, 0.0) val distanceForward = altitude * tan(tiltAbsRad) - val target = Spherical.computeOffset(position, distanceForward, bearing) + val target = Spherical.computeOffset(position, distanceForward, CameraBearing.toNativeHeading(bearing)) val adjustedHereZoom = converter.altitudeToZoomLevel(altitude / cos(tiltAbsRad), target.latitude, 0.0) return HereDisplayCamera( target = target, tiltDeg = tiltAbsDeg, hereZoomLevel = adjustedHereZoom, - bearing = bearing, + bearing = CameraBearing.toNativeHeading(bearing), ) } @@ -93,7 +94,7 @@ internal fun MapCamera.State.toMapCameraPosition(logicalTiltHint: Double?): MapC return MapCameraPosition( position = position, zoom = ourZoom, - bearing = orientationAtTarget.bearing, + bearing = CameraBearing.bearingFromNativeHeading(orientationAtTarget.bearing), tilt = pitch, visibleRegion = null, ) @@ -114,7 +115,7 @@ internal fun MapCamera.State.toMapCameraPosition(logicalTiltHint: Double?): MapC return MapCameraPosition( position = originalCenter, zoom = originalGoogleZoom, - bearing = bear, + bearing = CameraBearing.bearingFromNativeHeading(bear), tilt = -pitchAbsDeg, visibleRegion = null, ) From 5e19298f3a437d36605aff11337ef8e6e3af5846 Mon Sep 17 00:00:00 2001 From: masashi Date: Thu, 3 Sep 2026 17:12:18 +0900 Subject: [PATCH 2/4] ci: build the core module from the matching branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コアの未マージ/未リリースな変更に追随する PR を、コアが先に取り込まれるのを待たずに検証できるようにする。同名ブランチが無ければ従来どおり既定のコアを使う。 --- .github/workflows/build.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c511f7..3e55946 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,8 +54,29 @@ jobs: fi - name: Build core and compose locally + env: + HEAD_REF: ${{ github.head_ref }} run: | - git clone --depth 1 https://github.com/MapConductor/android-sdk-core.git _core + # コア側に PR と同名のブランチがあるなら、そちらを組む。 + # + # ここを default ブランチ固定にしていると、**コアの未マージな変更に追随する + # PR は永久に赤いまま**になる。実際 CameraBearing をコアへ足したとき、 + # プロバイダ側の PR が 10 本まとめて Unresolved reference で落ちた。 + # コアが先にマージされるまで待つ、という運用は取り込み順の事故を呼ぶので、 + # 同名ブランチがあれば拾う形にしてある(無ければ従来どおり default)。 + clone_matching() { + repo="$1"; dir="$2" + url="https://github.com/MapConductor/$repo.git" + if [ -n "$HEAD_REF" ] && git ls-remote --exit-code --heads "$url" "$HEAD_REF" >/dev/null 2>&1; then + echo "$repo: matching branch $HEAD_REF" + git clone --depth 1 --branch "$HEAD_REF" "$url" "$dir" + else + echo "$repo: default branch" + git clone --depth 1 "$url" "$dir" + fi + } + + clone_matching android-sdk-core _core cd _core ./gradlew --no-daemon publishToMavenLocal cd .. @@ -69,7 +90,7 @@ jobs: } EOF - git clone --depth 1 https://github.com/MapConductor/android-sdk-compose.git _compose + clone_matching android-sdk-compose _compose cd _compose ./gradlew --no-daemon publishToMavenLocal cd .. From 983d4a09c48f58b9d66455514678cc48f7c33b87 Mon Sep 17 00:00:00 2001 From: masashi Date: Thu, 3 Sep 2026 20:01:25 +0900 Subject: [PATCH 3/4] fix: point material3 at its own version line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit material3 は compose-ui とは別のバージョン系列で、composeLibs(1.7.8)を流用すると存在しない material3:1.7.8 を要求して sample-app のクラスパスごと解決に失敗する。集約ビルド(android-sdk)の catalog と同じ 1.4.0 に合わせる。 --- gradle/libs.versions.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 353e813..0545bdd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,9 @@ [versions] coroutines = "1.9.0" composeLibs = "1.7.8" +# material3 は compose-ui とは別のバージョン系列。composeLibs(ui 系)を流用すると +# 存在しない material3:1.7.8 を要求してクラスパスごと解決に失敗する。 +material3 = "1.4.0" agp = "9.2.1" kotlin = "2.0.21" @@ -27,7 +30,7 @@ androidx-lifecycle-common-java8 = { group = "androidx.lifecycle", name = "lifecy # Sample app androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } -androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "composeLibs" } +androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "composeLibs" } # Test From fcac9b5edcaab292801494ac605e8a98608afef6 Mon Sep 17 00:00:00 2001 From: masashi Date: Thu, 3 Sep 2026 20:16:16 +0900 Subject: [PATCH 4/4] fix: declare material-icons-core for the sample app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sample-app が Icons.AutoMirrored を使うが、material3 は material-icons を推移的に持ってこないため単体ビルドで Unresolved reference 'Icons' になる。版は compose BOM 任せで、集約ビルドの catalog と同じ形にする。 --- gradle/libs.versions.toml | 3 +++ sample-app/build.gradle.kts | 1 + 2 files changed, 4 insertions(+) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0545bdd..a701d59 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,6 +31,9 @@ androidx-lifecycle-common-java8 = { group = "androidx.lifecycle", name = "lifecy # Sample app androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } androidx-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" } +# sample-app が Icons.AutoMirrored を使う。material3 は material-icons を推移的に持ってこないので +# 明示的に足す。版は compose BOM 任せ(集約ビルドの catalog と同じ形)。 +androidx-material-icons-core = { group = "androidx.compose.material", name = "material-icons-core" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "composeLibs" } # Test diff --git a/sample-app/build.gradle.kts b/sample-app/build.gradle.kts index a995c93..7c9ef69 100644 --- a/sample-app/build.gradle.kts +++ b/sample-app/build.gradle.kts @@ -64,6 +64,7 @@ dependencies { implementation(libs.androidx.ui) implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) + implementation(libs.androidx.material.icons.core) debugImplementation(platform(libs.androidx.compose.bom)) debugImplementation(libs.androidx.ui.tooling) }