diff --git a/flo-clone-code/app/src/main/java/com/example/flo/SignUpActivity.kt b/flo-clone-code/app/src/main/java/com/example/flo/SignUpActivity.kt new file mode 100644 index 0000000..1f870a3 --- /dev/null +++ b/flo-clone-code/app/src/main/java/com/example/flo/SignUpActivity.kt @@ -0,0 +1,20 @@ +package com.example.flo + +import android.os.Bundle +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat + +class SignUpActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_sign_up) + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> + val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) + insets + } + } +} \ No newline at end of file diff --git a/flo-clone-code/app/src/main/res/drawable/btn_actionbar_close.png b/flo-clone-code/app/src/main/res/drawable/btn_actionbar_close.png new file mode 100644 index 0000000..b6cc3cc Binary files /dev/null and b/flo-clone-code/app/src/main/res/drawable/btn_actionbar_close.png differ diff --git a/flo-clone-code/app/src/main/res/drawable/btn_input_password.png b/flo-clone-code/app/src/main/res/drawable/btn_input_password.png new file mode 100644 index 0000000..8c2eb18 Binary files /dev/null and b/flo-clone-code/app/src/main/res/drawable/btn_input_password.png differ diff --git a/flo-clone-code/app/src/main/res/drawable/btn_input_password_off.png b/flo-clone-code/app/src/main/res/drawable/btn_input_password_off.png new file mode 100644 index 0000000..8234f53 Binary files /dev/null and b/flo-clone-code/app/src/main/res/drawable/btn_input_password_off.png differ diff --git a/flo-clone-code/app/src/main/res/layout/activity_sign_up.xml b/flo-clone-code/app/src/main/res/layout/activity_sign_up.xml new file mode 100644 index 0000000..b5ede55 --- /dev/null +++ b/flo-clone-code/app/src/main/res/layout/activity_sign_up.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/flo-clone/.gitignore b/flo-clone/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/flo-clone/.gitignore @@ -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 diff --git a/flo-clone/app/.gitignore b/flo-clone/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/flo-clone/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/flo-clone/app/build.gradle.kts b/flo-clone/app/build.gradle.kts new file mode 100644 index 0000000..5d9d936 --- /dev/null +++ b/flo-clone/app/build.gradle.kts @@ -0,0 +1,67 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +android { + + configurations.implementation { + + exclude(group = "org.jetbrains", module = "annotations") + } + + namespace = "com.example.flo_clone" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.flo_clone" + minSdk = 21 + targetSdk = 34 + 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) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + implementation("com.google.code.gson:gson:2.10.1") + + implementation("androidx.room:room-ktx:2.4.1") + implementation("androidx.room:room-runtime:2.4.1") + implementation("androidx.room:room-compiler:2.4.1") +} diff --git a/flo-clone/app/proguard-rules.pro b/flo-clone/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/flo-clone/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/flo-clone/app/src/androidTest/java/com/example/flo_clone/ExampleInstrumentedTest.kt b/flo-clone/app/src/androidTest/java/com/example/flo_clone/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..62b35b6 --- /dev/null +++ b/flo-clone/app/src/androidTest/java/com/example/flo_clone/ExampleInstrumentedTest.kt @@ -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) + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/AndroidManifest.xml b/flo-clone/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..282885e --- /dev/null +++ b/flo-clone/app/src/main/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/AuthResponse.kt b/flo-clone/app/src/main/java/com/example/flo_clone/AuthResponse.kt new file mode 100644 index 0000000..2ab5d83 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/AuthResponse.kt @@ -0,0 +1,3 @@ +package com.example.flo_clone + +data class AuthResponse() diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/AuthoRetrofitInterface.kt b/flo-clone/app/src/main/java/com/example/flo_clone/AuthoRetrofitInterface.kt new file mode 100644 index 0000000..ed7cd18 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/AuthoRetrofitInterface.kt @@ -0,0 +1,4 @@ +package com.example.flo_clone + +interface AuthoRetrofitInterface { +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/BlankFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/BlankFragment.kt new file mode 100644 index 0000000..bcb9f2a --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/BlankFragment.kt @@ -0,0 +1,59 @@ +package com.example.flo_clone + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [BlankFragment.newInstance] factory method to + * create an instance of this fragment. + */ +class BlankFragment : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_locker_savedsong, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment BlankFragment. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + BlankFragment().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/LoginActivity.kt b/flo-clone/app/src/main/java/com/example/flo_clone/LoginActivity.kt new file mode 100644 index 0000000..c812086 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/LoginActivity.kt @@ -0,0 +1,20 @@ +package com.example.flo_clone + +import android.os.Bundle +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat + +class LoginActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_login) + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> + val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) + insets + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/MainActivity.kt b/flo-clone/app/src/main/java/com/example/flo_clone/MainActivity.kt new file mode 100644 index 0000000..0a0e2dc --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/MainActivity.kt @@ -0,0 +1,226 @@ +package com.example.flo_clone + +import android.content.Intent +import android.os.Bundle +import android.util.Log +import android.widget.Toast +import androidx.activity.result.contract.ActivityResultContracts +import androidx.appcompat.app.AppCompatActivity +import com.example.flo_clone.databinding.ActivityMainBinding +import com.example.flo_clone.ui.home.HomeFragment +import com.example.flo_clone.ui.locker.LockerFragment +import com.example.flo_clone.ui.look.LookFragment +import com.example.flo_clone.ui.search.SearchFragment +import com.google.gson.Gson + +class MainActivity : AppCompatActivity() { + + lateinit var binding: ActivityMainBinding + private var songList : List ?= null + private var song: Song = Song() + private var gson: Gson = Gson() + + private val startForResult = + registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> + if (result.resultCode == RESULT_OK) { + val data: Intent? = result.data + Toast.makeText(this, data?.getStringExtra("title"), Toast.LENGTH_SHORT).show() + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) + inputDummySongs() + initBottomNavigation() + + binding.mainPlayerCl.setOnClickListener { + val editor = getSharedPreferences("song", MODE_PRIVATE).edit() + editor.putInt("songId",song.id) + editor.apply() + + val intent = Intent(this,SongActivity::class.java) + startActivity(intent) + } + + // main_player_cl 눌렀을 때 SongActivity로 전환 리스너 설정 + /*binding.mainPlayerCl.setOnClickListener { + val intent = Intent(this, SongActivity::class.java) + intent.putExtra("title", song.title) + intent.putExtra("singer", song.singer) + intent.putExtra("second", song.second) + intent.putExtra("playTime", song.playTime) + intent.putExtra("isPlaying", song.isPlaying) + intent.putExtra("music",song.music) + startForResult.launch(intent) + }*/ + } + + override fun onStart(){ + super.onStart() + /*val sharedPreferences = getSharedPreferences("song", MODE_PRIVATE) + val songJson = sharedPreferences.getString("songData",null) + + song = if(songJson == null){ + Song("라일락","아이유(IU)",0,60,false,"luxery") + + }else{ + gson.fromJson(songJson, Song::class.java) + } + + setMiniPlayer(song)*/ + + val spf = getSharedPreferences("song", MODE_PRIVATE) + val songId = spf.getInt("songId",0) + + val songDB = SongDatabase.getInstance(this)!! + + song = if (songId == 0){ + songDB.songDao().getSong(1) + } else{ + songDB.songDao().getSong(songId) + } + + Log.d("song ID", song.id.toString()) + setMiniPlayer(song) + + + + } + + private fun initBottomNavigation() { + supportFragmentManager.beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, HomeFragment()) + .commitAllowingStateLoss() + + binding.navView.setOnItemSelectedListener { item -> + when (item.itemId) { + R.id.navigation_home -> { + supportFragmentManager.beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, HomeFragment()) + .commitAllowingStateLoss() + true + } + + R.id.navigation_look -> { + supportFragmentManager.beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, LookFragment()) + .commitAllowingStateLoss() + true + } + + R.id.navigation_search -> { + supportFragmentManager.beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, SearchFragment()) + .commitAllowingStateLoss() + true + } + + R.id.navigation_locker -> { + supportFragmentManager.beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, LockerFragment()) + .commitAllowingStateLoss() + true + } + + else -> false + } + } + + + } + + private fun setMiniPlayer(song: Song){ + binding.mainMiniplayerTitleTv.text = song.title + binding.mainMiniplayerSingerTv.text = song.singer + binding.mainProgressSb.progress = (song.second*100000)/song.playTime + } + private fun inputDummySongs(){ + val songDB = SongDatabase.getInstance(this)!! + val songs = songDB.songDao().getSongs() + + if(songs.isNotEmpty())return + + songDB.songDao().insert( + Song("Butter" , + "방탄소년단 (BTS)", + 0, + 240, + false, + "music_lilac", + R.drawable.img_album_exp2, + false) + + ) + + songDB.songDao().insert( + Song("Butter" , + "방탄소년단 (BTS)", + 0, + 240, + false, + "music_lilac", + R.drawable.img_album_exp2, + false) + + ) + + songDB.songDao().insert( + Song("Butter" , + "방탄소년단 (BTS)", + 0, + 240, + false, + "music_lilac", + R.drawable.img_album_exp2, + false) + + ) + + songDB.songDao().insert( + Song("Butter" , + "방탄소년단 (BTS)", + 0, + 240, + false, + "music_lilac", + R.drawable.img_album_exp2, + false) + + ) + + songDB.songDao().insert( + Song("Butter" , + "방탄소년단 (BTS)", + 0, + 240, + false, + "music_lilac", + R.drawable.img_album_exp2, + false) + + ) + + songDB.songDao().insert( + Song("Butter" , + "방탄소년단 (BTS)", + 0, + 240, + false, + "music_lilac", + R.drawable.img_album_exp2, + false) + + ) + + val _songs = songDB.songDao().getSongs() + Log.d("DB data", _songs.toString()) + + + } + + + + } diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/NetworkModule.kt b/flo-clone/app/src/main/java/com/example/flo_clone/NetworkModule.kt new file mode 100644 index 0000000..eaf0e59 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/NetworkModule.kt @@ -0,0 +1,4 @@ +package com.example.flo_clone + +class NetworkModule { +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/Play.kt b/flo-clone/app/src/main/java/com/example/flo_clone/Play.kt new file mode 100644 index 0000000..bce2fb4 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/Play.kt @@ -0,0 +1,7 @@ +package com.example.flo_clone + +data class Play( + val title: String = "", + val singer: String = "", + var coverImg: Int? = null, +) diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/SignUpActivity.kt b/flo-clone/app/src/main/java/com/example/flo_clone/SignUpActivity.kt new file mode 100644 index 0000000..222a803 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/SignUpActivity.kt @@ -0,0 +1,20 @@ +package com.example.flo_clone + +import android.os.Bundle +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat + +class SignUpActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_sign_up) + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> + val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) + insets + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/Song.kt b/flo-clone/app/src/main/java/com/example/flo_clone/Song.kt new file mode 100644 index 0000000..9afcd99 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/Song.kt @@ -0,0 +1,18 @@ +package com.example.flo_clone +import androidx.room.Entity +import androidx.room.PrimaryKey + +@Entity(tableName = "SongTable") +data class Song( + val title: String = "", + val singer: String = "", + var second: Int = 0, + var playTime: Int = 0, + var isPlaying: Boolean = false, + var music: String = "", + var coverImg: Int? = null, + var islike: Boolean = false + +){ + @PrimaryKey(autoGenerate=true) var id:Int=0//primarykey 자동생성 +} diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/SongActivity.kt b/flo-clone/app/src/main/java/com/example/flo_clone/SongActivity.kt new file mode 100644 index 0000000..5035ca1 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/SongActivity.kt @@ -0,0 +1,166 @@ +package com.example.flo_clone + +import android.content.Intent +import android.media.MediaPlayer +import android.os.Bundle +import android.util.Log +import android.view.View +import androidx.appcompat.app.AppCompatActivity +import com.example.flo_clone.databinding.ActivitySongBinding +import com.google.gson.Gson + +class SongActivity : AppCompatActivity() { + lateinit var binding: ActivitySongBinding + lateinit var song: Song + lateinit var timer: Timer + private var mediaPlayer: MediaPlayer? = null + private var gson: Gson = Gson() + + val songs = arrayListOf() + lateinit var songDB: SongDatabase + var nowPos = 0 + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivitySongBinding.inflate(layoutInflater) + setContentView(binding.root) + + initPlayList() + initSong() + + setPlayer(song) + + binding.songRepeatIv.setOnClickListener{ + + timer.interrupt() + startTimer() + + } + + binding.songDownIb.setOnClickListener { + val intent = Intent(this, MainActivity::class.java) + intent.putExtra("title", binding.songMusicTitleTv.text.toString()) + setResult(RESULT_OK, intent) + finish() + } + + binding.songMiniplayerIv.setOnClickListener { + setPlayerStatus(true) + } + + binding.songPauseIv.setOnClickListener { + setPlayerStatus(false) + } + } + + override fun onPause(){ + super.onPause() + setPlayerStatus(false) + song.second = ((binding.songProgressSb.progress * song.playTime)/100)/1000 + val sharedPreferences = getSharedPreferences("song", MODE_PRIVATE) + val editor = sharedPreferences.edit() // 에디터 + val songJson = gson.toJson(song) + editor.putString("songData",songJson) + editor.apply() + + } + + override fun onDestroy() { + super.onDestroy() + timer.interrupt() + mediaPlayer?.release() //리소스 해제 + mediaPlayer = null // + } + + private fun initPlayList(){ + songDB = SongDatabase.getInstance(this)!! + songs.addAll(songDB.songDao().getSongs()) + } + + private fun initSong(){ + val spf = getSharedPreferences("song", MODE_PRIVATE) + val songId = spf.getInt("songId",0) + + nowPos = getPlayingSongPosition(songId) + + Log.d("now Song ID",songs[nowPos].id.toString()) + + startTimer() + setPlayer(songs[nowPos]) + } + + private fun setPlayer(song: Song) { + binding.songMusicTitleTv.text = song.title + binding.songSingerNameTv.text = song.singer + binding.songStartTimeTv.text = + String.format("%02d:%02d", song.second / 60, song.second % 60) + binding.songEndTimeTv.text = + String.format("%02d:%02d", song.playTime / 60, song.playTime % 60) + binding.songProgressSb.progress = (song.second * 1000) / song.playTime + val music = resources.getIdentifier(song.music, "raw", this.packageName) + mediaPlayer = MediaPlayer.create(this,music) + setPlayerStatus(song.isPlaying) + } + + private fun setPlayerStatus(isPlaying: Boolean) { + song.isPlaying = isPlaying + timer.isPlaying = isPlaying + + if (isPlaying) { + binding.songMiniplayerIv.visibility = View.GONE + binding.songPauseIv.visibility = View.VISIBLE + mediaPlayer?.start() + } else { + binding.songMiniplayerIv.visibility = View.VISIBLE + binding.songPauseIv.visibility = View.GONE + if(mediaPlayer?.isPlaying == true){ + mediaPlayer?.pause() + } + } + } + + private fun startTimer() { + timer = Timer(song.playTime, song.isPlaying) + timer.start() + } + + inner class Timer(private val playTime: Int, var isPlaying: Boolean = true): Thread() { + private var second : Int = 0 + private var mills : Float = 0f + + override fun run() { + try { + while (true) { + if (isPlaying) { + sleep(50) + mills += 50 + runOnUiThread { + binding.songProgressSb.progress = ((mills / playTime) * 100).toInt() + } + + if (mills % 1000 == 0f) { + runOnUiThread { + binding.songStartTimeTv.text = + String.format("%02d:%02d", second / 60, second % 60) + } + second++ + } + } + } + } catch (e: InterruptedException) { + Log.d("Song", "스레드가 죽었습니다. ${e.message}") + } + } + } + + private fun getPlayingSongPosition(songId: Int): Int{ + for (i in 0 until songs.size){ + if (songs[i].id == songId){ + return i + } + } + return 0 + } +} + diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/SongDao.kt b/flo-clone/app/src/main/java/com/example/flo_clone/SongDao.kt new file mode 100644 index 0000000..0eca105 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/SongDao.kt @@ -0,0 +1,26 @@ +package com.example.flo_clone + +import androidx.room.* + +interface SongDao { + @Insert + fun insert(song:Song) + + @Update + fun update(song:Song) + + @Delete + fun delete(song:Song) + + @Query("SELECT * FROM songTable") + fun getSongs(): List + + @Query("SELECT * FROM SongTable WHERE id = :id") + fun getSong(id: Int): Song + + @Query("UPDATE SongTable SET isLike= :isLike WHERE id = :id") + fun updateIsLikeById(isLike: Boolean,id: Int) + + @Query("SELECT * FROM SongTable WHERE isLike= :isLike") + fun getLikedSongs(isLike: Boolean): List +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/SongDatabase.kt b/flo-clone/app/src/main/java/com/example/flo_clone/SongDatabase.kt new file mode 100644 index 0000000..36dd9cc --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/SongDatabase.kt @@ -0,0 +1,30 @@ +package com.example.flo_clone + +import android.content.Context +import androidx.room.* + +@Database(entities = [Song::class], version=1) +abstract class SongDatabase:RoomDatabase() { + abstract fun songDao(): SongDao + + companion object{ + private var instance: SongDatabase?=null + + @Synchronized + fun getInstance(context: Context):SongDatabase?{ + + if(instance == null){ + synchronized(SongDatabase::class){ + instance = Room.databaseBuilder( + context.applicationContext, + SongDatabase::class.java, + "song-database" + + ).allowMainThreadQueries().build() + } + } + + return instance + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/User.kt b/flo-clone/app/src/main/java/com/example/flo_clone/User.kt new file mode 100644 index 0000000..957c731 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/User.kt @@ -0,0 +1,3 @@ +package com.example.flo_clone + +data class User() diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/UserDao.kt b/flo-clone/app/src/main/java/com/example/flo_clone/UserDao.kt new file mode 100644 index 0000000..2d32df0 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/UserDao.kt @@ -0,0 +1,4 @@ +package com.example.flo_clone + +interface UserDao { +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/Album.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/Album.kt new file mode 100644 index 0000000..e9efc8a --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/Album.kt @@ -0,0 +1,10 @@ +package com.example.flo_clone.ui.album + +import com.example.flo_clone.Song + +data class Album( + var title: String? ="", + var Singer: String? ="", + var coverImg: Int? = null, + var songs: ArrayList? = null +) diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumFragment.kt new file mode 100644 index 0000000..688852e --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumFragment.kt @@ -0,0 +1,62 @@ +package com.example.flo_clone.ui.album + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import com.example.flo_clone.MainActivity +import com.example.flo_clone.R +import com.example.flo_clone.databinding.FragmentAlbumBinding +import com.example.flo_clone.ui.home.HomeFragment +import com.google.android.material.tabs.TabLayoutMediator +import com.google.gson.Gson + +class AlbumFragment : Fragment() { + private lateinit var binding: FragmentAlbumBinding + private var gson: Gson = Gson() + + private val tabs = listOf("수록곡", "상세정보", "영상") + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + binding = FragmentAlbumBinding.inflate(inflater, container, false) + + val albumJson = arguments?.getString("album") + val album = gson.fromJson(albumJson,Album::class.java) + setInit(album) + + /*if (arguments != null && arguments?.getString("title") != null && arguments?.getString("singer") != null) { + val title = arguments!!.getString("title") + val singer = arguments!!.getString("singer") + binding.albumMusicTitleTv.text = title + binding.albumSingerNameTv.text = singer + }*/ + + binding.albumBackIv.setOnClickListener { + (context as MainActivity) + .supportFragmentManager + .beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, HomeFragment()) + .commitAllowingStateLoss() + } + + binding.albumContentVp.adapter = AlbumViewPagerAdapter(this) + + TabLayoutMediator(binding.albumContentTb, binding.albumContentVp) { tab, position -> + tab.text = tabs[position] + }.attach() + + return binding.root + } + + private fun setInit(album:Album){ + binding.albumAlbumIv.setImageResource(album.coverImg!!) + binding.albumMusicTitleTv.text = album.title.toString() + binding.albumSingerNameTv.text = album.Singer.toString() + + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumRVAdapter.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumRVAdapter.kt new file mode 100644 index 0000000..02ed416 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumRVAdapter.kt @@ -0,0 +1,59 @@ +package com.example.flo_clone.ui.album + +import android.annotation.SuppressLint +import android.view.LayoutInflater +import android.view.ViewGroup +import android.widget.AdapterView.OnItemClickListener +import androidx.recyclerview.widget.RecyclerView +import com.example.flo_clone.databinding.ItemAlbumBinding + +class AlbumRVAdapter(private val albumList : ArrayList): RecyclerView.Adapter(){ + + interface MyItemClickListener{ + fun onItemClick(album: Album) + fun onRemoveAlbum(position: Int) + } + + private lateinit var mItemClickListener: MyItemClickListener + fun setMyItemClickListener(itemClickListener : MyItemClickListener){ + mItemClickListener = itemClickListener + } + + @SuppressLint("NotifyDataSetChanged") + fun addItem(album:Album){ + albumList.add(album) + notifyDataSetChanged() + } + + @SuppressLint("NotifyDataSetChanged") + fun removeItem(position: Int){ + albumList.removeAt(position) + notifyDataSetChanged() + } + + override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): AlbumRVAdapter.ViewHolder { + val binding: ItemAlbumBinding = ItemAlbumBinding.inflate(LayoutInflater.from(viewGroup.context),viewGroup,false) + + return ViewHolder(binding) + } + + override fun onBindViewHolder(holder: AlbumRVAdapter.ViewHolder, position: Int) { + holder.bind(albumList[position]) + + holder.itemView.setOnClickListener{mItemClickListener.onItemClick(albumList[position]) + holder.binding.textView2.setOnClickListener{mItemClickListener.onRemoveAlbum(position)} + } + } + + override fun getItemCount(): Int = albumList.size + + inner class ViewHolder(var binding: ItemAlbumBinding) : RecyclerView.ViewHolder(binding.root){ + + fun bind(album: Album){ + binding.textView.text = album.title + binding.textView2.text = album.Singer + binding.imageView.setImageResource(album.coverImg!!) + } + + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumViewPagerAdapter.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumViewPagerAdapter.kt new file mode 100644 index 0000000..32c6f26 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/AlbumViewPagerAdapter.kt @@ -0,0 +1,17 @@ +package com.example.flo_clone.ui.album + +import androidx.fragment.app.Fragment +import androidx.viewpager2.adapter.FragmentStateAdapter + +class AlbumViewPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { + override fun getItemCount(): Int = 3 + + override fun createFragment(position: Int): Fragment { + return when (position) { + 0 -> SongFragment() + 1 -> DetailFragment() + 2 -> VideoFragment() + else -> throw IllegalArgumentException("Invalid position") + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/DetailFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/DetailFragment.kt new file mode 100644 index 0000000..fc71782 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/DetailFragment.kt @@ -0,0 +1,29 @@ +package com.example.flo_clone.ui.album + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.example.flo_clone.databinding.FragmentDetailBinding + +class DetailFragment : Fragment() { + private lateinit var binding: FragmentDetailBinding + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val detailViewModel = ViewModelProvider(this)[DetailViewModel::class.java] + + binding = FragmentDetailBinding.inflate(inflater, container, false) + + detailViewModel.text.observe(viewLifecycleOwner) { + binding.detailTv.text = it + } + + return binding.root + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/DetailViewModel.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/DetailViewModel.kt new file mode 100644 index 0000000..524dba1 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/DetailViewModel.kt @@ -0,0 +1,12 @@ +package com.example.flo_clone.ui.album + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class DetailViewModel : ViewModel() { + private val _text = MutableLiveData().apply { + value = "This is detail Fragment" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/SongFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/SongFragment.kt new file mode 100644 index 0000000..75fb32f --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/SongFragment.kt @@ -0,0 +1,45 @@ +package com.example.flo_clone.ui.album + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import androidx.fragment.app.Fragment +import com.example.flo_clone.databinding.FragmentSongBinding + +class SongFragment : Fragment() { + private lateinit var binding: FragmentSongBinding + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + binding = FragmentSongBinding.inflate(inflater, container, false) + + binding.songLalacLayout.setOnClickListener { + Toast.makeText(activity, "LILAC", Toast.LENGTH_SHORT).show() + } + + binding.songMixonTg.setOnClickListener { + setToggleStatus(false) + } + + binding.songMixoffTg.setOnClickListener { + setToggleStatus(true) + } + + return binding.root + } + + private fun setToggleStatus(isOn: Boolean) { + if (isOn) { + binding.songMixonTg.visibility = View.VISIBLE + binding.songMixoffTg.visibility = View.GONE + } else { + binding.songMixonTg.visibility = View.GONE + binding.songMixoffTg.visibility = View.VISIBLE + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/SongRVAdapter.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/SongRVAdapter.kt new file mode 100644 index 0000000..fbfd344 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/SongRVAdapter.kt @@ -0,0 +1,59 @@ +package com.example.flo_clone.ui.album + +import android.annotation.SuppressLint +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.example.flo_clone.databinding.ItemSongBinding +import com.example.flo_clone.Play +import com.example.flo_clone.ui.album.AlbumRVAdapter.MyItemClickListener + +class SongRVAdapter(val playList: ArrayList) : RecyclerView.Adapter() { + + interface MyItemClickListener{ + fun onRemoveSong(position: Int) + } + + private lateinit var mItemClickListener: MyItemClickListener + fun setMyItemClickListener(itemClickListener : MyItemClickListener){ + mItemClickListener = itemClickListener + } + + + inner class ViewHolder(var binding: ItemSongBinding) : RecyclerView.ViewHolder(binding.root){ + + fun bind(playList:Play){ + binding.textView2.text = playList.title + binding.textView.text = playList.singer + binding.imageView.setImageResource(playList.coverImg!!) + } + + } + + + + @SuppressLint("NotifyDataSetChanged") + fun addItem(play:Play){ + playList.add(play) + notifyDataSetChanged() + } + + @SuppressLint("NotifyDataSetChanged") + fun removeItem(position: Int){ + playList.removeAt(position) + notifyDataSetChanged() + } + + override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): SongRVAdapter.ViewHolder { + val binding: ItemSongBinding = ItemSongBinding.inflate(LayoutInflater.from(viewGroup.context),viewGroup,false) + + return ViewHolder(binding) + } + + override fun getItemCount(): Int = playList.size + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + holder.bind(playList[position]) + holder.binding.imageView3.setOnClickListener{mItemClickListener.onRemoveSong(position)} + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/VideoFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/VideoFragment.kt new file mode 100644 index 0000000..2db6744 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/VideoFragment.kt @@ -0,0 +1,29 @@ +package com.example.flo_clone.ui.album + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.example.flo_clone.databinding.FragmentVideoBinding + +class VideoFragment : Fragment() { + private lateinit var binding: FragmentVideoBinding + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val videoViewModel = ViewModelProvider(this)[VideoViewModel::class.java] + + binding = FragmentVideoBinding.inflate(inflater, container, false) + + videoViewModel.text.observe(viewLifecycleOwner) { + binding.videoTv.text = it + } + + return binding.root + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/VideoViewModel.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/VideoViewModel.kt new file mode 100644 index 0000000..832e362 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/album/VideoViewModel.kt @@ -0,0 +1,12 @@ +package com.example.flo_clone.ui.album + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class VideoViewModel : ViewModel() { + private val _text = MutableLiveData().apply { + value = "This is video Fragment" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/BannerFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/BannerFragment.kt new file mode 100644 index 0000000..778a4c8 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/BannerFragment.kt @@ -0,0 +1,25 @@ +package com.example.flo_clone.ui.home + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import com.example.flo_clone.databinding.FragmentBannerBinding + +class BannerFragment(private val imgRes: Int) : Fragment() { + private lateinit var binding: FragmentBannerBinding + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + binding = FragmentBannerBinding.inflate(inflater, container, false) + + binding.bannerImageIv.setImageResource(imgRes) + + return binding.root + } + +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/BannerViewPagerAdapter.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/BannerViewPagerAdapter.kt new file mode 100644 index 0000000..a1a4397 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/BannerViewPagerAdapter.kt @@ -0,0 +1,17 @@ +package com.example.flo_clone.ui.home + +import androidx.fragment.app.Fragment +import androidx.viewpager2.adapter.FragmentStateAdapter + +class BannerViewPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { + private val fragments: ArrayList = ArrayList() + + override fun getItemCount(): Int = fragments.size + + override fun createFragment(position: Int): Fragment = fragments[position] + + fun addFragment(fragment: Fragment) { + fragments.add(fragment) + notifyItemInserted(fragments.size - 1) + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/HomeFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/HomeFragment.kt new file mode 100644 index 0000000..560d060 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/home/HomeFragment.kt @@ -0,0 +1,88 @@ +package com.example.flo_clone.ui.home + +import android.graphics.drawable.ClipDrawable.HORIZONTAL +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.LinearLayoutManager +import com.example.flo_clone.MainActivity +import com.example.flo_clone.R +import com.example.flo_clone.databinding.FragmentHomeBinding +import com.example.flo_clone.ui.album.Album +import com.example.flo_clone.ui.album.AlbumFragment +import com.example.flo_clone.ui.album.AlbumRVAdapter +import com.google.gson.Gson + +class HomeFragment : Fragment() { + + private lateinit var binding: FragmentHomeBinding + private var albumDatas = ArrayList() + + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + binding = FragmentHomeBinding.inflate(inflater, container, false) + + /*/binding.homeAlbumImgIv1.setOnClickListener { + var albumFragment = AlbumFragment() + albumFragment.arguments = Bundle().apply { + putString("title", binding.homeAlbumTitleTv1.text.toString()) + putString("singer", binding.homeAlbumSingerTv1.text.toString()) + } + (context as MainActivity) + .supportFragmentManager + .beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, albumFragment) + .commitAllowingStateLoss() + }*/ + + albumDatas.apply{ + add(Album("Butter","방탄소년단 (BTS)",R.drawable.img_album_exp)) + add(Album("Lilac","아이유 (IU)",R.drawable.img_album_exp2)) + add(Album("Next Level","에스파 (ASEPA)",R.drawable.img_album_exp)) + add(Album("Boy with Luv","방탄소년단 (BTS)",R.drawable.img_album_exp)) + add(Album("BBoom BBoom","모모랜드 (MOMOLAND)",R.drawable.img_album_exp)) + add(Album("Weekend","태연 (Tae Yeon)",R.drawable.img_album_exp)) + } + + val albumRVAdapter = AlbumRVAdapter(albumDatas) + binding.homeTodayMusicAlbumRv.adapter = albumRVAdapter + binding.homeTodayMusicAlbumRv.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL,false) + + albumRVAdapter.setMyItemClickListener(object: AlbumRVAdapter.MyItemClickListener{ + override fun onItemClick(album: Album) { + changeAlbumFragment(album) + } + + override fun onRemoveAlbum(position: Int) { + albumRVAdapter.removeItem(position) + } + }) + + val bannerAdapter = BannerViewPagerAdapter(this) + bannerAdapter.addFragment(BannerFragment(R.drawable.img_home_viewpager_exp)) + bannerAdapter.addFragment(BannerFragment(R.drawable.img_home_viewpager_exp2)) + binding.homeBannerVp.adapter = bannerAdapter + + return binding.root + } + + private fun changeAlbumFragment(album: Album) { + (context as MainActivity) + .supportFragmentManager + .beginTransaction() + .replace(R.id.nav_host_fragment_activity_main, AlbumFragment().apply { + arguments = Bundle().apply { + val gson = Gson() + val albumJson = gson.toJson(album) + putString("album", albumJson) + } + }) + .commitAllowingStateLoss() + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/LockerFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/LockerFragment.kt new file mode 100644 index 0000000..fbb55b2 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/LockerFragment.kt @@ -0,0 +1,57 @@ +package com.example.flo_clone.ui.locker + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.LinearLayoutManager +import com.example.flo_clone.Play +import com.example.flo_clone.R +import com.example.flo_clone.databinding.FragmentLockerBinding +import com.example.flo_clone.ui.album.Album +import com.example.flo_clone.ui.album.AlbumRVAdapter +import com.example.flo_clone.ui.album.SongRVAdapter +import com.google.android.material.tabs.TabLayoutMediator + +class LockerFragment : Fragment() { + private lateinit var binding: FragmentLockerBinding + lateinit var lockerViewPagerAdapter: LockerViewPagerAdapter + private val tabs = listOf("저장한 곡", "음악파일") + private var playDatas = ArrayList() + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + binding = FragmentLockerBinding.inflate(inflater, container, false) + + /*lockerViewPagerAdapter = LockerViewPagerAdapter(requireParentFragment()) + binding.lockerContentVp.adapter = lockerViewPagerAdapter + + TabLayoutMediator(binding.lockerContentTb, binding.lockerContentVp) { tab, position -> + tab.text = tabs[position] + }.attach()*/ + + playDatas.apply{ + add(Play("Butter","방탄소년단 (BTS)", R.drawable.img_album_exp)) + add(Play("Lilac","아이유 (IU)", R.drawable.img_album_exp2)) + add(Play("Next Level","에스파 (ASEPA)", R.drawable.img_album_exp)) + add(Play("Boy with Luv","방탄소년단 (BTS)", R.drawable.img_album_exp)) + add(Play("BBoom BBoom","모모랜드 (MOMOLAND)", R.drawable.img_album_exp)) + add(Play("Weekend","태연 (Tae Yeon)", R.drawable.img_album_exp)) + } + + val songRVAdapter = SongRVAdapter(playDatas) + binding.lockerRv.adapter = songRVAdapter + binding.lockerRv.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) + + + + + + + return binding.root + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/LockerViewPagerAdapter.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/LockerViewPagerAdapter.kt new file mode 100644 index 0000000..09e5e35 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/LockerViewPagerAdapter.kt @@ -0,0 +1,16 @@ +package com.example.flo_clone.ui.locker + +import androidx.fragment.app.Fragment +import androidx.viewpager2.adapter.FragmentStateAdapter + +class LockerViewPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) { + override fun getItemCount(): Int = 2 + + override fun createFragment(position: Int): Fragment { + return when (position) { + 0 -> SavedFragment() + 1 -> MusicFileFragment() + else -> throw IllegalArgumentException("Invalid position") + } + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/MusicFileFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/MusicFileFragment.kt new file mode 100644 index 0000000..d3e7fe9 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/MusicFileFragment.kt @@ -0,0 +1,7 @@ +package com.example.flo_clone.ui.locker + +import androidx.fragment.app.Fragment + +class MusicFileFragment : Fragment() { + +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/SavedFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/SavedFragment.kt new file mode 100644 index 0000000..4f19825 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/locker/SavedFragment.kt @@ -0,0 +1,21 @@ +package com.example.flo_clone.ui.locker + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import com.example.flo_clone.databinding.FragmentSavedBinding + +class SavedFragment : Fragment() { + private lateinit var binding : FragmentSavedBinding + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + binding = FragmentSavedBinding.inflate(inflater, container, false) + return binding.root + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/look/LookFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/look/LookFragment.kt new file mode 100644 index 0000000..7e1f1d2 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/look/LookFragment.kt @@ -0,0 +1,42 @@ +package com.example.flo_clone.ui.look + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.example.flo_clone.databinding.FragmentLookBinding + +class LookFragment : Fragment() { + + private var _binding: FragmentLookBinding? = null + + // This property is only valid between onCreateView and + // onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val lookViewModel = + ViewModelProvider(this)[LookViewModel::class.java] + + _binding = FragmentLookBinding.inflate(inflater, container, false) + val root: View = binding.root + + val textView: TextView = binding.textLook + lookViewModel.text.observe(viewLifecycleOwner) { + textView.text = it + } + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/look/LookViewModel.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/look/LookViewModel.kt new file mode 100644 index 0000000..6899f21 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/look/LookViewModel.kt @@ -0,0 +1,13 @@ +package com.example.flo_clone.ui.look + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class LookViewModel : ViewModel() { + + private val _text = MutableLiveData().apply { + value = "This is look Fragment" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/search/SearchFragment.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/search/SearchFragment.kt new file mode 100644 index 0000000..fe96f64 --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/search/SearchFragment.kt @@ -0,0 +1,42 @@ +package com.example.flo_clone.ui.search + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.example.flo_clone.databinding.FragmentSearchBinding + +class SearchFragment : Fragment() { + + private var _binding: FragmentSearchBinding? = null + + // This property is only valid between onCreateView and + // onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + val searchViewModel = + ViewModelProvider(this)[SearchViewModel::class.java] + + _binding = FragmentSearchBinding.inflate(inflater, container, false) + val root: View = binding.root + + val textView: TextView = binding.textNotifications + searchViewModel.text.observe(viewLifecycleOwner) { + textView.text = it + } + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/flo-clone/app/src/main/java/com/example/flo_clone/ui/search/SearchViewModel.kt b/flo-clone/app/src/main/java/com/example/flo_clone/ui/search/SearchViewModel.kt new file mode 100644 index 0000000..c938fdc --- /dev/null +++ b/flo-clone/app/src/main/java/com/example/flo_clone/ui/search/SearchViewModel.kt @@ -0,0 +1,13 @@ +package com.example.flo_clone.ui.search + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel + +class SearchViewModel : ViewModel() { + + private val _text = MutableLiveData().apply { + value = "This is search Fragment" + } + val text: LiveData = _text +} \ No newline at end of file diff --git a/flo-clone/app/src/main/res/color/flo.xml b/flo-clone/app/src/main/res/color/flo.xml new file mode 100644 index 0000000..8183067 --- /dev/null +++ b/flo-clone/app/src/main/res/color/flo.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/flo-clone/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/flo-clone/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable/btm_color_selector.xml b/flo-clone/app/src/main/res/drawable/btm_color_selector.xml new file mode 100644 index 0000000..3ecf8a7 --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/btm_color_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable/btn_actionbar_close.png b/flo-clone/app/src/main/res/drawable/btn_actionbar_close.png new file mode 100644 index 0000000..b6cc3cc Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_actionbar_close.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_actionbar_instagram.png b/flo-clone/app/src/main/res/drawable/btn_actionbar_instagram.png new file mode 100644 index 0000000..90bc027 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_actionbar_instagram.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_arrow_black.png b/flo-clone/app/src/main/res/drawable/btn_arrow_black.png new file mode 100644 index 0000000..cc38ca8 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_arrow_black.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_input_password.png b/flo-clone/app/src/main/res/drawable/btn_input_password.png new file mode 100644 index 0000000..8c2eb18 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_input_password.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_input_password_off.png b/flo-clone/app/src/main/res/drawable/btn_input_password_off.png new file mode 100644 index 0000000..8234f53 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_input_password_off.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_main_arrow_more.png b/flo-clone/app/src/main/res/drawable/btn_main_arrow_more.png new file mode 100644 index 0000000..59e410c Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_main_arrow_more.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_main_mike.png b/flo-clone/app/src/main/res/drawable/btn_main_mike.png new file mode 100644 index 0000000..9bddec6 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_main_mike.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_main_setting.png b/flo-clone/app/src/main/res/drawable/btn_main_setting.png new file mode 100644 index 0000000..7a8d5d6 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_main_setting.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_main_ticket.png b/flo-clone/app/src/main/res/drawable/btn_main_ticket.png new file mode 100644 index 0000000..52b6d64 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_main_ticket.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplay_mvpause.png b/flo-clone/app/src/main/res/drawable/btn_miniplay_mvpause.png new file mode 100644 index 0000000..470e046 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplay_mvpause.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplay_mvplay.png b/flo-clone/app/src/main/res/drawable/btn_miniplay_mvplay.png new file mode 100644 index 0000000..d118677 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplay_mvplay.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplay_pause.png b/flo-clone/app/src/main/res/drawable/btn_miniplay_pause.png new file mode 100644 index 0000000..470e046 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplay_pause.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplayer_go_list.png b/flo-clone/app/src/main/res/drawable/btn_miniplayer_go_list.png new file mode 100644 index 0000000..1b2d977 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplayer_go_list.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplayer_next.png b/flo-clone/app/src/main/res/drawable/btn_miniplayer_next.png new file mode 100644 index 0000000..3aedba3 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplayer_next.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplayer_play.png b/flo-clone/app/src/main/res/drawable/btn_miniplayer_play.png new file mode 100644 index 0000000..f619072 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplayer_play.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_miniplayer_previous.png b/flo-clone/app/src/main/res/drawable/btn_miniplayer_previous.png new file mode 100644 index 0000000..d0bf1f6 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_miniplayer_previous.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_panel_play_large.png b/flo-clone/app/src/main/res/drawable/btn_panel_play_large.png new file mode 100644 index 0000000..4ac7103 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_panel_play_large.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_eq_off.png b/flo-clone/app/src/main/res/drawable/btn_player_eq_off.png new file mode 100644 index 0000000..f23d9c6 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_eq_off.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_go_list.png b/flo-clone/app/src/main/res/drawable/btn_player_go_list.png new file mode 100644 index 0000000..1b2d977 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_go_list.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_more.png b/flo-clone/app/src/main/res/drawable/btn_player_more.png new file mode 100644 index 0000000..a8ad9e6 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_more.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_play.png b/flo-clone/app/src/main/res/drawable/btn_player_play.png new file mode 100644 index 0000000..f6c3201 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_play.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_related.png b/flo-clone/app/src/main/res/drawable/btn_player_related.png new file mode 100644 index 0000000..9026fe5 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_related.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_setting.png b/flo-clone/app/src/main/res/drawable/btn_player_setting.png new file mode 100644 index 0000000..0df8f69 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_setting.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_unlike_off.png b/flo-clone/app/src/main/res/drawable/btn_player_unlike_off.png new file mode 100644 index 0000000..b539504 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_unlike_off.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_player_unlike_on.png b/flo-clone/app/src/main/res/drawable/btn_player_unlike_on.png new file mode 100644 index 0000000..45a43ca Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_player_unlike_on.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_playlist_select_off.png b/flo-clone/app/src/main/res/drawable/btn_playlist_select_off.png new file mode 100644 index 0000000..62ef45c Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_playlist_select_off.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_playlist_select_on.png b/flo-clone/app/src/main/res/drawable/btn_playlist_select_on.png new file mode 100644 index 0000000..2d3b6af Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_playlist_select_on.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_toggle_off.png b/flo-clone/app/src/main/res/drawable/btn_toggle_off.png new file mode 100644 index 0000000..983360d Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_toggle_off.png differ diff --git a/flo-clone/app/src/main/res/drawable/btn_toggle_on.png b/flo-clone/app/src/main/res/drawable/btn_toggle_on.png new file mode 100644 index 0000000..fb609f4 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/btn_toggle_on.png differ diff --git a/flo-clone/app/src/main/res/drawable/button_background_black_color.xml b/flo-clone/app/src/main/res/drawable/button_background_black_color.xml new file mode 100644 index 0000000..a6b3dae --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/button_background_black_color.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable/button_background_flo_color.xml b/flo-clone/app/src/main/res/drawable/button_background_flo_color.xml new file mode 100644 index 0000000..a6b3dae --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/button_background_flo_color.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable/discovery_banner_aos.jpg b/flo-clone/app/src/main/res/drawable/discovery_banner_aos.jpg new file mode 100644 index 0000000..c905515 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/discovery_banner_aos.jpg differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_home_no_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_home_no_select.png new file mode 100644 index 0000000..69a8ab6 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_home_no_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_home_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_home_select.png new file mode 100644 index 0000000..c0ff48e Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_home_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_locker_no_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_locker_no_select.png new file mode 100644 index 0000000..a67dec3 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_locker_no_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_locker_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_locker_select.png new file mode 100644 index 0000000..042489f Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_locker_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_look_no_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_look_no_select.png new file mode 100644 index 0000000..6c2f4f0 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_look_no_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_look_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_look_select.png new file mode 100644 index 0000000..3d169e4 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_look_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_search_no_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_search_no_select.png new file mode 100644 index 0000000..a77b8c5 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_search_no_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_bottom_search_select.png b/flo-clone/app/src/main/res/drawable/ic_bottom_search_select.png new file mode 100644 index 0000000..d5c8a72 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_bottom_search_select.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_flo_logo.png b/flo-clone/app/src/main/res/drawable/ic_flo_logo.png new file mode 100644 index 0000000..643224d Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_flo_logo.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_launcher_background.xml b/flo-clone/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flo-clone/app/src/main/res/drawable/ic_main_facebook.png b/flo-clone/app/src/main/res/drawable/ic_main_facebook.png new file mode 100644 index 0000000..83e9732 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_main_facebook.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_main_instagram.png b/flo-clone/app/src/main/res/drawable/ic_main_instagram.png new file mode 100644 index 0000000..398ce61 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_main_instagram.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_main_twitter.png b/flo-clone/app/src/main/res/drawable/ic_main_twitter.png new file mode 100644 index 0000000..6ddc68e Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_main_twitter.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_main_youtube.png b/flo-clone/app/src/main/res/drawable/ic_main_youtube.png new file mode 100644 index 0000000..0c4ec93 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_main_youtube.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_my_like_off.png b/flo-clone/app/src/main/res/drawable/ic_my_like_off.png new file mode 100644 index 0000000..c06e139 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_my_like_off.png differ diff --git a/flo-clone/app/src/main/res/drawable/ic_my_like_on.png b/flo-clone/app/src/main/res/drawable/ic_my_like_on.png new file mode 100644 index 0000000..22577c0 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/ic_my_like_on.png differ diff --git a/flo-clone/app/src/main/res/drawable/icon_browse_arrow_right.png b/flo-clone/app/src/main/res/drawable/icon_browse_arrow_right.png new file mode 100644 index 0000000..71b588b Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/icon_browse_arrow_right.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_album_exp.png b/flo-clone/app/src/main/res/drawable/img_album_exp.png new file mode 100644 index 0000000..6e3f38a Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_album_exp.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_album_exp2.png b/flo-clone/app/src/main/res/drawable/img_album_exp2.png new file mode 100644 index 0000000..28ea3ee Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_album_exp2.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_album_lp.png b/flo-clone/app/src/main/res/drawable/img_album_lp.png new file mode 100644 index 0000000..29fb1b4 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_album_lp.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_first_album_default.png b/flo-clone/app/src/main/res/drawable/img_first_album_default.png new file mode 100644 index 0000000..926d34f Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_first_album_default.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_home_viewpager_exp.png b/flo-clone/app/src/main/res/drawable/img_home_viewpager_exp.png new file mode 100644 index 0000000..da78032 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_home_viewpager_exp.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_home_viewpager_exp2.png b/flo-clone/app/src/main/res/drawable/img_home_viewpager_exp2.png new file mode 100644 index 0000000..50fa4be Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_home_viewpager_exp2.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_potcast_exp.png b/flo-clone/app/src/main/res/drawable/img_potcast_exp.png new file mode 100644 index 0000000..50a46e0 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_potcast_exp.png differ diff --git a/flo-clone/app/src/main/res/drawable/img_video_exp.png b/flo-clone/app/src/main/res/drawable/img_video_exp.png new file mode 100644 index 0000000..7f6b05f Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/img_video_exp.png differ diff --git a/flo-clone/app/src/main/res/drawable/kakako_44.png b/flo-clone/app/src/main/res/drawable/kakako_44.png new file mode 100644 index 0000000..243298e Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/kakako_44.png differ diff --git a/flo-clone/app/src/main/res/drawable/naver_44.png b/flo-clone/app/src/main/res/drawable/naver_44.png new file mode 100644 index 0000000..d984487 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/naver_44.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_down.png b/flo-clone/app/src/main/res/drawable/nugu_btn_down.png new file mode 100644 index 0000000..03a04c5 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_down.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_pause_32.png b/flo-clone/app/src/main/res/drawable/nugu_btn_pause_32.png new file mode 100644 index 0000000..9388aa3 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_pause_32.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_play_32.png b/flo-clone/app/src/main/res/drawable/nugu_btn_play_32.png new file mode 100644 index 0000000..b781e4c Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_play_32.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_random_inactive.png b/flo-clone/app/src/main/res/drawable/nugu_btn_random_inactive.png new file mode 100644 index 0000000..fe4f880 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_random_inactive.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_repeat_inactive.png b/flo-clone/app/src/main/res/drawable/nugu_btn_repeat_inactive.png new file mode 100644 index 0000000..1e4044d Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_repeat_inactive.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_skip_next_32.png b/flo-clone/app/src/main/res/drawable/nugu_btn_skip_next_32.png new file mode 100644 index 0000000..fc02f28 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_skip_next_32.png differ diff --git a/flo-clone/app/src/main/res/drawable/nugu_btn_skip_previous_32.png b/flo-clone/app/src/main/res/drawable/nugu_btn_skip_previous_32.png new file mode 100644 index 0000000..03ec854 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/nugu_btn_skip_previous_32.png differ diff --git a/flo-clone/app/src/main/res/drawable/splash.xml b/flo-clone/app/src/main/res/drawable/splash.xml new file mode 100644 index 0000000..ace8a7d --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/splash.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable/textview_background_radius.xml b/flo-clone/app/src/main/res/drawable/textview_background_radius.xml new file mode 100644 index 0000000..2653df9 --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/textview_background_radius.xml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/flo-clone/app/src/main/res/drawable/textview_background_select_color_radius.xml b/flo-clone/app/src/main/res/drawable/textview_background_select_color_radius.xml new file mode 100644 index 0000000..c1ed2ef --- /dev/null +++ b/flo-clone/app/src/main/res/drawable/textview_background_select_color_radius.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/drawable/widget_black_play.png b/flo-clone/app/src/main/res/drawable/widget_black_play.png new file mode 100644 index 0000000..0ec2700 Binary files /dev/null and b/flo-clone/app/src/main/res/drawable/widget_black_play.png differ diff --git a/flo-clone/app/src/main/res/layout/activity_login.xml b/flo-clone/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..65243fb --- /dev/null +++ b/flo-clone/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/activity_main.xml b/flo-clone/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..6e9d1a0 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/activity_sign_up.xml b/flo-clone/app/src/main/res/layout/activity_sign_up.xml new file mode 100644 index 0000000..b5ede55 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/activity_sign_up.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/activity_song.xml b/flo-clone/app/src/main/res/layout/activity_song.xml new file mode 100644 index 0000000..d08509d --- /dev/null +++ b/flo-clone/app/src/main/res/layout/activity_song.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_album.xml b/flo-clone/app/src/main/res/layout/fragment_album.xml new file mode 100644 index 0000000..30f7297 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_album.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_banner.xml b/flo-clone/app/src/main/res/layout/fragment_banner.xml new file mode 100644 index 0000000..cd9d7a4 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_banner.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_detail.xml b/flo-clone/app/src/main/res/layout/fragment_detail.xml new file mode 100644 index 0000000..32915ec --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_detail.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_home.xml b/flo-clone/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..794816a --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,665 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_locker.xml b/flo-clone/app/src/main/res/layout/fragment_locker.xml new file mode 100644 index 0000000..611e118 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_locker.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_locker_savedsong.xml b/flo-clone/app/src/main/res/layout/fragment_locker_savedsong.xml new file mode 100644 index 0000000..333cd5c --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_locker_savedsong.xml @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_look.xml b/flo-clone/app/src/main/res/layout/fragment_look.xml new file mode 100644 index 0000000..01b82ac --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_look.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_saved.xml b/flo-clone/app/src/main/res/layout/fragment_saved.xml new file mode 100644 index 0000000..052fd2a --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_saved.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_search.xml b/flo-clone/app/src/main/res/layout/fragment_search.xml new file mode 100644 index 0000000..6ff9381 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_search.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_song.xml b/flo-clone/app/src/main/res/layout/fragment_song.xml new file mode 100644 index 0000000..136b657 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_song.xml @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/fragment_video.xml b/flo-clone/app/src/main/res/layout/fragment_video.xml new file mode 100644 index 0000000..fadf7d0 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/fragment_video.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/item_album.xml b/flo-clone/app/src/main/res/layout/item_album.xml new file mode 100644 index 0000000..cdc6549 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/item_album.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/layout/item_song.xml b/flo-clone/app/src/main/res/layout/item_song.xml new file mode 100644 index 0000000..1a523c4 --- /dev/null +++ b/flo-clone/app/src/main/res/layout/item_song.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/menu/bottom_nav_menu.xml b/flo-clone/app/src/main/res/menu/bottom_nav_menu.xml new file mode 100644 index 0000000..3e22668 --- /dev/null +++ b/flo-clone/app/src/main/res/menu/bottom_nav_menu.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/flo-clone/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/flo-clone/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/flo-clone/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/flo-clone/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/flo-clone/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/flo-clone/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/flo-clone/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/flo-clone/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/flo-clone/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/flo-clone/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/flo-clone/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/flo-clone/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/flo-clone/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/flo-clone/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/flo-clone/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/flo-clone/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/flo-clone/app/src/main/res/raw/luxery.mp3 b/flo-clone/app/src/main/res/raw/luxery.mp3 new file mode 100644 index 0000000..0846c7d Binary files /dev/null and b/flo-clone/app/src/main/res/raw/luxery.mp3 differ diff --git a/flo-clone/app/src/main/res/values-night/themes.xml b/flo-clone/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..3d7678c --- /dev/null +++ b/flo-clone/app/src/main/res/values-night/themes.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/values/colors.xml b/flo-clone/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..ae144de --- /dev/null +++ b/flo-clone/app/src/main/res/values/colors.xml @@ -0,0 +1,24 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + + #FF000000 + #FFFFFFFF + + + #9cbee2 + #062342 + #424242 + #6bb2ff + + #00ff0000 + #3f3fff + #a8a8a8 + #F9F9F9 + #3f3fff + #a8a8a8 + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/values/dimens.xml b/flo-clone/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..e00c2dd --- /dev/null +++ b/flo-clone/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/values/strings.xml b/flo-clone/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..6de0f3d --- /dev/null +++ b/flo-clone/app/src/main/res/values/strings.xml @@ -0,0 +1,105 @@ + + FLO-clone + + 둘러보기 + 검색 + 보관함 + + 라일락 + 아이유 (IU) + 이전 곡 버튼 + 재생 버튼 + 일시정지 버튼 + 다음 곡 버튼 + 재생목록 버튼 + + 홈 배경 이미지 + 음성 검색 버튼 + 티켓 버튼 + 설정 버튼 + 포근하게 덮어주는 꿈의\n목소리 + 재생 버튼 + 총 36곡 2020.06.05 + 패널 앨범 이미지 + 잠이 안온다 + 젠(zen) + + 오늘 발매 음악 + 더보기 + 종합 + 국내 + 해외 + + 앨범 이미지 + 재생 버튼 + LILAC + 아이유 (IU) + + 매일 들어도 좋은 팟캐스트 + 앨범 이미지 + 재생 버튼 + 제목 + 아티스트 + + 비디오 콜랙션 + 앨범 이미지 + 제목 + 아티스트 + + 배너 이미지 + 페이스북 공유 버튼 + 트위터 공유 버튼 + 인스타그램 공유 버튼 + 유튜브 공유 버튼 + (주)드림어스컴퍼니 사업자 정보 + + 설정 버튼 + 이퀄라이저 버튼 + 창 내리기 버튼 + 더보기 버튼 + 아티스트 더보기 버튼 + 앨범 이미지 + 나라는 꽃가루에 + 눈이 따끔해 아야 + 곡 좋아요 버튼 + 곡 싫어요 버튼 + 00:00 + 01:00 + 곡 반복 버튼 + 곡 랜덤 버튼 + 연관곡 버튼 + + 앨범 좋아요 버튼 + 앨범 더보기 버튼 + 뒤로가기 버튼 + IU 5th Album \'LILAC\' + 2021.03.25 | 정규 | 댄스 팝 + 앨범 이미지 + LP 이미지 + 내 취향 MIX + + 내 취향 MIX OFF 버튼 + 내 취향 MIX ON 버튼 + 전체선택 + 전체 듣기 + 01 + TITLE + 라일락 + 가수 + 02 + Flu + 03 + Coin + 04 + 봄 안녕 봄 + 05 + Celebrity + 06 + 돌림노래 (Feat. DEAN) + + 보관함 + 저장한 곡이 없습니다. + + Hello blank fragment + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/values/themes.xml b/flo-clone/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..a908c58 --- /dev/null +++ b/flo-clone/app/src/main/res/values/themes.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/xml/backup_rules.xml b/flo-clone/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/flo-clone/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/flo-clone/app/src/main/res/xml/data_extraction_rules.xml b/flo-clone/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/flo-clone/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/flo-clone/app/src/test/java/com/example/flo_clone/ExampleUnitTest.kt b/flo-clone/app/src/test/java/com/example/flo_clone/ExampleUnitTest.kt new file mode 100644 index 0000000..5af5d0f --- /dev/null +++ b/flo-clone/app/src/test/java/com/example/flo_clone/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.flo_clone + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/flo-clone/build.gradle.kts b/flo-clone/build.gradle.kts new file mode 100644 index 0000000..922f551 --- /dev/null +++ b/flo-clone/build.gradle.kts @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.kotlin.android) apply false +} \ No newline at end of file diff --git a/flo-clone/gradle.properties b/flo-clone/gradle.properties new file mode 100644 index 0000000..20e2a01 --- /dev/null +++ b/flo-clone/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/flo-clone/gradle/libs.versions.toml b/flo-clone/gradle/libs.versions.toml new file mode 100644 index 0000000..3584c2f --- /dev/null +++ b/flo-clone/gradle/libs.versions.toml @@ -0,0 +1,32 @@ +[versions] +agp = "8.6.1" +kotlin = "1.9.0" +coreKtx = "1.13.1" +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" +appcompat = "1.7.0" +material = "1.12.0" +constraintlayout = "2.1.4" +lifecycleLivedataKtx = "2.8.6" +lifecycleViewmodelKtx = "2.8.6" +navigationFragmentKtx = "2.8.3" +navigationUiKtx = "2.8.3" + +[libraries] +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } +androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" } +androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } +androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" } +androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } + diff --git a/flo-clone/gradle/wrapper/gradle-wrapper.jar b/flo-clone/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/flo-clone/gradle/wrapper/gradle-wrapper.jar differ diff --git a/flo-clone/gradle/wrapper/gradle-wrapper.properties b/flo-clone/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..78acf82 --- /dev/null +++ b/flo-clone/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +#Wed Oct 30 15:52:59 KST 2024 +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/flo-clone/gradlew b/flo-clone/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/flo-clone/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/flo-clone/gradlew.bat b/flo-clone/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/flo-clone/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/flo-clone/settings.gradle.kts b/flo-clone/settings.gradle.kts new file mode 100644 index 0000000..77cefea --- /dev/null +++ b/flo-clone/settings.gradle.kts @@ -0,0 +1,23 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "FLO-clone" +include(":app") diff --git a/week1/.gitignore b/week1/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/week1/.gitignore @@ -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 diff --git a/week1/app/.gitignore b/week1/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/week1/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/week1/app/build.gradle.kts b/week1/app/build.gradle.kts new file mode 100644 index 0000000..d11a7f9 --- /dev/null +++ b/week1/app/build.gradle.kts @@ -0,0 +1,73 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.example.basiclayout" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.basiclayout" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + } + + 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 { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.1" + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.material3) + implementation(libs.androidx.constraintlayout) + implementation(libs.androidx.appcompat) + implementation(libs.material) + implementation(libs.androidx.activity) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.tooling) + debugImplementation(libs.androidx.ui.test.manifest) +} \ No newline at end of file diff --git a/week1/app/proguard-rules.pro b/week1/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/week1/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/week1/app/src/androidTest/java/com/example/basiclayout/ExampleInstrumentedTest.kt b/week1/app/src/androidTest/java/com/example/basiclayout/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..f69132b --- /dev/null +++ b/week1/app/src/androidTest/java/com/example/basiclayout/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.basiclayout + +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.basiclayout", appContext.packageName) + } +} \ No newline at end of file diff --git a/week1/app/src/main/AndroidManifest.xml b/week1/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..451c197 --- /dev/null +++ b/week1/app/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/week1/app/src/main/ic_launcher-playstore.png b/week1/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..73b004e Binary files /dev/null and b/week1/app/src/main/ic_launcher-playstore.png differ diff --git a/week1/app/src/main/java/com/example/basiclayout/MainActivity.kt b/week1/app/src/main/java/com/example/basiclayout/MainActivity.kt new file mode 100644 index 0000000..ba237f2 --- /dev/null +++ b/week1/app/src/main/java/com/example/basiclayout/MainActivity.kt @@ -0,0 +1,33 @@ +package com.example.basiclayout + +import android.content.Intent +import android.os.Bundle +import android.widget.Button +import android.widget.ImageButton +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import com.example.basiclayout.ui.theme.BasicLayoutTheme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + settingButton() + } + + fun settingButton(){ + val button = findViewById(R.id.imageButton6) + button.setOnClickListener { + val intent = Intent(this,SubActivity::class.java) + startActivity(intent) + } + } + } diff --git a/week1/app/src/main/java/com/example/basiclayout/SubActivity.kt b/week1/app/src/main/java/com/example/basiclayout/SubActivity.kt new file mode 100644 index 0000000..1286cb2 --- /dev/null +++ b/week1/app/src/main/java/com/example/basiclayout/SubActivity.kt @@ -0,0 +1,16 @@ +package com.example.basiclayout + +import android.os.Bundle +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat + +class SubActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_sub) + + } + } diff --git a/week1/app/src/main/java/com/example/basiclayout/ui/theme/Color.kt b/week1/app/src/main/java/com/example/basiclayout/ui/theme/Color.kt new file mode 100644 index 0000000..6e68591 --- /dev/null +++ b/week1/app/src/main/java/com/example/basiclayout/ui/theme/Color.kt @@ -0,0 +1,11 @@ +package com.example.basiclayout.ui.theme + +import androidx.compose.ui.graphics.Color + +val Purple80 = Color(0xFFD0BCFF) +val PurpleGrey80 = Color(0xFFCCC2DC) +val Pink80 = Color(0xFFEFB8C8) + +val Purple40 = Color(0xFF6650a4) +val PurpleGrey40 = Color(0xFF625b71) +val Pink40 = Color(0xFF7D5260) \ No newline at end of file diff --git a/week1/app/src/main/java/com/example/basiclayout/ui/theme/Theme.kt b/week1/app/src/main/java/com/example/basiclayout/ui/theme/Theme.kt new file mode 100644 index 0000000..f303d2f --- /dev/null +++ b/week1/app/src/main/java/com/example/basiclayout/ui/theme/Theme.kt @@ -0,0 +1,58 @@ +package com.example.basiclayout.ui.theme + +import android.app.Activity +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalContext + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 + + /* Other default colors to override + background = Color(0xFFFFFBFE), + surface = Color(0xFFFFFBFE), + onPrimary = Color.White, + onSecondary = Color.White, + onTertiary = Color.White, + onBackground = Color(0xFF1C1B1F), + onSurface = Color(0xFF1C1B1F), + */ +) + +@Composable +fun BasicLayoutTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> DarkColorScheme + else -> LightColorScheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} \ No newline at end of file diff --git a/week1/app/src/main/java/com/example/basiclayout/ui/theme/Type.kt b/week1/app/src/main/java/com/example/basiclayout/ui/theme/Type.kt new file mode 100644 index 0000000..12dbd72 --- /dev/null +++ b/week1/app/src/main/java/com/example/basiclayout/ui/theme/Type.kt @@ -0,0 +1,34 @@ +package com.example.basiclayout.ui.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) + /* Other default text styles to override + titleLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp + ), + labelSmall = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 11.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp + ) + */ +) \ No newline at end of file diff --git a/week1/app/src/main/res/drawable/_____2024_09_24_173511.xml b/week1/app/src/main/res/drawable/_____2024_09_24_173511.xml new file mode 100644 index 0000000..20c7a15 --- /dev/null +++ b/week1/app/src/main/res/drawable/_____2024_09_24_173511.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/week1/app/src/main/res/drawable/g462.jpg b/week1/app/src/main/res/drawable/g462.jpg new file mode 100644 index 0000000..460dc77 Binary files /dev/null and b/week1/app/src/main/res/drawable/g462.jpg differ diff --git a/week1/app/src/main/res/drawable/group_462.xml b/week1/app/src/main/res/drawable/group_462.xml new file mode 100644 index 0000000..2faf724 --- /dev/null +++ b/week1/app/src/main/res/drawable/group_462.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/week1/app/src/main/res/drawable/group_462__1_.xml b/week1/app/src/main/res/drawable/group_462__1_.xml new file mode 100644 index 0000000..85b0198 --- /dev/null +++ b/week1/app/src/main/res/drawable/group_462__1_.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/week1/app/src/main/res/drawable/group_462__2_.xml b/week1/app/src/main/res/drawable/group_462__2_.xml new file mode 100644 index 0000000..ede1bbe --- /dev/null +++ b/week1/app/src/main/res/drawable/group_462__2_.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/week1/app/src/main/res/drawable/group_462__3_.xml b/week1/app/src/main/res/drawable/group_462__3_.xml new file mode 100644 index 0000000..e8a2ca9 --- /dev/null +++ b/week1/app/src/main/res/drawable/group_462__3_.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/week1/app/src/main/res/drawable/group_462__4_.xml b/week1/app/src/main/res/drawable/group_462__4_.xml new file mode 100644 index 0000000..5377e99 --- /dev/null +++ b/week1/app/src/main/res/drawable/group_462__4_.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/week1/app/src/main/res/drawable/ic_android_black_24dp.xml b/week1/app/src/main/res/drawable/ic_android_black_24dp.xml new file mode 100644 index 0000000..171b390 --- /dev/null +++ b/week1/app/src/main/res/drawable/ic_android_black_24dp.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/week1/app/src/main/res/drawable/ic_launcher_background.xml b/week1/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..ca3826a --- /dev/null +++ b/week1/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/week1/app/src/main/res/drawable/ic_launcher_foreground.xml b/week1/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/week1/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/week1/app/src/main/res/drawable/paper2.jpg b/week1/app/src/main/res/drawable/paper2.jpg new file mode 100644 index 0000000..aac844c Binary files /dev/null and b/week1/app/src/main/res/drawable/paper2.jpg differ diff --git a/week1/app/src/main/res/layout/activity_main.xml b/week1/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..d4f3315 --- /dev/null +++ b/week1/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/week1/app/src/main/res/layout/activity_sub.xml b/week1/app/src/main/res/layout/activity_sub.xml new file mode 100644 index 0000000..43c107f --- /dev/null +++ b/week1/app/src/main/res/layout/activity_sub.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/week1/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/week1/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/week1/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/week1/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/week1/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/week1/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/week1/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/week1/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..9247274 Binary files /dev/null and b/week1/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/week1/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/week1/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..1a5d6e4 Binary files /dev/null and b/week1/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp differ diff --git a/week1/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/week1/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..ea8a576 Binary files /dev/null and b/week1/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/week1/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/week1/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..abbdc77 Binary files /dev/null and b/week1/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/week1/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/week1/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..2e0c2f5 Binary files /dev/null and b/week1/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp differ diff --git a/week1/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/week1/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..2a917b5 Binary files /dev/null and b/week1/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/week1/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/week1/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..3225372 Binary files /dev/null and b/week1/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/week1/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/week1/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..c4f9b12 Binary files /dev/null and b/week1/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp differ diff --git a/week1/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/week1/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..790004a Binary files /dev/null and b/week1/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..9fb6e5c Binary files /dev/null and b/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..0fb8dc5 Binary files /dev/null and b/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp differ diff --git a/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..327db59 Binary files /dev/null and b/week1/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..c1de595 Binary files /dev/null and b/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..824e5ad Binary files /dev/null and b/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp differ diff --git a/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..c72b6bc Binary files /dev/null and b/week1/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/week1/app/src/main/res/values/colors.xml b/week1/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/week1/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/week1/app/src/main/res/values/strings.xml b/week1/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..1323a73 --- /dev/null +++ b/week1/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + BasicLayout + \ No newline at end of file diff --git a/week1/app/src/main/res/values/themes.xml b/week1/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..f9e9f1f --- /dev/null +++ b/week1/app/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/week10/app/src/main/res/values/colors.xml b/week10/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/week10/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/week10/app/src/main/res/values/strings.xml b/week10/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..4cacd0f --- /dev/null +++ b/week10/app/src/main/res/values/strings.xml @@ -0,0 +1,5 @@ + + My Application + + Hello blank fragment + \ No newline at end of file diff --git a/week10/app/src/main/res/values/themes.xml b/week10/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..d66ac09 --- /dev/null +++ b/week10/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/week2/app/src/main/res/values/colors.xml b/week2/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..0dd18ba --- /dev/null +++ b/week2/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #EDFAFF + #10223E + #1A4249 + #144944 + #164241 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/week2/app/src/main/res/values/dimens.xml b/week2/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..e00c2dd --- /dev/null +++ b/week2/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + \ No newline at end of file diff --git a/week2/app/src/main/res/values/strings.xml b/week2/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..688426e --- /dev/null +++ b/week2/app/src/main/res/values/strings.xml @@ -0,0 +1,9 @@ + + My Application + Home + Dashboard + Mypage + + Hello blank fragment + Calendar + \ No newline at end of file diff --git a/week2/app/src/main/res/values/themes.xml b/week2/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..503477b --- /dev/null +++ b/week2/app/src/main/res/values/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/week2/app/src/main/res/xml/backup_rules.xml b/week2/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/week2/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/week2/app/src/main/res/xml/data_extraction_rules.xml b/week2/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/week2/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/week2/app/src/test/java/com/example/myapplication/ExampleUnitTest.kt b/week2/app/src/test/java/com/example/myapplication/ExampleUnitTest.kt new file mode 100644 index 0000000..e500fb8 --- /dev/null +++ b/week2/app/src/test/java/com/example/myapplication/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.example.myapplication + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/week2/build.gradle.kts b/week2/build.gradle.kts new file mode 100644 index 0000000..922f551 --- /dev/null +++ b/week2/build.gradle.kts @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.kotlin.android) apply false +} \ No newline at end of file diff --git a/week2/gradle.properties b/week2/gradle.properties new file mode 100644 index 0000000..20e2a01 --- /dev/null +++ b/week2/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/week2/gradle/libs.versions.toml b/week2/gradle/libs.versions.toml new file mode 100644 index 0000000..9c7c643 --- /dev/null +++ b/week2/gradle/libs.versions.toml @@ -0,0 +1,34 @@ +[versions] +agp = "8.6.0" +kotlin = "1.9.0" +coreKtx = "1.13.1" +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" +appcompat = "1.7.0" +material = "1.12.0" +constraintlayout = "2.1.4" +lifecycleLivedataKtx = "2.8.6" +lifecycleViewmodelKtx = "2.8.6" +navigationFragmentKtx = "2.8.2" +navigationUiKtx = "2.8.2" +activity = "1.9.2" + +[libraries] +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } +androidx-lifecycle-livedata-ktx = { group = "androidx.lifecycle", name = "lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" } +androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } +androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" } +androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" } +androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } + diff --git a/week2/gradle/wrapper/gradle-wrapper.jar b/week2/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/week2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/week2/gradle/wrapper/gradle-wrapper.properties b/week2/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..8cfd52b --- /dev/null +++ b/week2/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Oct 07 11:57:26 KST 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/week2/gradlew b/week2/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/week2/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/week2/gradlew.bat b/week2/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/week2/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/week2/settings.gradle.kts b/week2/settings.gradle.kts new file mode 100644 index 0000000..7e67774 --- /dev/null +++ b/week2/settings.gradle.kts @@ -0,0 +1,24 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "My Application" +include(":app") + \ No newline at end of file diff --git a/week4/.gitignore b/week4/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/week4/.gitignore @@ -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 diff --git a/week4/app/.gitignore b/week4/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/week4/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/week4/app/build.gradle.kts b/week4/app/build.gradle.kts new file mode 100644 index 0000000..c8e46e0 --- /dev/null +++ b/week4/app/build.gradle.kts @@ -0,0 +1,52 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.example.myapplication" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.myapplication" + minSdk = 24 + targetSdk = 34 + 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" + } + + viewBinding { + enable = true + } +} + +dependencies { + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.appcompat) + implementation(libs.material) + implementation(libs.androidx.activity) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) +} \ No newline at end of file diff --git a/week4/app/proguard-rules.pro b/week4/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/week4/app/proguard-rules.pro @@ -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 \ No newline at end of file diff --git a/week4/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.kt b/week4/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..e9283cf --- /dev/null +++ b/week4/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.myapplication + +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.myapplication", appContext.packageName) + } +} \ No newline at end of file diff --git a/week4/app/src/main/AndroidManifest.xml b/week4/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..eb47d4a --- /dev/null +++ b/week4/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/week4/app/src/main/java/com/example/myapplication/MainActivity.kt b/week4/app/src/main/java/com/example/myapplication/MainActivity.kt new file mode 100644 index 0000000..f512cad --- /dev/null +++ b/week4/app/src/main/java/com/example/myapplication/MainActivity.kt @@ -0,0 +1,77 @@ +package com.example.myapplication + +import android.os.Bundle +import android.widget.Button +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat +import android.widget.TextView +import com.example.myapplication.databinding.ActivityMainBinding + +class MainActivity : AppCompatActivity() { + + private lateinit var binding: ActivityMainBinding + + var total = 0 + var started = false + + override fun onCreate(savedInstanceState: Bundle?) { + + super.onCreate(savedInstanceState) + + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) + + binding.buttonStart.setOnClickListener { + start() + } + + binding.buttonPause.setOnClickListener { + pause() + } + + binding.buttonStop.setOnClickListener { + stop() + } + + + } + + + fun start(){ + started = true + val thread = Thread{ + while(true){ + Thread.sleep(1000) + if(!started) break + total = total + 1 + runOnUiThread { + binding.textTimer.text = formatTime(total) + } + + } + + } + thread.start() + } + + fun pause(){ + started = false + + } + + fun stop(){ + started = false + total =0 + binding.textTimer.text = formatTime(total) + + } + + fun formatTime(time:Int):String{ + val minute = String.format("%02d", time/60) + val second = String.format("%02d",time%60) + return "$minute : $second" + + } +} \ No newline at end of file diff --git a/week4/app/src/main/res/drawable/ic_launcher_background.xml b/week4/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/week4/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/week4/app/src/main/res/drawable/ic_launcher_foreground.xml b/week4/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/week4/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/week4/app/src/main/res/layout/activity_main.xml b/week4/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..01a8dd2 --- /dev/null +++ b/week4/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,51 @@ + + + + + +