Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit ee18012

Browse files
committed
fix(filetree): automatically expand first level of file tree (project root) (closes #1073)
1 parent 304cb44 commit ee18012

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/itsaky/androidide/fragments/FileTreeFragment.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ class FileTreeFragment :
269269
state!!.split(AndroidTreeView.NODES_PATH_SEPARATOR.toRegex()).dropLastWhile { it.isEmpty() }
270270
restoreNodeState(mRoot!!, HashSet(openNodes))
271271
}
272+
273+
mRoot?.let { rootNode ->
274+
if (rootNode.children.isNotEmpty()) {
275+
rootNode.childAt(0)?.let { projectRoot -> expandNode(projectRoot) }
276+
}
277+
}
272278
}
273279

274280
private fun restoreNodeState(root: TreeNode, openNodes: Set<String>) {

0 commit comments

Comments
 (0)