parent
20a1e8f1d7
commit
687aada611
|
@ -40,8 +40,8 @@ android {
|
||||||
applicationId "kr.co.vividnext.sodalive"
|
applicationId "kr.co.vividnext.sodalive"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 80
|
versionCode 81
|
||||||
versionName "1.12.3"
|
versionName "1.13.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
@ -199,6 +199,8 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
binding.llPriceFree.setOnClickListener { viewModel.setPriceFree(true) }
|
binding.llPriceFree.setOnClickListener { viewModel.setPriceFree(true) }
|
||||||
binding.llPreviewYes.setOnClickListener { viewModel.setGeneratePreview(true) }
|
binding.llPreviewYes.setOnClickListener { viewModel.setGeneratePreview(true) }
|
||||||
binding.llPreviewNo.setOnClickListener { viewModel.setGeneratePreview(false) }
|
binding.llPreviewNo.setOnClickListener { viewModel.setGeneratePreview(false) }
|
||||||
|
binding.llLimited.setOnClickListener { viewModel.setLimited(true) }
|
||||||
|
binding.llNotLimited.setOnClickListener { viewModel.setLimited(false) }
|
||||||
binding.llRentalAndKeep.setOnClickListener { viewModel.setIsOnlyRental(false) }
|
binding.llRentalAndKeep.setOnClickListener { viewModel.setIsOnlyRental(false) }
|
||||||
binding.llOnlyRental.setOnClickListener { viewModel.setIsOnlyRental(true) }
|
binding.llOnlyRental.setOnClickListener { viewModel.setIsOnlyRental(true) }
|
||||||
binding.llCommentNo.setOnClickListener { viewModel.setAvailableComment(false) }
|
binding.llCommentNo.setOnClickListener { viewModel.setAvailableComment(false) }
|
||||||
|
@ -357,6 +359,24 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
compositeDisposable.add(
|
||||||
|
binding.etLimited.textChanges().skip(1)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe {
|
||||||
|
val limited = it.toString().toIntOrNull()
|
||||||
|
if (limited != null) {
|
||||||
|
viewModel.limited = limited.toInt()
|
||||||
|
} else {
|
||||||
|
viewModel.limited = 0
|
||||||
|
if (it.isNotBlank()) {
|
||||||
|
binding.etLimited.setText(it.substring(0, it.length - 1))
|
||||||
|
binding.etLimited.setSelection(it.length - 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
binding.etPreviewStartTime.textChanges().skip(1)
|
binding.etPreviewStartTime.textChanges().skip(1)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
|
@ -403,6 +423,14 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.isLimitedLiveData.observe(this) {
|
||||||
|
if (it) {
|
||||||
|
checkLimited()
|
||||||
|
} else {
|
||||||
|
checkNotLimited()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.isGeneratePreviewLiveData.observe(this) {
|
viewModel.isGeneratePreviewLiveData.observe(this) {
|
||||||
if (it) {
|
if (it) {
|
||||||
checkGeneratePreview()
|
checkGeneratePreview()
|
||||||
|
@ -527,6 +555,18 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
viewModel.reservationTimeLiveData.observe(this) {
|
viewModel.reservationTimeLiveData.observe(this) {
|
||||||
binding.tvReservationTime.text = it
|
binding.tvReservationTime.text = it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.isShowConfigLimitedLiveData.observe(this) {
|
||||||
|
if (it) {
|
||||||
|
binding.llConfigLimited.visibility = View.VISIBLE
|
||||||
|
binding.tvConfigLimitedTitle.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
binding.llConfigLimited.visibility = View.GONE
|
||||||
|
binding.tvConfigLimitedTitle.visibility = View.GONE
|
||||||
|
binding.etLimited.visibility = View.GONE
|
||||||
|
binding.etLimited.setText("")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkActiveNow() {
|
private fun checkActiveNow() {
|
||||||
|
@ -634,6 +674,53 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
binding.llConfigPreview.visibility = View.VISIBLE
|
binding.llConfigPreview.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkNotLimited() {
|
||||||
|
binding.ivNotLimited.visibility = View.VISIBLE
|
||||||
|
binding.tvNotLimited.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_eeeeee
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llNotLimited.setBackgroundResource(R.drawable.bg_round_corner_6_7_3bb9f1)
|
||||||
|
|
||||||
|
binding.ivLimited.visibility = View.GONE
|
||||||
|
binding.tvLimited.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_3bb9f1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llLimited.setBackgroundResource(
|
||||||
|
R.drawable.bg_round_corner_6_7_13181b
|
||||||
|
)
|
||||||
|
binding.etLimited.visibility = View.GONE
|
||||||
|
binding.etLimited.setText("")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkLimited() {
|
||||||
|
binding.ivLimited.visibility = View.VISIBLE
|
||||||
|
binding.tvLimited.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_eeeeee
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llLimited.setBackgroundResource(R.drawable.bg_round_corner_6_7_3bb9f1)
|
||||||
|
|
||||||
|
binding.ivNotLimited.visibility = View.GONE
|
||||||
|
binding.tvNotLimited.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_3bb9f1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llNotLimited.setBackgroundResource(
|
||||||
|
R.drawable.bg_round_corner_6_7_13181b
|
||||||
|
)
|
||||||
|
binding.etLimited.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkGeneratePreview() {
|
private fun checkGeneratePreview() {
|
||||||
binding.ivPreviewYes.visibility = View.VISIBLE
|
binding.ivPreviewYes.visibility = View.VISIBLE
|
||||||
binding.tvPreviewYes.setTextColor(
|
binding.tvPreviewYes.setTextColor(
|
||||||
|
|
|
@ -50,6 +50,14 @@ class AudioContentUploadViewModel(
|
||||||
val isPriceFreeLiveData: LiveData<Boolean>
|
val isPriceFreeLiveData: LiveData<Boolean>
|
||||||
get() = _isPriceFreeLiveData
|
get() = _isPriceFreeLiveData
|
||||||
|
|
||||||
|
private val _isLimitedLiveData = MutableLiveData(false)
|
||||||
|
val isLimitedLiveData: LiveData<Boolean>
|
||||||
|
get() = _isLimitedLiveData
|
||||||
|
|
||||||
|
private val _isShowConfigLimitedLiveData = MutableLiveData(false)
|
||||||
|
val isShowConfigLimitedLiveData: LiveData<Boolean>
|
||||||
|
get() = _isShowConfigLimitedLiveData
|
||||||
|
|
||||||
private val _isGeneratePreviewLiveData = MutableLiveData(true)
|
private val _isGeneratePreviewLiveData = MutableLiveData(true)
|
||||||
val isGeneratePreviewLiveData: LiveData<Boolean>
|
val isGeneratePreviewLiveData: LiveData<Boolean>
|
||||||
get() = _isGeneratePreviewLiveData
|
get() = _isGeneratePreviewLiveData
|
||||||
|
@ -72,6 +80,7 @@ class AudioContentUploadViewModel(
|
||||||
var detail = ""
|
var detail = ""
|
||||||
var tags = ""
|
var tags = ""
|
||||||
var price = 0
|
var price = 0
|
||||||
|
var limited = 0
|
||||||
var releaseDate = ""
|
var releaseDate = ""
|
||||||
var releaseTime = ""
|
var releaseTime = ""
|
||||||
var theme: GetAudioContentThemeResponse? = null
|
var theme: GetAudioContentThemeResponse? = null
|
||||||
|
@ -93,7 +102,14 @@ class AudioContentUploadViewModel(
|
||||||
|
|
||||||
if (isPriceFree) {
|
if (isPriceFree) {
|
||||||
_isOnlyRentalLiveData.postValue(false)
|
_isOnlyRentalLiveData.postValue(false)
|
||||||
|
_isShowConfigLimitedLiveData.postValue(false)
|
||||||
|
_isLimitedLiveData.postValue(false)
|
||||||
|
limited = 0
|
||||||
_isGeneratePreviewLiveData.postValue(true)
|
_isGeneratePreviewLiveData.postValue(true)
|
||||||
|
} else {
|
||||||
|
if (!_isOnlyRentalLiveData.value!!) {
|
||||||
|
_isShowConfigLimitedLiveData.postValue(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,8 +117,26 @@ class AudioContentUploadViewModel(
|
||||||
_isGeneratePreviewLiveData.value = isGeneratePreview
|
_isGeneratePreviewLiveData.value = isGeneratePreview
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setLimited(isLimited: Boolean) {
|
||||||
|
_isLimitedLiveData.value = isLimited
|
||||||
|
|
||||||
|
if (!isLimited) {
|
||||||
|
limited = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun setIsOnlyRental(isOnlyRental: Boolean) {
|
fun setIsOnlyRental(isOnlyRental: Boolean) {
|
||||||
_isOnlyRentalLiveData.postValue(isOnlyRental)
|
_isOnlyRentalLiveData.postValue(isOnlyRental)
|
||||||
|
|
||||||
|
if (isOnlyRental) {
|
||||||
|
_isShowConfigLimitedLiveData.postValue(false)
|
||||||
|
_isLimitedLiveData.postValue(false)
|
||||||
|
limited = 0
|
||||||
|
} else {
|
||||||
|
if (!_isPriceFreeLiveData.value!!) {
|
||||||
|
_isShowConfigLimitedLiveData.postValue(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setActiveReservation(isActiveReservation: Boolean) {
|
fun setActiveReservation(isActiveReservation: Boolean) {
|
||||||
|
@ -120,6 +154,17 @@ class AudioContentUploadViewModel(
|
||||||
detail = detail,
|
detail = detail,
|
||||||
tags = tags,
|
tags = tags,
|
||||||
price = price,
|
price = price,
|
||||||
|
limited = if (
|
||||||
|
price > 0 &&
|
||||||
|
limited > 0 &&
|
||||||
|
_isLimitedLiveData.value!! &&
|
||||||
|
_isShowConfigLimitedLiveData.value!! &&
|
||||||
|
!_isPriceFreeLiveData.value!!
|
||||||
|
) {
|
||||||
|
limited
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
},
|
||||||
releaseDate = if (_isActiveReservationLiveData.value!!) {
|
releaseDate = if (_isActiveReservationLiveData.value!!) {
|
||||||
"$releaseDate $releaseTime"
|
"$releaseDate $releaseTime"
|
||||||
} else {
|
} else {
|
||||||
|
@ -143,6 +188,8 @@ class AudioContentUploadViewModel(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Logger.e("test - $request")
|
||||||
|
|
||||||
val requestJson = Gson().toJson(request)
|
val requestJson = Gson().toJson(request)
|
||||||
|
|
||||||
val coverImage = if (coverImageUri != null) {
|
val coverImage = if (coverImageUri != null) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ data class CreateAudioContentRequest(
|
||||||
@SerializedName("detail") val detail: String,
|
@SerializedName("detail") val detail: String,
|
||||||
@SerializedName("tags") val tags: String,
|
@SerializedName("tags") val tags: String,
|
||||||
@SerializedName("price") val price: Int,
|
@SerializedName("price") val price: Int,
|
||||||
|
@SerializedName("limited") val limited: Int? = null,
|
||||||
@SerializedName("releaseDate") val releaseDate: String?,
|
@SerializedName("releaseDate") val releaseDate: String?,
|
||||||
@SerializedName("timezone") val timezone: String,
|
@SerializedName("timezone") val timezone: String,
|
||||||
@SerializedName("themeId") val themeId: Long,
|
@SerializedName("themeId") val themeId: Long,
|
||||||
|
|
|
@ -534,6 +534,104 @@
|
||||||
android:textSize="13.3sp" />
|
android:textSize="13.3sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_config_limited_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:lineSpacingExtra="5sp"
|
||||||
|
android:text="한정판 설정"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="16.7sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_config_limited"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:baselineAligned="false">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_not_limited"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_round_corner_6_7_13181b"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="14.3dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_not_limited"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6.7dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_select_check"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_not_limited"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:text="무제한"
|
||||||
|
android:textColor="@color/color_3bb9f1"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_limited"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="13.3dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/bg_round_corner_6_7_13181b"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="14.3dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_limited"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="6.7dp"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/ic_select_check"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_limited"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:text="한정판"
|
||||||
|
android:textColor="@color/color_3bb9f1"
|
||||||
|
android:textSize="14.7sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_limited"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="13.3dp"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:background="@drawable/bg_round_corner_6_7_222222"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:hint="한정판 개수를 입력하세요"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="numberSigned"
|
||||||
|
android:padding="13.3dp"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textColorHint="@color/color_777777"
|
||||||
|
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||||
|
android:textSize="13.3sp"
|
||||||
|
android:theme="@style/EditTextStyle"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:ignore="LabelFor" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_config_preview"
|
android:id="@+id/ll_config_preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue