parent
eeac702cd7
commit
d67bb8be50
|
@ -1,6 +1,7 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content
|
package kr.co.vividnext.sodalive.audio_content
|
||||||
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import coil.load
|
import coil.load
|
||||||
|
@ -33,6 +34,12 @@ class AudioContentAdapter(
|
||||||
binding.tvLikeCount.text = item.likeCount.moneyFormat()
|
binding.tvLikeCount.text = item.likeCount.moneyFormat()
|
||||||
binding.tvCommentCount.text = item.commentCount.moneyFormat()
|
binding.tvCommentCount.text = item.commentCount.moneyFormat()
|
||||||
|
|
||||||
|
binding.tvScheduledToOpen.visibility = if (item.isScheduledToOpen) {
|
||||||
|
View.VISIBLE
|
||||||
|
} else {
|
||||||
|
View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
if (item.price < 1) {
|
if (item.price < 1) {
|
||||||
binding.tvPrice.text = "무료"
|
binding.tvPrice.text = "무료"
|
||||||
binding.tvPrice.setCompoundDrawables(null, null, null, null)
|
binding.tvPrice.setCompoundDrawables(null, null, null, null)
|
||||||
|
|
|
@ -14,6 +14,7 @@ import android.widget.RelativeLayout
|
||||||
import android.widget.SeekBar
|
import android.widget.SeekBar
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import androidx.appcompat.widget.PopupMenu
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import coil.load
|
import coil.load
|
||||||
|
@ -497,14 +498,30 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupPurchaseButton(response: GetAudioContentDetailResponse) {
|
private fun setupPurchaseButton(response: GetAudioContentDetailResponse) {
|
||||||
if (
|
if (response.releaseDate != null) {
|
||||||
|
binding.llPurchase.visibility = View.VISIBLE
|
||||||
|
binding.llPurchasePrice.visibility = View.GONE
|
||||||
|
binding.tvReleaseDate.visibility = View.VISIBLE
|
||||||
|
binding.llPurchase.background = ContextCompat.getDrawable(
|
||||||
|
applicationContext,
|
||||||
|
R.drawable.bg_round_corner_5_3_525252
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.tvReleaseDate.text = response.releaseDate
|
||||||
|
} else if (
|
||||||
response.price > 0 &&
|
response.price > 0 &&
|
||||||
!response.existOrdered &&
|
!response.existOrdered &&
|
||||||
response.orderType == null &&
|
response.orderType == null &&
|
||||||
response.creator.creatorId != SharedPreferenceManager.userId
|
response.creator.creatorId != SharedPreferenceManager.userId
|
||||||
) {
|
) {
|
||||||
|
binding.tvReleaseDate.visibility = View.GONE
|
||||||
binding.llPurchase.visibility = View.VISIBLE
|
binding.llPurchase.visibility = View.VISIBLE
|
||||||
|
binding.llPurchasePrice.visibility = View.VISIBLE
|
||||||
binding.tvPrice.text = response.price.toString()
|
binding.tvPrice.text = response.price.toString()
|
||||||
|
binding.llPurchase.background = ContextCompat.getDrawable(
|
||||||
|
applicationContext,
|
||||||
|
R.drawable.bg_round_corner_5_3_3bb9f1
|
||||||
|
)
|
||||||
|
|
||||||
binding.tvStrPurchaseOrRental.text = if (response.isOnlyRental) {
|
binding.tvStrPurchaseOrRental.text = if (response.isOnlyRental) {
|
||||||
" 대여하기"
|
" 대여하기"
|
||||||
|
@ -530,22 +547,33 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||||
.apply(RequestOptions().override((screenWidth - 13.3f.dpToPx()).toInt()))
|
.apply(RequestOptions().override((screenWidth - 13.3f.dpToPx()).toInt()))
|
||||||
.into(binding.ivCover)
|
.into(binding.ivCover)
|
||||||
|
|
||||||
binding.ivPlayOrPause.setOnClickListener {
|
if (response.releaseDate == null) {
|
||||||
startService(
|
binding.ivPlayOrPause.visibility = View.VISIBLE
|
||||||
Intent(this, AudioContentPlayService::class.java).apply {
|
binding.ivPlayOrPause.setOnClickListener {
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_COVER_IMAGE_URL, response.coverImageUrl)
|
startService(
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_URL, response.contentUrl)
|
Intent(this, AudioContentPlayService::class.java).apply {
|
||||||
putExtra(Constants.EXTRA_NICKNAME, response.creator.nickname)
|
putExtra(
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_TITLE, response.title)
|
Constants.EXTRA_AUDIO_CONTENT_COVER_IMAGE_URL,
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, response.contentId)
|
response.coverImageUrl
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_CREATOR_ID, response.creator.creatorId)
|
)
|
||||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_FREE, response.price <= 0)
|
putExtra(Constants.EXTRA_AUDIO_CONTENT_URL, response.contentUrl)
|
||||||
putExtra(
|
putExtra(Constants.EXTRA_NICKNAME, response.creator.nickname)
|
||||||
Constants.EXTRA_AUDIO_CONTENT_PREVIEW,
|
putExtra(Constants.EXTRA_AUDIO_CONTENT_TITLE, response.title)
|
||||||
!response.existOrdered && response.price > 0
|
putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, response.contentId)
|
||||||
)
|
putExtra(
|
||||||
}
|
Constants.EXTRA_AUDIO_CONTENT_CREATOR_ID,
|
||||||
)
|
response.creator.creatorId
|
||||||
|
)
|
||||||
|
putExtra(Constants.EXTRA_AUDIO_CONTENT_FREE, response.price <= 0)
|
||||||
|
putExtra(
|
||||||
|
Constants.EXTRA_AUDIO_CONTENT_PREVIEW,
|
||||||
|
!response.existOrdered && response.price > 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
binding.ivPlayOrPause.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.tvTotalDuration.text = " / ${response.duration}"
|
binding.tvTotalDuration.text = " / ${response.duration}"
|
||||||
|
@ -553,6 +581,11 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
private fun setupInfoArea(response: GetAudioContentDetailResponse) {
|
private fun setupInfoArea(response: GetAudioContentDetailResponse) {
|
||||||
|
binding.tvScheduledToOpen.visibility = if (response.releaseDate != null) {
|
||||||
|
View.VISIBLE
|
||||||
|
} else {
|
||||||
|
View.GONE
|
||||||
|
}
|
||||||
binding.tvTheme.text = response.themeStr
|
binding.tvTheme.text = response.themeStr
|
||||||
binding.tv19.visibility = if (response.isAdult) {
|
binding.tv19.visibility = if (response.isAdult) {
|
||||||
View.VISIBLE
|
View.VISIBLE
|
||||||
|
|
|
@ -14,6 +14,7 @@ data class GetAudioContentDetailResponse(
|
||||||
@SerializedName("tag") val tag: String,
|
@SerializedName("tag") val tag: String,
|
||||||
@SerializedName("price") val price: Int,
|
@SerializedName("price") val price: Int,
|
||||||
@SerializedName("duration") val duration: String,
|
@SerializedName("duration") val duration: String,
|
||||||
|
@SerializedName("releaseDate") val releaseDate: String?,
|
||||||
@SerializedName("isAdult") val isAdult: Boolean,
|
@SerializedName("isAdult") val isAdult: Boolean,
|
||||||
@SerializedName("isMosaic") val isMosaic: Boolean,
|
@SerializedName("isMosaic") val isMosaic: Boolean,
|
||||||
@SerializedName("isOnlyRental") val isOnlyRental: Boolean,
|
@SerializedName("isOnlyRental") val isOnlyRental: Boolean,
|
||||||
|
|
|
@ -76,7 +76,8 @@ data class GetAudioContentListItem(
|
||||||
@SerializedName("duration") val duration: String?,
|
@SerializedName("duration") val duration: String?,
|
||||||
@SerializedName("likeCount") val likeCount: Int,
|
@SerializedName("likeCount") val likeCount: Int,
|
||||||
@SerializedName("commentCount") val commentCount: Int,
|
@SerializedName("commentCount") val commentCount: Int,
|
||||||
@SerializedName("isAdult") val isAdult: Boolean
|
@SerializedName("isAdult") val isAdult: Boolean,
|
||||||
|
@SerializedName("isScheduledToOpen") val isScheduledToOpen: Boolean
|
||||||
)
|
)
|
||||||
|
|
||||||
data class GetCreatorActivitySummary(
|
data class GetCreatorActivitySummary(
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/color_003851" />
|
||||||
|
<corners android:radius="2.6dp" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/color_003851" />
|
||||||
|
</shape>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/color_3bb9f1" />
|
||||||
|
<corners android:radius="5.3dp" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/color_3bb9f1" />
|
||||||
|
</shape>
|
|
@ -115,6 +115,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
|
android:visibility="gone"
|
||||||
tools:src="@drawable/btn_audio_content_play" />
|
tools:src="@drawable/btn_audio_content_play" />
|
||||||
|
|
||||||
<SeekBar
|
<SeekBar
|
||||||
|
@ -174,28 +175,44 @@
|
||||||
android:layout_marginHorizontal="13.3dp"
|
android:layout_marginHorizontal="13.3dp"
|
||||||
android:layout_marginTop="13.3dp">
|
android:layout_marginTop="13.3dp">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/tv_theme"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:background="@drawable/bg_round_corner_2_6_28312b"
|
|
||||||
android:paddingHorizontal="5.3dp"
|
|
||||||
android:paddingVertical="3.3dp"
|
|
||||||
android:textColor="@color/color_3bac6a"
|
|
||||||
tools:text="커버곡" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_19"
|
android:id="@+id/tv_scheduled_to_open"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5.3dp"
|
android:layout_marginEnd="5.3dp"
|
||||||
android:layout_toEndOf="@+id/tv_theme"
|
android:background="@drawable/bg_round_corner_2_6_003851"
|
||||||
android:background="@drawable/bg_round_corner_2_6_601d14"
|
android:paddingHorizontal="5.3dp"
|
||||||
android:paddingHorizontal="5.3dp"
|
android:paddingVertical="3.3dp"
|
||||||
android:paddingVertical="3.3dp"
|
android:text="오픈예정"
|
||||||
android:text="19"
|
android:textColor="@color/color_3bb9f1"
|
||||||
android:textColor="@color/color_e33621"
|
android:visibility="gone" />
|
||||||
android:visibility="gone" />
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_theme"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_round_corner_2_6_28312b"
|
||||||
|
android:paddingHorizontal="5.3dp"
|
||||||
|
android:paddingVertical="3.3dp"
|
||||||
|
android:textColor="@color/color_3bac6a"
|
||||||
|
tools:text="커버곡" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_19"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.3dp"
|
||||||
|
android:background="@drawable/bg_round_corner_2_6_601d14"
|
||||||
|
android:paddingHorizontal="5.3dp"
|
||||||
|
android:paddingVertical="3.3dp"
|
||||||
|
android:text="19"
|
||||||
|
android:textColor="@color/color_e33621"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_purchased"
|
android:id="@+id/tv_purchased"
|
||||||
|
@ -350,7 +367,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="13.3dp"
|
android:layout_marginTop="13.3dp"
|
||||||
android:textColor="@color/color_9970ff"
|
android:textColor="@color/color_3bb9f1"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="#커버곡 #라이브 #연애 #썸" />
|
tools:text="#커버곡 #라이브 #연애 #썸" />
|
||||||
|
@ -371,7 +388,7 @@
|
||||||
android:id="@+id/rl_preview_alert"
|
android:id="@+id/rl_preview_alert"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_round_corner_5_3_e51e0e45_9970ff"
|
android:background="@drawable/bg_round_corner_5_3_13181b_3bb9f1"
|
||||||
android:padding="13.3dp"
|
android:padding="13.3dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
|
@ -393,51 +410,72 @@
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:id="@+id/ll_purchase"
|
android:id="@+id/ll_purchase"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="13.3dp"
|
android:layout_marginHorizontal="13.3dp"
|
||||||
android:layout_marginTop="18.3dp"
|
android:layout_marginTop="18.3dp"
|
||||||
android:background="@drawable/bg_round_corner_5_3_9970ff"
|
android:background="@drawable/bg_round_corner_5_3_3bb9f1"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingVertical="16dp"
|
android:paddingVertical="16dp"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:layout_width="16.7dp"
|
android:id="@+id/ll_purchase_price"
|
||||||
android:layout_height="16.7dp"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:src="@drawable/ic_can" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_price"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5.3dp"
|
android:layout_centerInParent="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16.7dp"
|
||||||
|
android:layout_height="16.7dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_can" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_price"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.3dp"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14.7sp"
|
||||||
|
tools:text="300" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_light"
|
||||||
|
android:text="캔으로"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_str_purchase_or_rental"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:text=" 구매하기"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_release_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:gravity="center"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="14.7sp"
|
android:textSize="13.3sp"
|
||||||
tools:text="300" />
|
android:visibility="gone"
|
||||||
|
tools:text="2024년 10월 20일 15시 30분 오픈" />
|
||||||
<TextView
|
</RelativeLayout>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:fontFamily="@font/gmarket_sans_light"
|
|
||||||
android:text="캔으로"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="12sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_str_purchase_or_rental"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
|
||||||
android:text=" 구매하기"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="14.7sp" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_comment"
|
android:id="@+id/ll_comment"
|
||||||
|
@ -498,7 +536,7 @@
|
||||||
android:id="@+id/et_comment"
|
android:id="@+id/et_comment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_round_corner_10_232323_9970ff"
|
android:background="@drawable/bg_round_corner_10_13181b_3bb9f1"
|
||||||
android:hint="댓글을 입력해 보세요"
|
android:hint="댓글을 입력해 보세요"
|
||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
|
|
|
@ -28,6 +28,20 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_scheduled_to_open"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="@drawable/bg_round_corner_2_6_003851"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:padding="2.6dp"
|
||||||
|
android:text="오픈예정"
|
||||||
|
android:textColor="@color/color_3bb9f1"
|
||||||
|
android:textSize="8sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_theme"
|
android:id="@+id/tv_theme"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -104,4 +104,5 @@
|
||||||
<color name="color_ffe500">#FFE500</color>
|
<color name="color_ffe500">#FFE500</color>
|
||||||
<color name="color_b38fff">#B38FFF</color>
|
<color name="color_b38fff">#B38FFF</color>
|
||||||
<color name="color_004b6c">#004B6C</color>
|
<color name="color_004b6c">#004B6C</color>
|
||||||
|
<color name="color_003851">#003851</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in New Issue