Fixed
Status Update
Comments
ki...@google.com <ki...@google.com>
ja...@google.com <ja...@google.com> #2
ma...@gmail.com <ma...@gmail.com> #3
Thanks for the report!
ap...@google.com <ap...@google.com> #4
The release notes documentation has been edited to clarify this change in behavior for line height.
To support non-standard text sizes, we encourage users to follow the Material design system and use a different style = LocalTextStyle.current.copy(lineHeight = TextUnit.Unspecified)
, or create a custom Typography
entirely.
Description
* Impl
* *********** */
/**
* Returns a [Sequence] walking up this view's [parent][View.getParent] hierarchy chain.
*/
val View.ancestors: Sequence<ViewParent>
get() = generateSequence(parent, ViewParent::getParent)
/* ***********
* Tests
* *********** */
@Test
fun ancestors_root() {
val actual = view.ancestors.toList()
val expected = emptyList<ViewParent>()
assertEquals(expected, actual)
}
@Test
fun ancestors() {
val parents = listOf(
FrameLayout(context),
LinearLayout(context),
RelativeLayout(context)
)
for ((parent, child) in parents.zipWithNext()) {
parent.addView(child)
}
parents.last().addView(view)
val expected = parents.reversed()
val actual = view.ancestors.toList()
assertEquals(expected, actual)
}