Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
dcbb274
feat : 2주차 미션
keypang Oct 6, 2024
cac6f7e
chore : 각각의 fragment 이름에 fragment 추가
keypang Oct 12, 2024
6b8d1db
feat : 3주차 미션: 유데미 1주차 홈화면 레이아웃
keypang Oct 12, 2024
d3208e8
feat : 3주차 미션: 유데미 2주차 실습
keypang Oct 13, 2024
4325166
feat : 3주차 미션 Activity 전환
keypang Oct 13, 2024
0a7480e
feat : 3주차 미션 banner ViewPager 구현
keypang Oct 13, 2024
480837b
feat : 3주차 미션 Fragment 전환 구현하기
keypang Oct 13, 2024
fc52080
feat : 3주차 미션 반복, 전체 재생 버튼 교체
keypang Oct 27, 2024
bb6466f
feat : 3주차 미션 내 취한 MIX 버튼 변경
keypang Oct 27, 2024
29efab3
feat : 3주차 미션 Viewpager 구현하기
keypang Oct 27, 2024
651206c
feat : 3주차 미션 viewPager2와CircleIndicator 연결
keypang Oct 27, 2024
54562b4
feat : 3주차 미션 일정 시간마다 자동으로 배너 넘기기
keypang Oct 27, 2024
5cb1377
feat : 3주차 미션 Locker에 Tab, Viewpager 구현
keypang Oct 27, 2024
f640573
feat : 4주차 미션 유데미, 타이머
keypang Nov 2, 2024
1c56a47
feat: 5주차 유데미
keypang Nov 3, 2024
3f33714
feat : 6주차 유데미
keypang Nov 6, 2024
d164c9c
feat : 5주차 미션 Thread 재시작
keypang Nov 7, 2024
c4e6ba7
feat: 5주차 생명주기 메모장
keypang Nov 10, 2024
84f72d9
feat: 6주차 리사이클러 뷰 만들기, / ...버튼 클릭 이벤트
keypang Nov 18, 2024
456033e
feat: 6주차 미니플레이어 동기화
keypang Nov 18, 2024
de6a4fe
feat: 6주차 스위치 on/off 연결
keypang Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Paulo/Flo_Clone_UMC_Bottom/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ plugins {
}

