parent
6fbb98ca7b
commit
fba11ae4b9
|
@ -197,6 +197,8 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
|
|
||||||
binding.llPricePaid.setOnClickListener { viewModel.setPriceFree(false) }
|
binding.llPricePaid.setOnClickListener { viewModel.setPriceFree(false) }
|
||||||
binding.llPriceFree.setOnClickListener { viewModel.setPriceFree(true) }
|
binding.llPriceFree.setOnClickListener { viewModel.setPriceFree(true) }
|
||||||
|
binding.llPreviewYes.setOnClickListener { viewModel.setGeneratePreview(true) }
|
||||||
|
binding.llPreviewNo.setOnClickListener { viewModel.setGeneratePreview(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) }
|
||||||
|
@ -401,6 +403,14 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.isGeneratePreviewLiveData.observe(this) {
|
||||||
|
if (it) {
|
||||||
|
checkGeneratePreview()
|
||||||
|
} else {
|
||||||
|
checkNotGeneratePreview()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.isOnlyRentalLiveData.observe(this) {
|
viewModel.isOnlyRentalLiveData.observe(this) {
|
||||||
if (it) {
|
if (it) {
|
||||||
checkOnlyRental()
|
checkOnlyRental()
|
||||||
|
@ -593,6 +603,7 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
R.drawable.bg_round_corner_6_7_13181b
|
R.drawable.bg_round_corner_6_7_13181b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
binding.llConfigPreview.visibility = View.GONE
|
||||||
binding.llConfigPreviewTime.visibility = View.GONE
|
binding.llConfigPreviewTime.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,9 +631,55 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
||||||
binding.llPriceFree.setBackgroundResource(
|
binding.llPriceFree.setBackgroundResource(
|
||||||
R.drawable.bg_round_corner_6_7_13181b
|
R.drawable.bg_round_corner_6_7_13181b
|
||||||
)
|
)
|
||||||
|
binding.llConfigPreview.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkGeneratePreview() {
|
||||||
|
binding.ivPreviewYes.visibility = View.VISIBLE
|
||||||
|
binding.tvPreviewYes.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_eeeeee
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llPreviewYes.setBackgroundResource(R.drawable.bg_round_corner_6_7_3bb9f1)
|
||||||
|
|
||||||
|
binding.ivPreviewNo.visibility = View.GONE
|
||||||
|
binding.tvPreviewNo.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_3bb9f1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llPreviewNo.setBackgroundResource(
|
||||||
|
R.drawable.bg_round_corner_6_7_13181b
|
||||||
|
)
|
||||||
binding.llConfigPreviewTime.visibility = View.VISIBLE
|
binding.llConfigPreviewTime.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun checkNotGeneratePreview() {
|
||||||
|
binding.ivPreviewNo.visibility = View.VISIBLE
|
||||||
|
binding.tvPreviewNo.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_eeeeee
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llPreviewNo.setBackgroundResource(R.drawable.bg_round_corner_6_7_3bb9f1)
|
||||||
|
|
||||||
|
binding.ivPreviewYes.visibility = View.GONE
|
||||||
|
binding.tvPreviewYes.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_3bb9f1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.llPreviewYes.setBackgroundResource(
|
||||||
|
R.drawable.bg_round_corner_6_7_13181b
|
||||||
|
)
|
||||||
|
binding.llConfigPreviewTime.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkRentalAndKeep() {
|
private fun checkRentalAndKeep() {
|
||||||
binding.tvPriceTitle.text = "소장 가격"
|
binding.tvPriceTitle.text = "소장 가격"
|
||||||
binding.ivRentalAndKeep.visibility = View.VISIBLE
|
binding.ivRentalAndKeep.visibility = View.VISIBLE
|
||||||
|
|
|
@ -50,6 +50,10 @@ class AudioContentUploadViewModel(
|
||||||
val isPriceFreeLiveData: LiveData<Boolean>
|
val isPriceFreeLiveData: LiveData<Boolean>
|
||||||
get() = _isPriceFreeLiveData
|
get() = _isPriceFreeLiveData
|
||||||
|
|
||||||
|
private val _isGeneratePreviewLiveData = MutableLiveData(true)
|
||||||
|
val isGeneratePreviewLiveData: LiveData<Boolean>
|
||||||
|
get() = _isGeneratePreviewLiveData
|
||||||
|
|
||||||
private val _isActiveReservationLiveData = MutableLiveData(false)
|
private val _isActiveReservationLiveData = MutableLiveData(false)
|
||||||
val isActiveReservationLiveData: LiveData<Boolean>
|
val isActiveReservationLiveData: LiveData<Boolean>
|
||||||
get() = _isActiveReservationLiveData
|
get() = _isActiveReservationLiveData
|
||||||
|
@ -89,9 +93,14 @@ class AudioContentUploadViewModel(
|
||||||
|
|
||||||
if (isPriceFree) {
|
if (isPriceFree) {
|
||||||
_isOnlyRentalLiveData.postValue(false)
|
_isOnlyRentalLiveData.postValue(false)
|
||||||
|
_isGeneratePreviewLiveData.postValue(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setGeneratePreview(isGeneratePreview: Boolean) {
|
||||||
|
_isGeneratePreviewLiveData.value = isGeneratePreview
|
||||||
|
}
|
||||||
|
|
||||||
fun setIsOnlyRental(isOnlyRental: Boolean) {
|
fun setIsOnlyRental(isOnlyRental: Boolean) {
|
||||||
_isOnlyRentalLiveData.postValue(isOnlyRental)
|
_isOnlyRentalLiveData.postValue(isOnlyRental)
|
||||||
}
|
}
|
||||||
|
@ -104,6 +113,8 @@ class AudioContentUploadViewModel(
|
||||||
if (!_isLoading.value!! && validateData()) {
|
if (!_isLoading.value!! && validateData()) {
|
||||||
_isLoading.postValue(true)
|
_isLoading.postValue(true)
|
||||||
|
|
||||||
|
val isGeneratePreview = _isGeneratePreviewLiveData.value!!
|
||||||
|
|
||||||
val request = CreateAudioContentRequest(
|
val request = CreateAudioContentRequest(
|
||||||
title = title,
|
title = title,
|
||||||
detail = detail,
|
detail = detail,
|
||||||
|
@ -118,9 +129,18 @@ class AudioContentUploadViewModel(
|
||||||
themeId = theme!!.id,
|
themeId = theme!!.id,
|
||||||
isAdult = _isAdultLiveData.value!!,
|
isAdult = _isAdultLiveData.value!!,
|
||||||
isOnlyRental = _isOnlyRentalLiveData.value!!,
|
isOnlyRental = _isOnlyRentalLiveData.value!!,
|
||||||
|
isGeneratePreview = isGeneratePreview,
|
||||||
isCommentAvailable = _isAvailableCommentLiveData.value!!,
|
isCommentAvailable = _isAvailableCommentLiveData.value!!,
|
||||||
previewStartTime = previewStartTime,
|
previewStartTime = if (isGeneratePreview) {
|
||||||
previewEndTime = previewEndTime
|
previewStartTime
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
},
|
||||||
|
previewEndTime = if (isGeneratePreview) {
|
||||||
|
previewEndTime
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
val requestJson = Gson().toJson(request)
|
val requestJson = Gson().toJson(request)
|
||||||
|
|
|
@ -12,6 +12,7 @@ data class CreateAudioContentRequest(
|
||||||
@SerializedName("themeId") val themeId: Long,
|
@SerializedName("themeId") val themeId: Long,
|
||||||
@SerializedName("isAdult") val isAdult: Boolean,
|
@SerializedName("isAdult") val isAdult: Boolean,
|
||||||
@SerializedName("isOnlyRental") val isOnlyRental: Boolean,
|
@SerializedName("isOnlyRental") val isOnlyRental: Boolean,
|
||||||
|
@SerializedName("isGeneratePreview") val isGeneratePreview: Boolean,
|
||||||
@SerializedName("isCommentAvailable") val isCommentAvailable: Boolean,
|
@SerializedName("isCommentAvailable") val isCommentAvailable: Boolean,
|
||||||
@SerializedName("previewStartTime") val previewStartTime: String? = null,
|
@SerializedName("previewStartTime") val previewStartTime: String? = null,
|
||||||
@SerializedName("previewEndTime") val previewEndTime: String? = null,
|
@SerializedName("previewEndTime") val previewEndTime: String? = null,
|
||||||
|
|
|
@ -535,7 +535,7 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_config_preview_time"
|
android:id="@+id/ll_config_preview"
|
||||||
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"
|
||||||
|
@ -547,19 +547,10 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
android:lineSpacingExtra="5sp"
|
android:lineSpacingExtra="5sp"
|
||||||
android:text="미리듣기 시간 설정"
|
android:text="미리듣기"
|
||||||
android:textColor="@color/color_eeeeee"
|
android:textColor="@color/color_eeeeee"
|
||||||
android:textSize="16.7sp" />
|
android:textSize="16.7sp" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
|
||||||
android:text="미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다."
|
|
||||||
android:textColor="@color/color_777777"
|
|
||||||
android:textSize="13.3sp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -567,74 +558,164 @@
|
||||||
android:baselineAligned="false">
|
android:baselineAligned="false">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_preview_yes"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:background="@drawable/bg_round_corner_6_7_13181b"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="14.3dp">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
|
android:id="@+id/iv_preview_yes"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
android:layout_marginEnd="6.7dp"
|
||||||
android:text="시작 시간"
|
android:contentDescription="@null"
|
||||||
android:textColor="@color/color_eeeeee"
|
android:src="@drawable/ic_select_check"
|
||||||
android:textSize="13.3sp" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:id="@+id/et_preview_start_time"
|
android:id="@+id/tv_preview_yes"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5.3dp"
|
|
||||||
android:background="@drawable/bg_round_corner_6_7_222222"
|
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
android:gravity="center"
|
android:text="생성"
|
||||||
android:hint="00:00:00"
|
android:textColor="@color/color_3bb9f1"
|
||||||
android:importantForAutofill="no"
|
android:textSize="14.7sp" />
|
||||||
android:inputType="textWebEditText"
|
|
||||||
android:paddingHorizontal="13.3dp"
|
|
||||||
android:paddingVertical="17dp"
|
|
||||||
android:textColor="@color/color_eeeeee"
|
|
||||||
android:textColorHint="@color/color_777777"
|
|
||||||
android:textCursorDrawable="@drawable/edit_text_cursor"
|
|
||||||
android:textSize="14.7sp"
|
|
||||||
android:theme="@style/EditTextStyle"
|
|
||||||
tools:ignore="LabelFor" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_preview_no"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="13.3dp"
|
android:layout_marginStart="13.3dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical">
|
android:background="@drawable/bg_round_corner_6_7_13181b"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingVertical="14.3dp">
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
|
android:id="@+id/iv_preview_no"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
android:layout_marginEnd="6.7dp"
|
||||||
android:text="종료 시간"
|
android:contentDescription="@null"
|
||||||
android:textColor="@color/color_eeeeee"
|
android:src="@drawable/ic_select_check"
|
||||||
android:textSize="13.3sp" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:id="@+id/et_preview_end_time"
|
android:id="@+id/tv_preview_no"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5.3dp"
|
|
||||||
android:background="@drawable/bg_round_corner_6_7_222222"
|
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
android:gravity="center"
|
android:text="생성 안 함"
|
||||||
android:hint="00:30:00"
|
android:textColor="@color/color_3bb9f1"
|
||||||
android:importantForAutofill="no"
|
android:textSize="14.7sp" />
|
||||||
android:inputType="textWebEditText"
|
</LinearLayout>
|
||||||
android:paddingHorizontal="13.3dp"
|
</LinearLayout>
|
||||||
android:paddingVertical="17dp"
|
|
||||||
android:textColor="@color/color_eeeeee"
|
<LinearLayout
|
||||||
android:textColorHint="@color/color_777777"
|
android:id="@+id/ll_config_preview_time"
|
||||||
android:textCursorDrawable="@drawable/edit_text_cursor"
|
android:layout_width="match_parent"
|
||||||
android:textSize="14.7sp"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/EditTextStyle"
|
android:layout_marginTop="30dp"
|
||||||
tools:ignore="LabelFor" />
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:lineSpacingExtra="5sp"
|
||||||
|
android:text="미리듣기 시간 설정"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="16.7sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:text="미리듣기 시간을 직접 설정하지 않으면 콘텐츠 앞부분 30초가 자동으로 설정됩니다. 미리듣기의 시간제한은 없습니다."
|
||||||
|
android:textColor="@color/color_777777"
|
||||||
|
android:textSize="13.3sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
android:baselineAligned="false">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:text="시작 시간"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="13.3sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_preview_start_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5.3dp"
|
||||||
|
android:background="@drawable/bg_round_corner_6_7_222222"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:hint="00:00:00"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="textWebEditText"
|
||||||
|
android:paddingHorizontal="13.3dp"
|
||||||
|
android:paddingVertical="17dp"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textColorHint="@color/color_777777"
|
||||||
|
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||||
|
android:textSize="14.7sp"
|
||||||
|
android:theme="@style/EditTextStyle"
|
||||||
|
tools:ignore="LabelFor" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="13.3dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:text="종료 시간"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="13.3sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_preview_end_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5.3dp"
|
||||||
|
android:background="@drawable/bg_round_corner_6_7_222222"
|
||||||
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:hint="00:30:00"
|
||||||
|
android:importantForAutofill="no"
|
||||||
|
android:inputType="textWebEditText"
|
||||||
|
android:paddingHorizontal="13.3dp"
|
||||||
|
android:paddingVertical="17dp"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textColorHint="@color/color_777777"
|
||||||
|
android:textCursorDrawable="@drawable/edit_text_cursor"
|
||||||
|
android:textSize="14.7sp"
|
||||||
|
android:theme="@style/EditTextStyle"
|
||||||
|
tools:ignore="LabelFor" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in New Issue