Slide 23
Slide 23 text
© ZOZO Technologies, Inc.
23
@RunWith(AndroidJUnit4::class)
class ViewInflateBenchmark {
@get:Rule
val benchmarkRule = BenchmarkRule()
@UiThreadTest
@Test
fun inflate() {
val context = ContextThemeWrapper(ApplicationProvider.getApplicationContext(), R.style.AppTheme)
val inflater = LayoutInflater.from(context)
val root = FrameLayout(context)
benchmarkRule.measureRepeated {
inflater.inflate(R.layout.view_item, root, false)
}
}
}