android {
namespace = "com.example.umc_paulo_mission1_2"
namespace = "com.example.flo_clone_umc_bottom"
compileSdk = 34

buildFeatures {
dataBinding = true
viewBinding {
enable = true
}
}

defaultConfig {
applicationId = "com.example.umc_paulo_mission1_2"
minSdk = 24
applicationId = "com.example.flo_clone_umc_bottom"
minSdk = 28
targetSdk = 34
versionCode = 1
versionName = "1.0"
Expand Down Expand Up @@ -42,7 +49,12 @@ dependencies {
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
implementation(libs.car.ui.lib)
implementation("me.relex:circleindicator:2.1.6")
implementation("com.google.code.gson:gson:2.8.7")
//implementation("me.relex:circleindicator2:2.1.6")
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.umc_paulo_mission1_2
package com.example.flo_clone_umc_bottom

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.umc_paulo_mission1_2", appContext.packageName)
assertEquals("com.example.flo_clone_umc_bottom", appContext.packageName)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools" >

<application
android:allowBackup="true"
Expand All @@ -10,17 +10,21 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.UMC_Paulo_Mission1_2"
tools:targetApi="31">
android:theme="@style/Theme.Flo_Clone_UMC_Bottom"
tools:targetApi="31" >
<activity
android:name=".MainActivity"
android:exported="true">
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SongActivity"
android:exported="true" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.flo_clone_umc_bottom

import java.util.ArrayList

data class Album(
var title: String? = "",
var singer: String? = "",
var coverImg: Int? = null,
var songs: ArrayList<Song>? = null
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.example.flo_clone_umc_bottom

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TableLayout
import android.widget.Toast
import androidx.fragment.app.Fragment
import com.example.flo_clone_umc_bottom.databinding.FragmentAlbumBinding
import com.google.android.material.tabs.TabLayoutMediator
import com.google.gson.Gson

class AlbumFragment : Fragment() {
lateinit var binding : FragmentAlbumBinding
private var information = arrayListOf("수록곡","상세정보","영상")
private var gson: Gson = Gson()

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)

binding.albumBackIv.setOnClickListener {
(context as MainActivity).supportFragmentManager.beginTransaction().replace(R.id.main_frm,HomeFragment()).commitAllowingStateLoss()
}

// val albumTitle = arguments?.getString("ALBUM_TITLE")
// val albumArtist = arguments?.getString("ALBUM_ARTIST")
// val albumImageResId = arguments?.getInt("ALBUM_IMAGE")

val albumAdapter = AlbumVPAdapter(this, album.title, album.singer)
binding.albumContentVp.adapter = albumAdapter
TabLayoutMediator(binding.albumContentTb, binding.albumContentVp){
tab, position ->
tab.text = information[position]
}.attach()

// binding.albumMusicTitleTv.text = album.title ?: "Unknown Album"
// binding.albumSingerNameTv.text = album.singer ?: "Unknown Artist"
// albumImageResId?.let { binding.albumAlbumIv.setImageResource(it) }
//
val formattedTitle = String.format("%s 5th Album '%s'", album.singer,album.title)
binding.albumMusicTitleTv.text = formattedTitle
return binding.root
}

private fun setInit(album: Album){
binding.albumAlbumIv.setImageResource(album.coverImg!!)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.example.flo_clone_umc_bottom

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.example.flo_clone_umc_bottom.databinding.ItemAlbumBinding

class AlbumRVAdapter(private val albumList: ArrayList<Album>): RecyclerView.Adapter<AlbumRVAdapter.ViewHolder>() {
interface MyItemClickListener{
fun onItemClick(album: Album)
fun onRemoveAlbum(position: Int)
fun onIntentAlbum(album: Album)
}

private lateinit var mItemClickListener: MyItemClickListener
fun setMyItemClickListener(itemClickListener: MyItemClickListener){
mItemClickListener = itemClickListener
}

fun addItem(album: Album){
albumList.add(album)
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.itemAlbumTitleTv.setOnClickListener{
mItemClickListener.onRemoveAlbum(position)
}
holder.binding.itemAlbumPlayImgIv.setOnClickListener {
mItemClickListener.onIntentAlbum(albumList[position])
}
//6주차 정보 전달
}

override fun getItemCount(): Int = albumList.size

inner class ViewHolder(val binding: ItemAlbumBinding): RecyclerView.ViewHolder(binding.root){

fun bind(album: Album){
binding.itemAlbumTitleTv.text = album.title
binding.itemAlbumSingerTv.text = album.title
binding.itemAlbumCoverImgIv.setImageResource(album.coverImg!!)
}
}
//6주차 AlbumRVAdapter 확인 전
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.example.flo_clone_umc_bottom

import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter

class AlbumVPAdapter(fragment: Fragment, private val albumTitle: String?,
private val albumArtist: String?):FragmentStateAdapter(fragment) {
override fun getItemCount(): Int = 3
override fun createFragment(position: Int): Fragment {
val fragment = when (position) {
0 -> SongFragment()
1 -> DetailFragment()
else -> VideoFragment()
}
if (fragment is SongFragment) {
val bundle = Bundle().apply {
putString("ALBUM_TITLE", albumTitle)
putString("ALBUM_ARTIST", albumArtist)
}
fragment.arguments = bundle
}
return fragment
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.flo_clone_umc_bottom

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_umc_bottom.databinding.FragmentBannerBinding

class BannerFragment(val imgRes : Int) : Fragment() {
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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.example.flo_clone_umc_bottom

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter

class BannerVPAdapter(fragment: Fragment) :FragmentStateAdapter(fragment) {

private val fragmentlist : ArrayList<Fragment> = ArrayList()

override fun getItemCount(): Int = fragmentlist.size

override fun createFragment(position: Int): Fragment = fragmentlist[position]

fun addFragment(fragment: Fragment){
fragmentlist.add(fragment)
notifyItemInserted(fragmentlist.size-1)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.example.flo_clone_umc_bottom

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_umc_bottom.databinding.FragmentDetailBinding

class DetailFragment : Fragment() {

lateinit var binding: FragmentDetailBinding

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = FragmentDetailBinding.inflate(inflater,container,false)
return binding.root
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.example.flo_clone_umc_bottom

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter

class HomeBannerVPAdapter(fragment: Fragment) :FragmentStateAdapter(fragment){

private val fragmentlist : ArrayList<Fragment> = ArrayList()

override fun getItemCount(): Int = fragmentlist.size

override fun createFragment(position: Int): Fragment = fragmentlist[position]

fun addFragment(fragment: Fragment){
fragmentlist.add(fragment)
notifyItemInserted(fragmentlist.size-1)
}
}
Loading