Align ImageChunks to baseline.

PiperOrigin-RevId: 245939821
Change-Id: Icb9c2c4db40b46b31a1e812f09d69a4d62957d66
diff --git a/src/main/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapter.java b/src/main/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapter.java
index 00c5466..64a4892 100644
--- a/src/main/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapter.java
+++ b/src/main/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapter.java
@@ -315,7 +315,7 @@
     LayerDrawable wrapper = new LayerDrawable(new Drawable[] {placeholder});
     wrapper.setId(0, SINGLE_LAYER_ID);
     setBounds(wrapper, chunkStyle, textView);
-    ImageSpan imageSpan = new ImageSpan(wrapper);
+    ImageSpan imageSpan = new ImageSpan(wrapper, ImageSpan.ALIGN_BASELINE);
 
     if (chunkStyle.getMargins().hasStart()) {
       addMargin(spannable, chunkStyle.getMargins().getStart());
diff --git a/src/test/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapterTest.java b/src/test/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapterTest.java
index f89cb11..fdd4a9d 100644
--- a/src/test/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapterTest.java
+++ b/src/test/java/com/google/android/libraries/feed/piet/ChunkedTextElementAdapterTest.java
@@ -453,6 +453,10 @@
     assertThat(adapter.getBaseView().getText().toString()).isEqualTo(" ");
     assertThat(((SpannedString) adapter.getBaseView().getText()).getSpans(0, 1, ImageSpan.class))
         .hasLength(1);
+    assertThat(
+            ((SpannedString) adapter.getBaseView().getText())
+                .getSpans(0, 1, ImageSpan.class)[0].getVerticalAlignment())
+        .isEqualTo(ImageSpan.ALIGN_BASELINE);
   }
 
   @Test