parent
6fbb98ca7b
commit
fba11ae4b9
|
@ -197,6 +197,8 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
|||
|
||||
binding.llPricePaid.setOnClickListener { viewModel.setPriceFree(false) }
|
||||
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.llOnlyRental.setOnClickListener { viewModel.setIsOnlyRental(true) }
|
||||
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) {
|
||||
if (it) {
|
||||
checkOnlyRental()
|
||||
|
@ -593,6 +603,7 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
|||
R.drawable.bg_round_corner_6_7_13181b
|
||||
)
|
||||
|
||||
binding.llConfigPreview.visibility = View.GONE
|
||||
binding.llConfigPreviewTime.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
@ -620,9 +631,55 @@ class AudioContentUploadActivity : BaseActivity<ActivityAudioContentUploadBindin
|
|||
binding.llPriceFree.setBackgroundResource(
|
||||
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
|
||||
}
|
||||
|
||||
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() {
|
||||
binding.tvPriceTitle.text = "소장 가격"
|
||||
binding.ivRentalAndKeep.visibility = View.VISIBLE
|
||||
|
|
|
@ -50,6 +50,10 @@ class AudioContentUploadViewModel(
|
|||
val isPriceFreeLiveData: LiveData<Boolean>
|
||||
get() = _isPriceFreeLiveData
|
||||
|
||||
private val _isGeneratePreviewLiveData = MutableLiveData(true)
|
||||
val isGeneratePreviewLiveData: LiveData<Boolean>
|
||||
get() = _isGeneratePreviewLiveData
|
||||
|
||||
private val _isActiveReservationLiveData = MutableLiveData(false)
|
||||
val isActiveReservationLiveData: LiveData<Boolean>
|
||||
get() = _isActiveReservationLiveData
|
||||
|
@ -89,9 +93,14 @@ class AudioContentUploadViewModel(
|
|||
|
||||
if (isPriceFree) {
|
||||
_isOnlyRentalLiveData.postValue(false)
|
||||
_isGeneratePreviewLiveData.postValue(true)
|
||||
}
|
||||
}
|
||||
|
||||
fun setGeneratePreview(isGeneratePreview: Boolean) {
|
||||
_isGeneratePreviewLiveData.value = isGeneratePreview
|
||||
}
|
||||
|
||||
fun setIsOnlyRental(isOnlyRental: Boolean) {
|
||||
_isOnlyRentalLiveData.postValue(isOnlyRental)
|
||||
}
|
||||
|
@ -104,6 +113,8 @@ class AudioContentUploadViewModel(
|
|||
if (!_isLoading.value!! && validateData()) {
|
||||
_isLoading.postValue(true)
|
||||
|
||||
val isGeneratePreview = _isGeneratePreviewLiveData.value!!
|
||||
|
||||
val request = CreateAudioContentRequest(
|
||||
title = title,
|
||||
detail = detail,
|
||||
|
@ -118,9 +129,18 @@ class AudioContentUploadViewModel(
|
|||
themeId = theme!!.id,
|
||||
isAdult = _isAdultLiveData.value!!,
|
||||
isOnlyRental = _isOnlyRentalLiveData.value!!,
|
||||
isGeneratePreview = isGeneratePreview,
|
||||
isCommentAvailable = _isAvailableCommentLiveData.value!!,
|
||||
previewStartTime = previewStartTime,
|
||||
previewEndTime = previewEndTime
|
||||
previewStartTime = if (isGeneratePreview) {
|
||||
previewStartTime
|
||||
} else {
|
||||
null
|
||||
},
|
||||
previewEndTime = if (isGeneratePreview) {
|
||||
previewEndTime
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
|
||||
val requestJson = Gson().toJson(request)
|
||||
|
|
|
@ -12,6 +12,7 @@ data class CreateAudioContentRequest(
|
|||
@SerializedName("themeId") val themeId: Long,
|
||||
@SerializedName("isAdult") val isAdult: Boolean,
|
||||
@SerializedName("isOnlyRental") val isOnlyRental: Boolean,
|
||||
@SerializedName("isGeneratePreview") val isGeneratePreview: Boolean,
|
||||
@SerializedName("isCommentAvailable") val isCommentAvailable: Boolean,
|
||||
@SerializedName("previewStartTime") val previewStartTime: String? = null,
|
||||
@SerializedName("previewEndTime") val previewEndTime: String? = null,
|
||||
|
|
|
@ -535,7 +535,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_config_preview_time"
|
||||
android:id="@+id/ll_config_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
|
@ -547,19 +547,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_bold"
|
||||
android:lineSpacingExtra="5sp"
|
||||
android:text="미리듣기 시간 설정"
|
||||
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"
|
||||
|
@ -567,74 +558,164 @@
|
|||
android:baselineAligned="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_yes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
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_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text="시작 시간"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="13.3sp" />
|
||||
android:layout_marginEnd="6.7dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_select_check"
|
||||
android:visibility="gone" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_preview_start_time"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_yes"
|
||||
android:layout_width="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: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" />
|
||||
android:text="생성"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textSize="14.7sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_no"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13.3dp"
|
||||
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_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text="종료 시간"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="13.3sp" />
|
||||
android:layout_marginEnd="6.7dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_select_check"
|
||||
android:visibility="gone" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_preview_end_time"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_no"
|
||||
android:layout_width="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: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" />
|
||||
android:text="생성 안 함"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textSize="14.7sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_config_preview_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue