HTML text resources are partially skipped
Version: 0.8.0
| Android Studio preview | emulator | paparazziRecord |
|---|---|---|
![]() |
![]() |
![]() |
Problem of note: on paparazziRecord snapshot the text is not bold and the rest of the text is missing.
<string name="warning_no_location"><b>The widget needs to know where you are</b>. Please adjust your Location Settings by tapping here, then wait a moment.</string>
For reference https://github.com/TWiStErRob/net.twisterrob.sun/tree/bcbd0a53129742904ea74294fb55a871db01f4e0 will give us this state. Execute
gradlew :feature:configuration:recordPaparazziDebug -Pnet.twisterrob.build.screenshot-tests=true
I installed the last few stable versions of Android Studio and found out that html styles in string resources were not supported until Android Studio 4.1.
4.0.2 (left) vs 4.1 (right)


Here are the relevant commits to the studio-4.1 tagline:
- https://android.googlesource.com/platform/frameworks/layoutlib/+/eab564d763c4d33c8e09f5d3837f19845355b063%5E%21/#F0
- https://android.googlesource.com/platform/frameworks/layoutlib/+/27506a56be0fd61dff28da50633b13f8cd630693%5E%21/#F0
- https://android.googlesource.com/platform/frameworks/layoutlib/+/dc9e3746f8950c671f97a0561cfd632b3dbeed63%5E%21/#F0
Unfortunately, while Android Studio/LayoutLib 4.1 renders correctly, as of Paparazzi 0.9.0, this is still broken. Why?
Looks like it has something to do with how the XML parser is reading the strings.


Repro branch: https://github.com/cashapp/paparazzi/compare/jrod/2021-11-22/test-html-string-issue?expand=1
Wonder if slapping a CDATA around it would "fix" this, or show the <b> literally.
Partially fixed in https://issuetracker.google.com/issues/266681481 and https://issuetracker.google.com/issues/262773698.
Still remaining on https://issuetracker.google.com/issues/288441176.
This was fixed in the bump to Hedgehog.
See:
- https://issuetracker.google.com/issues/288441176
- https://github.com/cashapp/paparazzi/pull/1227
@jrodbx your last comment on https://issuetracker.google.com/issues/288441176 was that this is not fixed, did things change since then?


