Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ class StructureView(
super.dispatchDraw(canvas)

for (text in textViewMap.keys) {
val view = textViewMap[text]
val parent = text.parent.parent as ViewGroup
val view = textViewMap[text] ?: continue
val parent = (text.parent?.parent as? ViewGroup) ?: continue

val centerX = parent.x
val centerY = parent.y + parent.height.toFloat() / 2
Expand Down Expand Up @@ -265,7 +265,7 @@ class StructureView(

val editText = view.editText ?: continue
val current = viewTextMap[editText] ?: continue
val currentParent = current.parent.parent as ViewGroup
val currentParent = (current.parent?.parent as? ViewGroup) ?: continue

drawLine(currentParent)
}
Expand All @@ -276,7 +276,7 @@ class StructureView(
for (i in 0 until view.childCount) {
val child = view.getChildAt(i)
val current = viewTextMap[child] ?: continue
val currentParent = current.parent.parent as ViewGroup
val currentParent = (current.parent?.parent as? ViewGroup) ?: continue

drawLine(currentParent)
}
Expand Down
Loading