-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
노드 정렬 알고리즘(LayoutManager)구현, 리팩토링 #49
Conversation
nodes 프로퍼티가 나타내는 의미가 자식 노드인데, 자식 노드는 무조건 RectangleNode이기 때문에 RectangleNode로 변경함
val scale = context.resources.displayMetrics.density | ||
return (pxVal / scale).toInt() | ||
return pxVal / scale |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int형이라서 너무 괴로웠는데 좋은거 같습니다.
@@ -3,17 +3,17 @@ package boostcamp.and07.mindsync.data.model | |||
sealed class Node( | |||
open val path: NodePath, | |||
open val description: String, | |||
open val nodes: List<Node>, | |||
open val nodes: List<RectangleNode>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자식들은 무조건 RectangleNode 일수밖에 없어서 이렇게 하신것도 좋은거 같아요
sealed class Node( | ||
open val path: NodePath, | ||
open val description: String, | ||
open val nodes: List<Node>, | ||
open val nodes: List<RectangleNode>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node를 RectangleNode로 변경하신 부분이 매우 좋은 거 같습니다!!
private val verticalSpacing = Dp(50f) | ||
|
||
fun arrangement(node: Node): Node { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrangement 함수를 동사로 변경하면 좋을 거 같아요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 맞네요 ㅎㅎ arrangeNode로 수정하겠습니다~!!
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불필요한 공백 제거하면 좋을거 같아요
관련 이슈
작업한 내용
Head 의 노드 정보가 주어졌을 때, Head를 기준으로 나머지의 위치를 재정렬 하는 코드 작성
Before : x, y 좌표를 직접 정해주지 않으면 자유분방하게 배치됨
After : arrangement 함수만 호출해주면 자동으로 정렬됨
리팩토링