From 98582732cd66070c28b63f4e3ac607b0fdbdb5b5 Mon Sep 17 00:00:00 2001 From: fgerber Date: Wed, 10 Apr 2024 16:50:18 +0200 Subject: [PATCH] Fix regions not colored in regional mode --- app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt b/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt index 6bb8930..38d5ca6 100644 --- a/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt +++ b/app/src/main/java/net/helcel/beans/svg/CSSWrapper.kt @@ -3,6 +3,7 @@ package net.helcel.beans.svg import android.content.Context import net.helcel.beans.countries.Country import net.helcel.beans.countries.GeoLoc +import net.helcel.beans.countries.State import net.helcel.beans.countries.World import net.helcel.beans.helper.AUTO_GROUP import net.helcel.beans.helper.Data @@ -55,16 +56,17 @@ class CSSWrapper(private val ctx: Context) { } }.map { it.code - }.joinToString(",") { "#${it}$id,#${it}" } + "{fill:${ + }.takeIf { it.isNotEmpty() }?.joinToString(",") { "#${it}$id,#${it}" } + "{fill:${ colorToHex6(colorWrapper(ctx, android.R.attr.colorPrimary)) };}" } else if (groups.getGroupFromKey(k).key == NO_GROUP) "" - else + else { v.joinToString(",") { "#${it}$id,#${it}" } + "{fill:${ colorToHex6(groups.getGroupFromKey(k).color) };}" + } }.joinToString("") }