-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [maro/#28] feat :: RecyclerView item * [maro/#28] feat && fix :: 앨범 상세 정보 개발 && 앱 꺼짐 에러 수정 * [maro/#28] feat :: 보관함 개발 * [maro/#28] feat && fix :: 보관함 switch on/off 에러 해결 && 삭제 기능 추가 * [maro/#28] feat :: 선택 앨범 정보로 변경 실패 * [maro/#28] feat :: 파일 추가 * [maro/#28] fix :: onPlayAlbum 에러 수정 * [maro/#28] fix :: 6주차 구현 완료
- Loading branch information
1 parent
82f6178
commit b7fa9e7
Showing
21 changed files
with
713 additions
and
337 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.example.umc_6th | ||
|
||
data class Album( | ||
var title : String? = "", | ||
var singer : String? = "", | ||
var coverImage : Int? = null, | ||
var songs: ArrayList<Song>? = null // 앨범 수록곡 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
UMC_6th/app/src/main/java/com/example/umc_6th/AlbumRVAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.example.umc_6th | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.example.umc_6th.databinding.ItemAlbumBinding | ||
|
||
class AlbumRVAdapter(private val albumList: ArrayList<Album>) : RecyclerView.Adapter<AlbumRVAdapter.ViewHolder>(){ | ||
inner class ViewHolder(val binding: ItemAlbumBinding): RecyclerView.ViewHolder(binding.root){ | ||
fun bind(album: Album){ | ||
binding.itemAlbumTitleTv.text = album.title | ||
binding.itemAlbumSingerTv.text = album.singer | ||
binding.itemAlbumCoverImgIv.setImageResource(album.coverImage!!) | ||
} | ||
} | ||
|
||
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 { | ||
itemClickListener.onItemClick(albumList[position]) | ||
} | ||
|
||
holder.binding.itemAlbumPlayImgIv.setOnClickListener{ | ||
itemClickListener.onPlayAlbum(albumList[position]) | ||
} | ||
} | ||
|
||
override fun getItemCount(): Int = albumList.size | ||
|
||
interface OnItemClickListener { | ||
fun onItemClick(album : Album) | ||
fun onPlayAlbum(album: Album) | ||
} | ||
|
||
private lateinit var itemClickListener : OnItemClickListener | ||
|
||
fun setItemClickListener(onItemClickListener: OnItemClickListener) { | ||
this.itemClickListener = onItemClickListener | ||
} | ||
|
||
|
||
} |
5 changes: 5 additions & 0 deletions
5
UMC_6th/app/src/main/java/com/example/umc_6th/CommunicationInterface.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.example.umc_6th | ||
|
||
interface CommunicationInterface { | ||
fun sendData(album : Album) | ||
} |
Oops, something went wrong.