-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from boostcampwm2023/AOS-develop
[MindSync](0.3.1) 마인드맵, 스페이스, 보드, 로그인
- Loading branch information
Showing
233 changed files
with
8,801 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## android | ||
/AOS/ @jaehan4707 @yang1318 @hegleB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ name: AOS-ktlint | |
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- AOS-develop | ||
- AOS-*/** | ||
push: | ||
paths: | ||
- '**.kt' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions
11
AOS/app/src/main/java/boostcamp/and07/mindsync/MainActivity.kt
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
AOS/app/src/main/java/boostcamp/and07/mindsync/data/IdGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package boostcamp.and07.mindsync.data | ||
|
||
import java.util.UUID | ||
|
||
object IdGenerator { | ||
fun makeRandomNodeId() = UUID.randomUUID().toString() | ||
} |
24 changes: 24 additions & 0 deletions
24
AOS/app/src/main/java/boostcamp/and07/mindsync/data/NodeGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package boostcamp.and07.mindsync.data | ||
|
||
import boostcamp.and07.mindsync.data.model.RectangleNode | ||
import boostcamp.and07.mindsync.data.model.RectanglePath | ||
import boostcamp.and07.mindsync.ui.util.Dp | ||
|
||
object NodeGenerator { | ||
fun makeNode( | ||
description: String, | ||
parentId: String, | ||
) = RectangleNode( | ||
id = IdGenerator.makeRandomNodeId(), | ||
parentId = parentId, | ||
path = | ||
RectanglePath( | ||
Dp(0f), | ||
Dp(0f), | ||
Dp(0f), | ||
Dp(0f), | ||
), | ||
description = description, | ||
listOf(), | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
AOS/app/src/main/java/boostcamp/and07/mindsync/data/crdt/Clock.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package boostcamp.and07.mindsync.data.crdt | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class Clock(val id: String, var counter: Int = 0) : Comparable<Clock> { | ||
fun increment() { | ||
counter++ | ||
} | ||
|
||
fun merge(remoteClock: Clock): Clock { | ||
return Clock(id, maxOf(counter, remoteClock.counter)) | ||
} | ||
|
||
override fun compareTo(other: Clock): Int { | ||
return when { | ||
this.counter > other.counter -> 1 | ||
this.counter == other.counter && this.id > other.id -> 1 | ||
this.counter == other.counter && this.id == other.id -> 0 | ||
else -> -1 | ||
} | ||
} | ||
} |
Oops, something went wrong.