parent
6689932393
commit
03712558e8
|
@ -935,7 +935,14 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
nickname = audioContent.creator.nickname,
|
||||
duration = audioContent.duration,
|
||||
orderType = orderType,
|
||||
price = audioContent.price,
|
||||
price = if (
|
||||
audioContent.purchaseOption == PurchaseOption.BOTH &&
|
||||
orderType == OrderType.RENTAL
|
||||
) {
|
||||
ceil(audioContent.price * 0.7).toInt()
|
||||
} else {
|
||||
audioContent.price
|
||||
},
|
||||
confirmButtonClick = {
|
||||
startService(
|
||||
Intent(this, AudioContentPlayService::class.java).apply {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package kr.co.vividnext.sodalive.audio_content.order
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
|
@ -15,8 +16,8 @@ import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
|||
import kr.co.vividnext.sodalive.databinding.DialogAudioContentOrderConfirmBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||
import kotlin.math.ceil
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
class AudioContentOrderConfirmDialog(
|
||||
activity: Activity,
|
||||
layoutInflater: LayoutInflater,
|
||||
|
@ -63,18 +64,10 @@ class AudioContentOrderConfirmDialog(
|
|||
|
||||
if (SharedPreferenceManager.userId == 17958L) {
|
||||
dialogView.ivCan.visibility = View.GONE
|
||||
dialogView.tvPrice.text = if (orderType == OrderType.RENTAL) {
|
||||
"${(ceil(price * 0.7).toInt() * 110).moneyFormat()}원"
|
||||
} else {
|
||||
"${(price * 110).moneyFormat()}원"
|
||||
}
|
||||
dialogView.tvPrice.text = "${(price * 110).moneyFormat()}원"
|
||||
} else {
|
||||
dialogView.ivCan.visibility = View.VISIBLE
|
||||
dialogView.tvPrice.text = if (orderType == OrderType.RENTAL) {
|
||||
ceil(price * 0.7).toInt().moneyFormat()
|
||||
} else {
|
||||
price.moneyFormat()
|
||||
}
|
||||
dialogView.tvPrice.text = price.moneyFormat()
|
||||
}
|
||||
|
||||
if (SharedPreferenceManager.userId == 17958L) {
|
||||
|
|
Loading…
Reference in New Issue