-
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.
* [simba/#33] feat:: Song 데이터 베이스 활용하기 (last song Toast 메시지 오류) * [simba/#33] feat:: 좋아요 기능 구현 * [simba/#33] feat:: 보관함 recyclerview로 구현, 좋아요 누른 노래만 보관함으로 이동, 더보기 클릭 시 아이템 영구 삭제 * [simba/#33] feat:: MiniPlayer Seekbar 재생 시간과 동기화 * [simba/#33] feat:: Album 데이터베이스 구축하기 * [simba/#33] feat:: Bottom Sheet Dialog 구현 * [simba/#33] feat:: Bottom Sheet Dialog 구현
- Loading branch information
Showing
32 changed files
with
776 additions
and
606 deletions.
There are no files selected for viewing
314 changes: 0 additions & 314 deletions
314
...dea/shelf/Uncommitted_changes_before_Checkout_at_5_18_24,_7_44 PM_[Changes]/shelved.patch
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
UMC_6th/.idea/shelf/Uncommitted_changes_before_Checkout_at_5_18_24__7_44PM__Changes_.xml
This file was deleted.
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package com.example.umc_6th | ||
|
||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
import java.util.ArrayList | ||
|
||
@Entity(tableName = "AlbumTable") | ||
data class Album( | ||
@PrimaryKey(autoGenerate = false) var id: Int = 0, | ||
var title: String? = "", | ||
var singer: String? = "", | ||
var coverImg: Int? = null, | ||
var songs: ArrayList<Song>? = null | ||
var coverImg: Int? = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.umc_6th | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Delete | ||
import androidx.room.Insert | ||
import androidx.room.Query | ||
import androidx.room.Update | ||
|
||
@Dao | ||
interface AlbumDao { | ||
@Insert | ||
fun insert(album: Album) | ||
|
||
@Update | ||
fun update(album: Album) | ||
|
||
@Delete | ||
fun delete(album: Album) | ||
|
||
@Query("SELECT * FROM AlbumTable") | ||
fun getAlbums(): List<Album> | ||
|
||
@Query("SELECT * FROM AlbumTable WHERE id = :id") | ||
fun getAlbum(id : Int): Album | ||
|
||
} |
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
45 changes: 45 additions & 0 deletions
45
UMC_6th/app/src/main/java/com/example/umc_6th/BottomSheetFragment.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,45 @@ | ||
package com.example.umc_6th | ||
|
||
import android.annotation.SuppressLint | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.Toast | ||
import com.example.umc_6th.databinding.FragmentBottomSheetBinding | ||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment | ||
|
||
class BottomSheetFragment : BottomSheetDialogFragment() { | ||
|
||
lateinit var binding: FragmentBottomSheetBinding | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
binding = FragmentBottomSheetBinding.inflate(inflater,container,false) | ||
return binding.root | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
binding.bottomSheetIv1.setOnClickListener { | ||
Toast.makeText(requireActivity(),"듣기 버튼 클릭",Toast.LENGTH_SHORT).show() | ||
} | ||
binding.bottomSheetIv2.setOnClickListener { | ||
Toast.makeText(requireActivity(),"재생목록 버튼 클릭",Toast.LENGTH_SHORT).show() | ||
} | ||
binding.bottomSheetIv3.setOnClickListener { | ||
Toast.makeText(requireActivity(),"내 리스트 버튼 클릭",Toast.LENGTH_SHORT).show() | ||
} | ||
binding.bottomSheetIv4.setOnClickListener { | ||
Toast.makeText(requireActivity(),"삭제 버튼 클릭",Toast.LENGTH_SHORT).show() | ||
} | ||
binding.bottomSheetTv4.setOnClickListener { | ||
|
||
} | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
UMC_6th/app/src/main/java/com/example/umc_6th/CustomSnackbar.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,49 @@ | ||
package com.example.umc_6th | ||
|
||
import android.annotation.SuppressLint | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import androidx.core.content.ContextCompat | ||
import androidx.databinding.DataBindingUtil | ||
import com.example.umc_6th.databinding.CustomSnackbarBinding | ||
import com.google.android.material.snackbar.Snackbar | ||
|
||
class CustomSnackbar(view: View, private val message: String) { | ||
companion object{ | ||
fun make(view: View, message: String) = CustomSnackbar(view, message) | ||
} | ||
|
||
private val context = view.context | ||
private val snackbar = Snackbar.make(view,"",5000) | ||
@SuppressLint("RestrictedApi") | ||
private val snackbarLayout = snackbar.view as Snackbar.SnackbarLayout | ||
|
||
|
||
private val inflater = LayoutInflater.from(context) | ||
private val snackbarBinding: CustomSnackbarBinding = DataBindingUtil.inflate(inflater,R.layout.custom_snackbar, null, false) | ||
|
||
init { | ||
initView() | ||
initData() | ||
} | ||
|
||
private fun initView() { | ||
with(snackbarLayout) { | ||
removeAllViews() | ||
setPadding(0, 0, 0, 0) | ||
setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent)) | ||
addView(snackbarBinding.root, 0) | ||
} | ||
} | ||
|
||
private fun initData() { | ||
snackbarBinding.customSnackbarTv.text = message | ||
snackbarBinding.customSnackbarBtn.setOnClickListener { | ||
// OK 버튼을 클릭했을 때 실행할 동작을 정의할 수 있다. | ||
} | ||
} | ||
|
||
fun show() { | ||
snackbar.show() | ||
} | ||
} |
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
Oops, something went wrong.