Move StaticLayoutFactory from TextLayout to StaticLayoutCampat
Bug: 113815795
Test: ./gradlew ui-port:test
Test: ./gradlew ui-port:connectedAndroidTest
Test: ./gradlew ui-text:test
Test: ./gradlew ui-text:connectedAndroidTest
Change-Id: Ie74275e4b4493bf24d763c3ed0741b06e6723344
diff --git a/ui/port/src/androidTest/java/androidx/ui/port/engine/text/platform/ParagraphAndroidTest.kt b/ui/port/src/androidTest/java/androidx/ui/port/engine/text/platform/ParagraphAndroidTest.kt
index f16ff95..b5eb478 100644
--- a/ui/port/src/androidTest/java/androidx/ui/port/engine/text/platform/ParagraphAndroidTest.kt
+++ b/ui/port/src/androidTest/java/androidx/ui/port/engine/text/platform/ParagraphAndroidTest.kt
@@ -6,7 +6,7 @@
import android.text.TextPaint
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
-import androidx.text.StaticLayoutFactory
+import androidx.text.StaticLayoutCompat
import androidx.ui.engine.text.FontFallback
import androidx.ui.engine.text.ParagraphStyle
import androidx.ui.engine.text.TextAlign
@@ -50,12 +50,13 @@
textPaint.textSize = fontSize.toFloat()
textPaint.typeface = fontFallback.typeface
- val staticLayout = StaticLayoutFactory.create(
- textPaint = textPaint,
- charSequence = text,
- width = ceil(paragraphAndroid.width).toInt(),
- ellipsizeWidth = ceil(paragraphAndroid.width).toInt()
+ val staticLayout = StaticLayoutCompat.Builder(
+ text,
+ textPaint,
+ ceil(paragraphAndroid.width).toInt()
)
+ .setEllipsizedWidth(ceil(paragraphAndroid.width).toInt())
+ .build()
Assert.assertThat(paragraphAndroid.bitmap(), equalToBitmap(staticLayout.bitmap()))
}
}