Skip to content

Commit

Permalink
Merge pull request #227 from boostcampwm2023/AOS-develop
Browse files Browse the repository at this point in the history
[MindSync](0.3.1) 마인드맵, 스페이스, 보드, 로그인
  • Loading branch information
jaehan4707 authored Dec 7, 2023
2 parents 03c60ae + 8247caa commit 5e72caf
Show file tree
Hide file tree
Showing 233 changed files with 8,801 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## android
/AOS/ @jaehan4707 @yang1318 @hegleB
2 changes: 1 addition & 1 deletion .github/workflows/AOS-ktlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: AOS-ktlint
on:
pull_request:
branches:
- main
- AOS-develop
- AOS-*/**
push:
paths:
- '**.kt'
Expand Down
72 changes: 67 additions & 5 deletions AOS/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import java.util.Properties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("androidx.navigation.safeargs.kotlin")
kotlin("kapt")
id("com.google.dagger.hilt.android")
id("kotlinx-serialization")
}

android {
namespace = "boostcamp.and07.mindsync"
compileSdk = 34

val properties = Properties()
properties.load(project.rootProject.file("local.properties").inputStream())
val url = properties["BASE_URL"] ?: ""
val googleServerClientId = properties["GOOGLE_SERVER_CLIENT_ID"] ?: ""
val kakaoClientId = properties["KAKAO_CLIENT_ID"] ?: ""
val removeQuotationKakaoClientId =
properties["KAKAO_CLIENT_ID"]?.let { id -> (id as String).replace("\"", "") } ?: ""

defaultConfig {
applicationId = "boostcamp.and07.mindsync"
minSdk = 26
Expand All @@ -18,19 +29,24 @@ android {
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "BASE_URL", "$url")
buildConfigField("String", "GOOGLE_SERVER_CLIENT_ID", "$googleServerClientId")
buildConfigField("String", "KAKAO_CLIENT_ID", "$kakaoClientId")
manifestPlaceholders["KAKAO_CLIENT_ID"] = removeQuotationKakaoClientId
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
buildFeatures {
viewBinding = true
dataBinding = true
buildConfig = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -41,24 +57,70 @@ android {
}
}

val ktlint by configurations.creating

dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.0.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
}
// androidx
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.datastore:datastore-preferences:1.0.0")
// test
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
testImplementation("junit:junit:4.13.2")
// material
implementation("com.google.android.material:material:1.10.0")
// hilt,
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
// retrofit
// hilt
implementation("com.google.dagger:hilt-android:2.48")
kapt("com.google.dagger:hilt-android-compiler:2.48")
// retrofit, socket.io
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("io.socket:socket.io-client:2.1.0")
// navigation
val nav_version = "2.7.5"
implementation("androidx.navigation:navigation-fragment-ktx:$nav_version")
implementation("androidx.navigation:navigation-ui-ktx:$nav_version")
// coil
implementation("io.coil-kt:coil:2.5.0")
// kotlin serialization, retrofit json converter
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
// google login
implementation("com.google.android.gms:play-services-auth:20.7.0")
// kakao login
implementation("com.kakao.sdk:v2-user:2.18.0") // 카카오 로그인
// LayoutManager flexBox
implementation("com.google.android.flexbox:flexbox:3.0.0")
}

val ktlintCheck by tasks.registering(JavaExec::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style"
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
args(
"**/src/main/**/*.kt",
)
}

tasks.check {
dependsOn(ktlintCheck)
}

tasks.register<JavaExec>("ktlintFormat") {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Check Kotlin code style and format"
classpath = ktlint
mainClass.set("com.pinterest.ktlint.Main")
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
args(
"-F",
"**/src/main/**/*.kt",
)
}
42 changes: 39 additions & 3 deletions AOS/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,61 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<application
android:name=".ui.MindSyncApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_app_logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_app_logo_round"
android:supportsRtl="true"
android:theme="@style/Theme.MindSync"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name="MainActivity"
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="oauth"
android:scheme="kakao${KAKAO_CLIENT_ID}" />
</intent-filter>
</activity>
<activity
android:name=".ui.login.LoginActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.space.join.AddInviteSpaceActivity"
android:exported="false" />
<activity
android:name=".ui.space.generate.AddSpaceActivity"
android:exported="false" />
<activity
android:name=".ui.main.MainActivity"
android:exported="false" />
<activity
android:name=".ui.profile.ProfileActivity"
android:exported="false" />
</application>

</manifest>
Binary file added AOS/app/src/main/ic_app_logo-playstore.png
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 AOS/app/src/main/java/boostcamp/and07/mindsync/MainActivity.kt

This file was deleted.

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()
}
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 AOS/app/src/main/java/boostcamp/and07/mindsync/data/crdt/Clock.kt
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
}
}
}
Loading

0 comments on commit 5e72caf

Please sign in to comment.