-
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.
[kara/#33] fix : Miniplayer 동기화,Album Data,seekbar 수정
- Loading branch information
1 parent
7668960
commit 526de30
Showing
10 changed files
with
148 additions
and
46 deletions.
There are no files selected for viewing
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
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,6 @@ | ||
package com.example.myfirstapp | ||
|
||
object Constant { | ||
const val CHANNEL_ID = "ch123" | ||
const val MUSIC_NOTIFICATION_ID = 123 | ||
} |
49 changes: 49 additions & 0 deletions
49
UMC_6th/app/src/main/java/com/example/myfirstapp/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.myfirstapp | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import androidx.core.content.ContextCompat | ||
import androidx.databinding.DataBindingUtil | ||
import com.example.myfirstapp.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) | ||
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
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,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape | ||
android:shape="rectangle"> | ||
|
||
<solid | ||
android:color="@color/colorPrimaryGrey"/> | ||
|
||
<corners | ||
android:radius="5dp"/> | ||
|
||
</shape> | ||
|
||
</item> | ||
|
||
</selector> |
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,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="300dp" | ||
android:layout_height="wrap_content" | ||
android:paddingStart="15dp" | ||
android:paddingEnd="15dp" | ||
android:background="@drawable/custom_snackbar_bg"> | ||
|
||
<TextView | ||
android:id="@+id/custom_snackbar_tv" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Custom SnackBar!" | ||
android:layout_marginRight="20dp" | ||
android:padding="10dp" | ||
android:textColor="@android:color/white" | ||
android:textSize="17sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/custom_snackbar_btn" | ||
android:layout_width="70dp" | ||
android:layout_height="40dp" | ||
android:text="OK" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |