Package 

Object StyleEngine

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static StyleEngine INSTANCE
    • Method Summary

      Modifier and Type Method Description
      final TextStyle applyTextStyle(TextStyle base, TextStyleConfig config) Apply TextStyleConfig to a Compose TextStyle.
      final Modifier applyContainerStyle(Modifier $self, ElementStyleConfig style) Apply ElementStyleConfig as Modifier extensions.
      final Modifier applyBlockContainerStyle(Modifier $self, Map<String, Object> fieldConfig) SPEC-401-A R9 — universal block-container styling, ported from iOS ContentBlockTypes.swift:744-786 applyBlockContainerStyle.
      final Color parseColor(String hex) Parse a hex color string to Compose Color.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • applyBlockContainerStyle

        @Composable() final Modifier applyBlockContainerStyle(Modifier $self, Map<String, Object> fieldConfig)

        SPEC-401-A R9 — universal block-container styling, ported from iOS ContentBlockTypes.swift:744-786 applyBlockContainerStyle.

        iOS applies this modifier to EVERY ContentBlock at ContentBlockRendererView.swift:67 (.applyBlockContainerStyle(block)) so any block type — text/image/row/input/etc. — can opt into a container background, blur effect, border, and corner radius via field_config keys:

        • blur_background: Bool → frosted-glass effect

        • container_bg_color: String

        • container_opacity: Double (preferred) or background_opacity (legacy)

        • container_border_width: Double

        • container_border_color: String

        • container_corner_radius: Double

        Previously Android only honoured these on the row block, so any authored container styling on a non-row block silently dropped.

        Opt-in: if blur is off, container_bg_color is empty/white/transparent, AND no visible border, this returns this unchanged. Same opt-in gate as iOS to avoid phantom backgrounds from stale color-picker defaults.

        Blur caveat: Compose's Modifier.blur(...) (API 31+) blurs the MODIFIER's content, not the content BEHIND it the way iOS .ultraThinMaterial does. Without a HazeChild library we approximate frosted-glass with a translucent white layer; the effect on solid backgrounds is similar enough for parity.

      • parseColor

         final Color parseColor(String hex)

        Parse a hex color string to Compose Color.

        Byte order matches iOS Color(hex:) in Paywalls/PaywallHelperViews.swift:

        • 6-char → RGB, alpha = 0xFF

        • 8-char → RGBA (R, G, B, A — NOT Compose's default ARGB long form)

        • "transparent" / "clear" → Color.Transparent

        • any other / parse failure → Color.Transparent (matches iOS fallback (0, 0, 0, 0))

        SPEC-070-A A.2 — fixes the prior Color(colorLong) ARGB interpretation that rotated channels for every console-saved RGBA color.