라이브 성별 제한 옵션 추가

라이브 생성/수정 요청에 genderRestriction을 추가한다.

라이브 상세/최근 정보 응답에 genderRestriction을 포함한다.
This commit is contained in:
2026-02-03 14:05:43 +09:00
parent 666424f79b
commit 94b48cef84
14 changed files with 617 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
package kr.co.vividnext.sodalive.live.room
import com.google.gson.annotations.SerializedName
enum class GenderRestriction {
@SerializedName("ALL") ALL,
@SerializedName("MALE_ONLY") MALE_ONLY,
@SerializedName("FEMALE_ONLY") FEMALE_ONLY
}

View File

@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.live.room.create
import androidx.annotation.Keep import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kr.co.vividnext.sodalive.live.room.GenderRestriction
import kr.co.vividnext.sodalive.live.room.LiveRoomType import kr.co.vividnext.sodalive.live.room.LiveRoomType
@Keep @Keep
@@ -11,6 +12,7 @@ data class CreateLiveRoomRequest(
@SerializedName("content") val content: String, @SerializedName("content") val content: String,
@SerializedName("coverImageUrl") val coverImageUrl: String? = null, @SerializedName("coverImageUrl") val coverImageUrl: String? = null,
@SerializedName("isAdult") val isAdult: Boolean, @SerializedName("isAdult") val isAdult: Boolean,
@SerializedName("genderRestriction") val genderRestriction: GenderRestriction = GenderRestriction.ALL,
@SerializedName("tags") val tags: List<String>, @SerializedName("tags") val tags: List<String>,
@SerializedName("numberOfPeople") val numberOfPeople: Int, @SerializedName("numberOfPeople") val numberOfPeople: Int,
@SerializedName("beginDateTimeString") val beginDateTimeString: String? = null, @SerializedName("beginDateTimeString") val beginDateTimeString: String? = null,

View File

@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.live.room.create
import androidx.annotation.Keep import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kr.co.vividnext.sodalive.live.room.GenderRestriction
@Keep @Keep
data class GetRecentRoomInfoResponse( data class GetRecentRoomInfoResponse(
@@ -9,5 +10,7 @@ data class GetRecentRoomInfoResponse(
@SerializedName("notice") val notice: String, @SerializedName("notice") val notice: String,
@SerializedName("coverImageUrl") val coverImageUrl: String, @SerializedName("coverImageUrl") val coverImageUrl: String,
@SerializedName("coverImagePath") val coverImagePath: String, @SerializedName("coverImagePath") val coverImagePath: String,
@SerializedName("numberOfPeople") val numberOfPeople: Int @SerializedName("numberOfPeople") val numberOfPeople: Int,
@SerializedName("genderRestriction")
val genderRestriction: GenderRestriction = GenderRestriction.ALL
) )

View File

@@ -33,6 +33,7 @@ import kr.co.vividnext.sodalive.databinding.ActivityLiveRoomCreateBinding
import kr.co.vividnext.sodalive.databinding.ItemLiveTagSelectedBinding import kr.co.vividnext.sodalive.databinding.ItemLiveTagSelectedBinding
import kr.co.vividnext.sodalive.extensions.convertDateFormat import kr.co.vividnext.sodalive.extensions.convertDateFormat
import kr.co.vividnext.sodalive.extensions.dpToPx import kr.co.vividnext.sodalive.extensions.dpToPx
import kr.co.vividnext.sodalive.live.room.GenderRestriction
import kr.co.vividnext.sodalive.live.room.LiveRoomType import kr.co.vividnext.sodalive.live.room.LiveRoomType
import kr.co.vividnext.sodalive.live.room.tag.LiveTagFragment import kr.co.vividnext.sodalive.live.room.tag.LiveTagFragment
import kr.co.vividnext.sodalive.settings.notification.MemberRole import kr.co.vividnext.sodalive.settings.notification.MemberRole
@@ -592,6 +593,18 @@ class LiveRoomCreateActivity : BaseActivity<ActivityLiveRoomCreateBinding>(
viewModel.setAdult(true) viewModel.setAdult(true)
} }
binding.llGenderAll.setOnClickListener {
viewModel.setGenderRestriction(GenderRestriction.ALL)
}
binding.llGenderMaleOnly.setOnClickListener {
viewModel.setGenderRestriction(GenderRestriction.MALE_ONLY)
}
binding.llGenderFemaleOnly.setOnClickListener {
viewModel.setGenderRestriction(GenderRestriction.FEMALE_ONLY)
}
viewModel.isAdultLiveData.observe(this) { viewModel.isAdultLiveData.observe(this) {
if (it) { if (it) {
binding.ivAgeAll.visibility = View.GONE binding.ivAgeAll.visibility = View.GONE
@@ -630,6 +643,16 @@ class LiveRoomCreateActivity : BaseActivity<ActivityLiveRoomCreateBinding>(
) )
) )
} }
binding.llGenderRestriction.visibility = if (it) {
View.VISIBLE
} else {
View.GONE
}
}
viewModel.genderRestrictionLiveData.observe(this) { restriction ->
updateGenderRestrictionSelection(restriction)
} }
} }
@@ -850,4 +873,51 @@ class LiveRoomCreateActivity : BaseActivity<ActivityLiveRoomCreateBinding>(
) )
) )
} }
private fun updateGenderRestrictionSelection(restriction: GenderRestriction) {
setGenderRestrictionSelected(
isSelected = restriction == GenderRestriction.ALL,
imageView = binding.ivGenderAll,
container = binding.llGenderAll,
textView = binding.tvGenderAll
)
setGenderRestrictionSelected(
isSelected = restriction == GenderRestriction.MALE_ONLY,
imageView = binding.ivGenderMaleOnly,
container = binding.llGenderMaleOnly,
textView = binding.tvGenderMaleOnly
)
setGenderRestrictionSelected(
isSelected = restriction == GenderRestriction.FEMALE_ONLY,
imageView = binding.ivGenderFemaleOnly,
container = binding.llGenderFemaleOnly,
textView = binding.tvGenderFemaleOnly
)
}
private fun setGenderRestrictionSelected(
isSelected: Boolean,
imageView: ImageView,
container: LinearLayout,
textView: TextView
) {
imageView.visibility = if (isSelected) View.VISIBLE else View.GONE
container.setBackgroundResource(
if (isSelected) {
R.drawable.bg_round_corner_6_7_3bb9f1
} else {
R.drawable.bg_round_corner_6_7_13181b
}
)
textView.setTextColor(
ContextCompat.getColor(
applicationContext,
if (isSelected) {
R.color.color_eeeeee
} else {
R.color.color_3bb9f1
}
)
)
}
} }

