Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
# Gradle files
.gradle/
build/
Expand Down Expand Up @@ -32,8 +31,6 @@ google-services.json

# Android Profiling
*.hprof
=======
*.iml
.gradle
/local.properties
/.idea/caches
Expand All @@ -46,6 +43,4 @@ google-services.json
/build
/captures
.externalNativeBuild
.cxx
local.properties
>>>>>>> edc685d ([week5] LifeCycle)
.cxx
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/deploymentTargetSelector.xml

This file was deleted.

19 changes: 0 additions & 19 deletions .idea/gradle.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/kotlinc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/migrations.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/misc.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/vcs.xml

This file was deleted.

15 changes: 15 additions & 0 deletions flo-clone/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
1 change: 1 addition & 0 deletions flo-clone/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
60 changes: 60 additions & 0 deletions flo-clone/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("kotlin-kapt")
}

android {
namespace = "com.example.flo_clone"
compileSdk = 35

defaultConfig {
applicationId = "com.example.flo_clone"
minSdk = 21
targetSdk = 35
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
implementation(libs.gson)
implementation(libs.androidx.media3.common.ktx)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.runtime)
kapt(libs.androidx.room.compiler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„๋งˆ ๊ฐ•์˜์—์„œ kapt๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์–ด๋…ธํ…Œ์ด์…˜ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•ด์ฃผ์—ˆ๋˜ ๊ฒƒ ๊ฐ™์€๋ฐ kapt์˜ ๊ฒฝ์šฐ ๊ธฐ์กด ์ฝ”ํ‹€๋ฆฐ ์–ธ์–ด๋ฅผ java ์–ธ์–ด๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ java ๊ธฐ๋ฐ˜์˜ annotation processor๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ์‹์ด๋‹ค๋ณด๋‹ˆ ์†๋„๊ฐ€ ๋А๋ ค์ ธ ์ตœ๊ทผ์— ksp๋ผ๊ณ  ์ฝ”ํ‹€๋ฆฐ ์ž์ฒด์—์„œ ์ฝ”๋“œ๋ฅผ ๋ถ„์„ํ•˜๋Š” ํˆด์ด ๋‚˜์™”์–ด์š”! ์•„๋ž˜ ๊ด€๋ จ ๋งํฌ ํ•œ๋ฒˆ ๋ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊น๋‹ˆ๋‹ค.

kapt์—์„œ KSP๋กœ ์ด์ „

}
21 changes: 21 additions & 0 deletions flo-clone/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.flo_clone

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.flo_clone", appContext.packageName)
}
}
31 changes: 31 additions & 0 deletions flo-clone/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.FLOclone"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".SongActivity"
android:exported="true" />
</application>

</manifest>
8 changes: 8 additions & 0 deletions flo-clone/app/src/main/java/com/example/flo_clone/Album.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.flo_clone

class Album (
var title: String? = "",
var singer: String? ="",
var coverImg: Int? = null,
var songs: ArrayList<Song>? = null //์ˆ˜๋ก๊ณก ์˜๋ฏธ, ๊ฐ•์˜์—์„œ๋Š” ์‚ฌ์šฉํ•˜์ง€ ์•Š์Œ
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•จ๋ฒ”์— ์†ํ•˜๋Š” ๋…ธ๋ž˜๋ฅผ ์ด๋ ‡๊ฒŒ ์ €์žฅํ•˜๊ฒŒ ๋  ๊ฒฝ์šฐ Song ํ…Œ์ด๋ธ”์˜ ์ •๋ณด๊ฐ€ ๋ฐ”๋€Œ์—ˆ์„ ๋•Œ Album ์•ˆ์˜ ์ˆ˜๋ก๊ณก ์ •๋ณด๋ฅผ ๋”ฐ๋กœ ์ˆ˜์ •ํ•ด์ค˜์•ผ ํ•œ๋‹ค๋Š” ๋ฒˆ๊ฑฐ๋กœ์›€์ด ์ƒ๊ธธ ๊ฒƒ ๊ฐ™์•„์š”! ์„œ๋กœ ๋‹ค๋ฅธ ํ…Œ์ด๋ธ” ๊ฐ„ ์—ฐ๊ด€๊ด€๊ณ„๊ฐ€ ์žˆ์„ ๋•Œ๋Š” ์™ธ๋ž˜ํ‚ค๋‚˜ ๋งคํ•‘ ํ…Œ์ด๋ธ”์„ ๋‘๋Š” ๋ฐฉ์‹์„ ์ƒ๊ฐํ•ด๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Album๊ณผ Song์„ ์—ฐ๊ฒฐํ•ด์ค„ ๋•Œ ๋‘ ํ…Œ์ด๋ธ”์˜ ๊ด€๊ณ„์„ฑ์„ ๋ด์•ผ ํ•˜๋Š”๋ฐ

  1. 1๊ฐœ์˜ ์•จ๋ฒ”์—๋Š” ์—ฌ๋Ÿฌ๊ฐœ์˜ Song์ด ์†ํ•  ์ˆ˜ ์žˆ๊ณ  1๊ฐœ์˜ Song์€ ๋”ฑ 1๊ฐœ์˜ Album์—๋งŒ ๋“ค์–ด๊ฐ„๋‹ค -> Album๊ณผ Song์ด 1:n ๊ด€๊ณ„์ด๋ฏ€๋กœ Song ํ…Œ์ด๋ธ”์— Album์˜ pk๊ฐ’์„ ์™ธ๋ž˜ํ‚ค๋กœ ์—ฐ๊ฒฐํ•ด์ค€๋‹ค (albumIdx ํ•„๋“œ์— ์†ํ•˜๊ฒ ์ฃ ?)
  2. 1๊ฐœ์˜ ์•จ๋ฒ”์—๋Š” ์—ฌ๋Ÿฌ๊ฐœ์˜ Song์ด ์†ํ•  ์ˆ˜ ์žˆ๊ณ  1๊ฐœ์˜ Song์€ ์—ฌ๋Ÿฌ ๊ฐœ์˜ Album์— ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๋‹ค -> Album๊ณผ Song์ด n:m ๊ด€๊ณ„์ด๋ฏ€๋กœ Album ํ…Œ์ด๋ธ”๊ณผ Song ํ…Œ์ด๋ธ”์„ ๋งคํ•‘ํ•ด ์ค„ ์ƒˆ๋กœ์šด ํ…Œ์ด๋ธ”์ด ํ•„์š”ํ•  ๊ฑฐ์˜ˆ์š”!

์œ„ ์ƒํ™ฉ์„ ๊ณ ๋ คํ•ด๋ณด๊ณ  ํ˜„์žฌ ๊ตฌํ˜„ํ•˜๋ ค๊ณ  ํ•˜๋Š” ์•ฑ์—์„œ๋Š” ์–ด๋–ป๊ฒŒ ์„ค๊ณ„ํ•˜๋ฉด ์ข‹์„์ง€ ์ƒ๊ฐํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

)
Loading