fix: bridge Android particle mix property
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled

This commit is contained in:
OpenAI Codex
2026-09-03 10:35:17 +08:00
parent 0ab94c4eab
commit 5782574c8c
11 changed files with 68 additions and 6 deletions

View File

@@ -144,11 +144,6 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
private fun setTimeMix(value: Float) {
val requestedTimeMix = value.coerceIn(0.0f, 1.0f)
val layer = maplibreMap.style?.getLayer(PARTICLE_LAYER_ID)
if (layer == null) {
Log.i(TAG, "ParticleGPU: event=MIX_REJECTED reason=LAYER_NOT_READY styleEpoch=$styleLoadEpoch")
return
}
val rejectReason = when {
!styleReady -> "STYLE_LOADING"
!enabled -> "DISABLED"
@@ -159,8 +154,12 @@ class ParticleCoreLayerValidationActivity : AppCompatActivity() {
Log.i(TAG, "ParticleGPU: event=MIX_REJECTED reason=$rejectReason styleEpoch=$styleLoadEpoch")
return
}
Log.i(TAG, "ParticleGPU: event=MIX_PROPERTY_REQUEST value=$requestedTimeMix styleEpoch=$styleLoadEpoch")
if (!maplibreMap.setStyleLayerFloatProperty(PARTICLE_LAYER_ID, "raster-particle-time-mix", requestedTimeMix)) {
Log.i(TAG, "ParticleGPU: event=MIX_REJECTED reason=CORE_LAYER_NOT_FOUND styleEpoch=$styleLoadEpoch")
return
}
timeMix = requestedTimeMix
layer.setProperties(PaintPropertyValue("raster-particle-time-mix", timeMix))
status.text = statusText()
Log.i(TAG, "ParticleGPU: event=MIX_PROPERTY_ONLY value=$timeMix styleEpoch=$styleLoadEpoch")
}