View File

@@ -13,6 +13,7 @@ import kr.co.vividnext.sodalive.common.UiText
import kr.co.vividnext.sodalive.common.UiText.DynamicString import kr.co.vividnext.sodalive.common.UiText.DynamicString
import kr.co.vividnext.sodalive.common.UiText.StringResource import kr.co.vividnext.sodalive.common.UiText.StringResource
import kr.co.vividnext.sodalive.live.LiveRepository import kr.co.vividnext.sodalive.live.LiveRepository
import kr.co.vividnext.sodalive.live.room.GenderRestriction
import kr.co.vividnext.sodalive.live.room.LiveRoomType import kr.co.vividnext.sodalive.live.room.LiveRoomType
import kr.co.vividnext.sodalive.live.room.menu.GetMenuPresetResponse import kr.co.vividnext.sodalive.live.room.menu.GetMenuPresetResponse
import kr.co.vividnext.sodalive.R import kr.co.vividnext.sodalive.R
@@ -67,6 +68,10 @@ class LiveRoomCreateViewModel(
val isAdultLiveData: LiveData<Boolean> val isAdultLiveData: LiveData<Boolean>
get() = _isAdultLiveData get() = _isAdultLiveData
private val _genderRestrictionLiveData = MutableLiveData(GenderRestriction.ALL)
val genderRestrictionLiveData: LiveData<GenderRestriction>
get() = _genderRestrictionLiveData
private val _selectedMenuLiveData = MutableLiveData<SelectedMenu>() private val _selectedMenuLiveData = MutableLiveData<SelectedMenu>()
val selectedMenuLiveData: LiveData<SelectedMenu> val selectedMenuLiveData: LiveData<SelectedMenu>
get() = _selectedMenuLiveData get() = _selectedMenuLiveData
@@ -118,12 +123,18 @@ class LiveRoomCreateViewModel(
fun createLiveRoom(onSuccess: (CreateLiveRoomResponse) -> Unit) { fun createLiveRoom(onSuccess: (CreateLiveRoomResponse) -> Unit) {
if (!_isLoading.value!! && validateData()) { if (!_isLoading.value!! && validateData()) {
_isLoading.postValue(true) _isLoading.postValue(true)
val normalizedGenderRestriction = if (_isAdultLiveData.value == true) {
_genderRestrictionLiveData.value!!
} else {
GenderRestriction.ALL
}
val request = CreateLiveRoomRequest( val request = CreateLiveRoomRequest(
title = title, title = title,
price = _priceLiveData.value!!, price = _priceLiveData.value!!,
content = content, content = content,
coverImageUrl = coverImagePath, coverImageUrl = coverImagePath,
isAdult = _isAdultLiveData.value!!, isAdult = _isAdultLiveData.value!!,
genderRestriction = normalizedGenderRestriction,
tags = tags.toList(), tags = tags.toList(),
numberOfPeople = numberOfPeople, numberOfPeople = numberOfPeople,
beginDateTimeString = if ( beginDateTimeString = if (
@@ -262,6 +273,13 @@ class LiveRoomCreateViewModel(
fun setAdult(isAdult: Boolean) { fun setAdult(isAdult: Boolean) {
_isAdultLiveData.value = isAdult _isAdultLiveData.value = isAdult
if (!isAdult) {
_genderRestrictionLiveData.value = GenderRestriction.ALL
}
}
fun setGenderRestriction(genderRestriction: GenderRestriction) {
_genderRestrictionLiveData.value = genderRestriction
} }
fun setAvailableJoinCreator(isAvailableJoinCreator: Boolean) { fun setAvailableJoinCreator(isAvailableJoinCreator: Boolean) {
@@ -279,6 +297,7 @@ class LiveRoomCreateViewModel(
if (it.success && it.data != null) { if (it.success && it.data != null) {
coverImageFile = null coverImageFile = null
coverImagePath = it.data.coverImagePath coverImagePath = it.data.coverImagePath
_genderRestrictionLiveData.value = it.data.genderRestriction
onSuccess(it.data!!) onSuccess(it.data!!)
_toastLiveData.postValue( _toastLiveData.postValue(

View File

@@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.live.room.detail
import android.os.Parcelable import android.os.Parcelable
import androidx.annotation.Keep import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kr.co.vividnext.sodalive.live.room.GenderRestriction
import kotlinx.parcelize.Parcelize import kotlinx.parcelize.Parcelize
@Parcelize @Parcelize
@@ -14,6 +15,8 @@ data class GetRoomDetailResponse(
@SerializedName("notice") val notice: String, @SerializedName("notice") val notice: String,
@SerializedName("isPaid") val isPaid: Boolean, @SerializedName("isPaid") val isPaid: Boolean,
@SerializedName("isAdult") val isAdult: Boolean, @SerializedName("isAdult") val isAdult: Boolean,
@SerializedName("genderRestriction")
val genderRestriction: GenderRestriction = GenderRestriction.ALL,
@SerializedName("isPrivateRoom") val isPrivateRoom: Boolean, @SerializedName("isPrivateRoom") val isPrivateRoom: Boolean,
@SerializedName("password") val password: Int?, @SerializedName("password") val password: Int?,
@SerializedName("tags") val tags: List<String>, @SerializedName("tags") val tags: List<String>,

View File

@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.live.room.update
import androidx.annotation.Keep import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kr.co.vividnext.sodalive.live.room.GenderRestriction
@Keep @Keep
data class EditLiveRoomInfoRequest( data class EditLiveRoomInfoRequest(
@@ -13,5 +14,6 @@ data class EditLiveRoomInfoRequest(
@SerializedName("menuPanId") val menuPanId: Long = 0, @SerializedName("menuPanId") val menuPanId: Long = 0,
@SerializedName("menuPan") val menuPan: String = "", @SerializedName("menuPan") val menuPan: String = "",
@SerializedName("isActiveMenuPan") val isActiveMenuPan: Boolean? = null, @SerializedName("isActiveMenuPan") val isActiveMenuPan: Boolean? = null,
@SerializedName("isAdult") val isAdult: Boolean? = null @SerializedName("isAdult") val isAdult: Boolean? = null,
@SerializedName("genderRestriction") val genderRestriction: GenderRestriction? = null
) )

View File

@@ -7,8 +7,10 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View
import android.widget.Toast import android.widget.Toast
import androidx.core.content.IntentCompat import androidx.core.content.IntentCompat
import androidx.core.content.ContextCompat
import com.jakewharton.rxbinding4.widget.textChanges import com.jakewharton.rxbinding4.widget.textChanges
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
@@ -16,8 +18,10 @@ import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.base.BaseActivity import kr.co.vividnext.sodalive.base.BaseActivity
import kr.co.vividnext.sodalive.common.Constants import kr.co.vividnext.sodalive.common.Constants
import kr.co.vividnext.sodalive.common.LoadingDialog import kr.co.vividnext.sodalive.common.LoadingDialog
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.databinding.ActivityLiveRoomEditBinding import kr.co.vividnext.sodalive.databinding.ActivityLiveRoomEditBinding
import kr.co.vividnext.sodalive.extensions.convertDateFormat import kr.co.vividnext.sodalive.extensions.convertDateFormat
import kr.co.vividnext.sodalive.live.room.GenderRestriction
import kr.co.vividnext.sodalive.live.room.detail.GetRoomDetailResponse import kr.co.vividnext.sodalive.live.room.detail.GetRoomDetailResponse
import org.koin.android.ext.android.inject import org.koin.android.ext.android.inject
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@@ -170,6 +174,32 @@ class LiveRoomEditActivity : BaseActivity<ActivityLiveRoomEditBinding>(
} }
false false
} }
if (SharedPreferenceManager.isAuth) {
binding.llSetAdult.visibility = View.VISIBLE
} else {
binding.llSetAdult.visibility = View.GONE
}
binding.llAgeAll.setOnClickListener {
viewModel.setAdult(false)
}
binding.llAge19.setOnClickListener {
viewModel.setAdult(true)
}
binding.llGenderAll.setOnClickListener {
viewModel.setGenderRestriction(GenderRestriction.ALL)
}
binding.llGenderMaleOnly.setOnClickListener {
viewModel.setGenderRestriction(GenderRestriction.MALE_ONLY)
}
binding.llGenderFemaleOnly.setOnClickListener {
viewModel.setGenderRestriction(GenderRestriction.FEMALE_ONLY)
}
} }
private fun bindData() { private fun bindData() {
@@ -233,5 +263,102 @@ class LiveRoomEditActivity : BaseActivity<ActivityLiveRoomEditBinding>(
viewModel.reservationTimeLiveData.observe(this) { viewModel.reservationTimeLiveData.observe(this) {
binding.tvReservationTime.text = it binding.tvReservationTime.text = it
} }
viewModel.isAdultLiveData.observe(this) {
if (it) {
binding.ivAgeAll.visibility = View.GONE
binding.llAgeAll.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
binding.tvAgeAll.setTextColor(
ContextCompat.getColor(
applicationContext,
R.color.color_3bb9f1
)
)
binding.ivAge19.visibility = View.VISIBLE
binding.llAge19.setBackgroundResource(R.drawable.bg_round_corner_6_7_3bb9f1)
binding.tvAge19.setTextColor(
ContextCompat.getColor(
applicationContext,
R.color.color_eeeeee
)
)
} else {
binding.ivAge19.visibility = View.GONE
binding.llAge19.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
binding.tvAge19.setTextColor(
ContextCompat.getColor(
applicationContext,
R.color.color_3bb9f1
)
)
binding.ivAgeAll.visibility = View.VISIBLE
binding.llAgeAll.setBackgroundResource(R.drawable.bg_round_corner_6_7_3bb9f1)
binding.tvAgeAll.setTextColor(
ContextCompat.getColor(
applicationContext,
R.color.color_eeeeee
)
)
}
binding.llGenderRestriction.visibility = if (it) {
View.VISIBLE
} else {
View.GONE
}
}
viewModel.genderRestrictionLiveData.observe(this) { restriction ->
updateGenderRestrictionSelection(restriction)
}
}
private fun updateGenderRestrictionSelection(restriction: GenderRestriction) {
setGenderRestrictionSelected(
isSelected = restriction == GenderRestriction.ALL,
imageView = binding.ivGenderAll,
container = binding.llGenderAll,
textView = binding.tvGenderAll
)
setGenderRestrictionSelected(
isSelected = restriction == GenderRestriction.MALE_ONLY,
imageView = binding.ivGenderMaleOnly,
container = binding.llGenderMaleOnly,
textView = binding.tvGenderMaleOnly
)
setGenderRestrictionSelected(
isSelected = restriction == GenderRestriction.FEMALE_ONLY,
imageView = binding.ivGenderFemaleOnly,
container = binding.llGenderFemaleOnly,
textView = binding.tvGenderFemaleOnly
)
}
private fun setGenderRestrictionSelected(
isSelected: Boolean,
imageView: android.widget.ImageView,
container: android.widget.LinearLayout,
textView: android.widget.TextView
) {
imageView.visibility = if (isSelected) View.VISIBLE else View.GONE
container.setBackgroundResource(
if (isSelected) {
R.drawable.bg_round_corner_6_7_3bb9f1
} else {
R.drawable.bg_round_corner_6_7_13181b
}
)
textView.setTextColor(
ContextCompat.getColor(
applicationContext,
if (isSelected) {
R.color.color_eeeeee
} else {
R.color.color_3bb9f1
}
)
)
} }
} }

View File

@@ -6,18 +6,18 @@ import com.google.gson.Gson
import com.orhanobut.logger.Logger import com.orhanobut.logger.Logger
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.base.BaseViewModel import kr.co.vividnext.sodalive.base.BaseViewModel
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import kr.co.vividnext.sodalive.common.UiText import kr.co.vividnext.sodalive.common.UiText
import kr.co.vividnext.sodalive.common.UiText.DynamicString import kr.co.vividnext.sodalive.common.UiText.DynamicString
import kr.co.vividnext.sodalive.common.UiText.StringResource import kr.co.vividnext.sodalive.common.UiText.StringResource
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
import kr.co.vividnext.sodalive.extensions.convertDateFormat import kr.co.vividnext.sodalive.extensions.convertDateFormat
import kr.co.vividnext.sodalive.live.LiveRepository import kr.co.vividnext.sodalive.live.LiveRepository
import kr.co.vividnext.sodalive.live.room.GenderRestriction
import kr.co.vividnext.sodalive.live.room.detail.GetRoomDetailResponse import kr.co.vividnext.sodalive.live.room.detail.GetRoomDetailResponse
import kr.co.vividnext.sodalive.R
import kr.co.vividnext.sodalive.settings.language.LanguageManager import kr.co.vividnext.sodalive.settings.language.LanguageManager
import kr.co.vividnext.sodalive.settings.language.LocaleHelper
import kr.co.vividnext.sodalive.common.SodaLiveApplicationHolder
import okhttp3.MediaType.Companion.toMediaType import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.RequestBody.Companion.toRequestBody
import java.util.Locale import java.util.Locale
@@ -39,6 +39,14 @@ class LiveRoomEditViewModel(
val toastLiveData: LiveData<UiText?> val toastLiveData: LiveData<UiText?>
get() = _toastLiveData get() = _toastLiveData
private val _isAdultLiveData = MutableLiveData(false)
val isAdultLiveData: LiveData<Boolean>
get() = _isAdultLiveData
private val _genderRestrictionLiveData = MutableLiveData(GenderRestriction.ALL)
val genderRestrictionLiveData: LiveData<GenderRestriction>
get() = _genderRestrictionLiveData
private var _isLoading = MutableLiveData(false) private var _isLoading = MutableLiveData(false)
val isLoading: LiveData<Boolean> val isLoading: LiveData<Boolean>
get() = _isLoading get() = _isLoading
@@ -51,6 +59,8 @@ class LiveRoomEditViewModel(
var beginDate = "" var beginDate = ""
var beginTime = "" var beginTime = ""
var beginDateTimeStr = "" var beginDateTimeStr = ""
var isAdultValue = false
var genderRestrictionValue = GenderRestriction.ALL
fun setReservationDate(dateString: String) { fun setReservationDate(dateString: String) {
_reservationDateLiveData.postValue(dateString) _reservationDateLiveData.postValue(dateString)
@@ -63,6 +73,11 @@ class LiveRoomEditViewModel(
fun updateLiveRoom(onSuccess: () -> Unit) { fun updateLiveRoom(onSuccess: () -> Unit) {
if (!_isLoading.value!! && validateData()) { if (!_isLoading.value!! && validateData()) {
_isLoading.value = true _isLoading.value = true
val normalizedGenderRestriction = if (isAdultValue) {
genderRestrictionValue
} else {
GenderRestriction.ALL
}
val request = EditLiveRoomInfoRequest( val request = EditLiveRoomInfoRequest(
title = if (title != roomDetail.title) { title = if (title != roomDetail.title) {
title title
@@ -84,14 +99,28 @@ class LiveRoomEditViewModel(
} else { } else {
null null
}, },
timezone = TimeZone.getDefault().id timezone = TimeZone.getDefault().id,
isAdult = if (isAdultValue != roomDetail.isAdult) {
isAdultValue
} else {
null
},
genderRestriction = if (!isAdultValue) {
GenderRestriction.ALL
} else if (normalizedGenderRestriction != roomDetail.genderRestriction) {
normalizedGenderRestriction
} else {
null
}
) )
if ( if (
request.title == null && request.title == null &&
request.notice == null && request.notice == null &&
request.numberOfPeople == null && request.numberOfPeople == null &&
request.beginDateTimeString == null request.beginDateTimeString == null &&
request.isAdult == null &&
request.genderRestriction == null
) { ) {
_toastLiveData.value = StringResource(R.string.msg_live_room_edit_no_changes) _toastLiveData.value = StringResource(R.string.msg_live_room_edit_no_changes)
_isLoading.value = false _isLoading.value = false
@@ -170,6 +199,16 @@ class LiveRoomEditViewModel(
) )
beginDateTimeStr = "$beginDate $beginTime" beginDateTimeStr = "$beginDate $beginTime"
isAdultValue = roomDetail.isAdult
genderRestrictionValue = if (roomDetail.isAdult) {
roomDetail.genderRestriction
} else {
GenderRestriction.ALL
}
_isAdultLiveData.value = isAdultValue
_genderRestrictionLiveData.value = genderRestrictionValue
} }
private fun validateData(): Boolean { private fun validateData(): Boolean {
@@ -196,4 +235,17 @@ class LiveRoomEditViewModel(
return true return true
} }
fun setAdult(isAdult: Boolean) {
isAdultValue = isAdult
_isAdultLiveData.value = isAdult
if (!isAdult) {
setGenderRestriction(GenderRestriction.ALL)
}
}
fun setGenderRestriction(genderRestriction: GenderRestriction) {
genderRestrictionValue = genderRestriction
_genderRestrictionLiveData.value = genderRestriction
}
} }

View File

@@ -848,6 +848,119 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_gender_restriction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:fontFamily="@font/bold"
android:lineSpacingExtra="5sp"
android:text="@string/screen_live_room_create_gender_restriction_label"
android:textColor="@color/color_eeeeee"
android:textSize="16.7sp" />
<LinearLayout
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_gender_all"
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_gender_all"
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_gender_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_gender_restriction_all"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_gender_male_only"
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_gender_male_only"
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_gender_male_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_gender_restriction_male_only"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_gender_female_only"
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_gender_female_only"
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_gender_female_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_gender_restriction_female_only"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout

View File

@@ -234,6 +234,203 @@
android:textCursorDrawable="@drawable/edit_text_cursor" android:textCursorDrawable="@drawable/edit_text_cursor"
android:textSize="14.7sp" android:textSize="14.7sp"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<LinearLayout
android:id="@+id/ll_set_adult"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="33.3dp"
android:fontFamily="@font/bold"
android:lineSpacingExtra="5sp"
android:text="@string/screen_live_room_create_age_label"
android:textColor="@color/color_eeeeee"
android:textSize="16.7sp" />
<LinearLayout
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_age_all"
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_age_all"
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_age_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_age_all"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_age_19"
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_age_19"
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_age_19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_age_limit_adult"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_gender_restriction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:fontFamily="@font/bold"
android:lineSpacingExtra="5sp"
android:text="@string/screen_live_room_create_gender_restriction_label"
android:textColor="@color/color_eeeeee"
android:textSize="16.7sp" />
<LinearLayout
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_gender_all"
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_gender_all"
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_gender_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_gender_restriction_all"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_gender_male_only"
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_gender_male_only"
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_gender_male_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_gender_restriction_male_only"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_gender_female_only"
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_gender_female_only"
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_gender_female_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/bold"
android:text="@string/screen_live_room_create_gender_restriction_female_only"
android:textColor="@color/color_3bb9f1"
android:textSize="14.7sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View File

@@ -615,6 +615,10 @@
<string name="screen_live_room_create_creator_join_unavailable">Not allowed</string> <string name="screen_live_room_create_creator_join_unavailable">Not allowed</string>
<string name="screen_live_room_create_age_label">Age limit</string> <string name="screen_live_room_create_age_label">Age limit</string>
<string name="screen_live_room_create_age_all">All ages</string> <string name="screen_live_room_create_age_all">All ages</string>
<string name="screen_live_room_create_gender_restriction_label">Gender restriction</string>
<string name="screen_live_room_create_gender_restriction_all">All</string>
<string name="screen_live_room_create_gender_restriction_male_only">Male only</string>
<string name="screen_live_room_create_gender_restriction_female_only">Female only</string>
<string name="screen_live_room_create_price_label">Ticket price</string> <string name="screen_live_room_create_price_label">Ticket price</string>
<string name="screen_live_room_create_price_free">Free</string> <string name="screen_live_room_create_price_free">Free</string>
<string name="screen_live_room_create_price_100">100 cans</string> <string name="screen_live_room_create_price_100">100 cans</string>

View File

@@ -615,6 +615,10 @@
<string name="screen_live_room_create_creator_join_unavailable">不可</string> <string name="screen_live_room_create_creator_join_unavailable">不可</string>
<string name="screen_live_room_create_age_label">年齢制限</string> <string name="screen_live_room_create_age_label">年齢制限</string>
<string name="screen_live_room_create_age_all">全年齢</string> <string name="screen_live_room_create_age_all">全年齢</string>
<string name="screen_live_room_create_gender_restriction_label">性別制限</string>
<string name="screen_live_room_create_gender_restriction_all">全体</string>
<string name="screen_live_room_create_gender_restriction_male_only">男性のみ</string>
<string name="screen_live_room_create_gender_restriction_female_only">女性のみ</string>
<string name="screen_live_room_create_price_label">チケット価格</string> <string name="screen_live_room_create_price_label">チケット価格</string>
<string name="screen_live_room_create_price_free">無料</string> <string name="screen_live_room_create_price_free">無料</string>
<string name="screen_live_room_create_price_100">100CAN</string> <string name="screen_live_room_create_price_100">100CAN</string>

View File

@@ -614,6 +614,10 @@
<string name="screen_live_room_create_creator_join_unavailable">불가능</string> <string name="screen_live_room_create_creator_join_unavailable">불가능</string>
<string name="screen_live_room_create_age_label">연령 제한</string> <string name="screen_live_room_create_age_label">연령 제한</string>
<string name="screen_live_room_create_age_all">전체 연령</string> <string name="screen_live_room_create_age_all">전체 연령</string>
<string name="screen_live_room_create_gender_restriction_label">성별 제한</string>
<string name="screen_live_room_create_gender_restriction_all">전체</string>
<string name="screen_live_room_create_gender_restriction_male_only">남자만</string>
<string name="screen_live_room_create_gender_restriction_female_only">여자만</string>
<string name="screen_live_room_create_price_label">티켓 가격</string> <string name="screen_live_room_create_price_label">티켓 가격</string>
<string name="screen_live_room_create_price_free">무료</string> <string name="screen_live_room_create_price_free">무료</string>
<string name="screen_live_room_create_price_100">100 캔</string> <string name="screen_live_room_create_price_100">100 캔</string>