parent
772005910c
commit
78323103fd
|
@ -4,10 +4,10 @@
|
|||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2024-08-26T10:43:24.248064Z">
|
||||
<DropdownSelection timestamp="2024-09-10T15:44:07.634320Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/klaus/.android/avd/Pixel_8_Pro_API_34.avd" />
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=2cec640c34017ece" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
|
|
|
@ -35,8 +35,8 @@ android {
|
|||
applicationId "kr.co.vividnext.sodalive"
|
||||
minSdk 23
|
||||
targetSdk 34
|
||||
versionCode 104
|
||||
versionName "1.17.0"
|
||||
versionCode 106
|
||||
versionName "1.18.0"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
@ -46,6 +46,7 @@ import io.agora.rtm.RtmMessageType
|
|||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.agora.Agora
|
||||
import kr.co.vividnext.sodalive.base.BaseActivity
|
||||
import kr.co.vividnext.sodalive.base.SodaDialog
|
||||
import kr.co.vividnext.sodalive.common.Constants
|
||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||
import kr.co.vividnext.sodalive.common.RealPathUtil
|
||||
|
@ -689,6 +690,20 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
it?.let { showToast(it) }
|
||||
}
|
||||
|
||||
viewModel.changeIsAdultLiveData.observe(this) {
|
||||
if (it && !SharedPreferenceManager.isAuth) {
|
||||
agora.muteAllRemoteAudioStreams(true)
|
||||
binding.rvChat.visibility = View.INVISIBLE
|
||||
SodaDialog(this@LiveRoomActivity,
|
||||
layoutInflater,
|
||||
"알림",
|
||||
"지금 참여하던 라이브는 '19세 이상' 연령제한이 설정되어 정보통신망 이용촉진 및 정보 보호 등에 관한 법률 및 청소년 보호법의 규정에 의해 만 19세 미만의 청소년은 이용할 수 없습니다.\n마이페이지에서 본인인증 후 다시 이용하시기 바랍니다.",
|
||||
"확인",
|
||||
{ finish() }
|
||||
).show(screenWidth)
|
||||
}
|
||||
}
|
||||
|
||||
donationMessageViewModel.isLoading.observe(this) {
|
||||
if (it) {
|
||||
loadingDialog.show(screenWidth)
|
||||
|
@ -758,10 +773,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
if (response.creatorId == SharedPreferenceManager.userId) {
|
||||
binding.ivEdit.setOnClickListener {
|
||||
viewModel.getAllMenuPreset {
|
||||
roomInfoEditDialog.setRoomInfo(response.title, response.notice)
|
||||
roomInfoEditDialog.setRoomInfo(
|
||||
response.title,
|
||||
response.notice,
|
||||
response.isAdult
|
||||
)
|
||||
roomInfoEditDialog.setCoverImageUrl(response.coverImageUrl)
|
||||
roomInfoEditDialog.setMenuPreset(it)
|
||||
roomInfoEditDialog.setConfirmAction { newTitle, newContent, newCoverImageUri, isActivateMenu, menuId, menu ->
|
||||
roomInfoEditDialog.setConfirmAction { newTitle, newContent, newCoverImageUri, isActivateMenu, menuId, menu, isAdult ->
|
||||
viewModel.editLiveRoomInfo(
|
||||
response.roomId,
|
||||
newTitle,
|
||||
|
@ -770,6 +789,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
isActivateMenu,
|
||||
menuId,
|
||||
menu,
|
||||
isAdult,
|
||||
onSuccess = {
|
||||
Toast.makeText(
|
||||
applicationContext,
|
||||
|
@ -1639,10 +1659,8 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
Logger.e("onAudioVolumeIndication - $speakers")
|
||||
|
||||
val activeSpeakerIds = speakers
|
||||
.asSequence()
|
||||
.filter { it.volume > 0 }
|
||||
.map { it.uid }
|
||||
.toList()
|
||||
|
||||
Logger.e("onAudioVolumeIndication - $activeSpeakerIds")
|
||||
handler.post {
|
||||
|
|
|
@ -72,6 +72,10 @@ class LiveRoomViewModel(
|
|||
val coverImageUrlLiveData: LiveData<String>
|
||||
get() = _coverImageUrlLiveData
|
||||
|
||||
private val _changeIsAdultLiveData = MutableLiveData(false)
|
||||
val changeIsAdultLiveData: LiveData<Boolean>
|
||||
get() = _changeIsAdultLiveData
|
||||
|
||||
lateinit var roomInfoResponse: GetRoomInfoResponse
|
||||
|
||||
fun isRoomInfoInitialized() = this::roomInfoResponse.isInitialized
|
||||
|
@ -212,6 +216,10 @@ class LiveRoomViewModel(
|
|||
|
||||
getTotalDonationCan(roomId = roomId)
|
||||
|
||||
if (it.data.isAdult && !SharedPreferenceManager.isAuth) {
|
||||
_changeIsAdultLiveData.value = true
|
||||
}
|
||||
|
||||
if (userId > 0 && it.data.creatorId == SharedPreferenceManager.userId) {
|
||||
val nickname = getUserNickname(userId)
|
||||
onSuccess(nickname)
|
||||
|
@ -425,6 +433,7 @@ class LiveRoomViewModel(
|
|||
isActivateMenu: Boolean?,
|
||||
menuId: Long,
|
||||
menu: String,
|
||||
isAdult: Boolean?,
|
||||
onSuccess: () -> Unit
|
||||
) {
|
||||
val request = EditLiveRoomInfoRequest(
|
||||
|
@ -443,13 +452,15 @@ class LiveRoomViewModel(
|
|||
timezone = null,
|
||||
menuPanId = if (isActivateMenu == true) menuId else 0,
|
||||
menuPan = if (isActivateMenu == true) menu else "",
|
||||
isActiveMenuPan = isActivateMenu
|
||||
isActiveMenuPan = isActivateMenu,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
val requestJson = if (
|
||||
request.title != null ||
|
||||
request.notice != null ||
|
||||
request.isActiveMenuPan != null ||
|
||||
request.isAdult != null ||
|
||||
request.menuPan.isNotBlank()
|
||||
) {
|
||||
Gson().toJson(request)
|
||||
|
|
|
@ -12,5 +12,6 @@ data class EditLiveRoomInfoRequest(
|
|||
@SerializedName("timezone") val timezone: String?,
|
||||
@SerializedName("menuPanId") val menuPanId: Long = 0,
|
||||
@SerializedName("menuPan") val menuPan: String = "",
|
||||
@SerializedName("isActiveMenuPan") val isActiveMenuPan: Boolean? = null
|
||||
@SerializedName("isActiveMenuPan") val isActiveMenuPan: Boolean? = null,
|
||||
@SerializedName("isAdult") val isAdult: Boolean? = null
|
||||
)
|
||||
|
|
|
@ -19,6 +19,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import coil.load
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.databinding.DialogLiveRoomInfoUpdateBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.live.room.create.LiveRoomCreateViewModel
|
||||
|
@ -39,10 +40,12 @@ class LiveRoomInfoEditDialog(
|
|||
private var menuId = 0L
|
||||
private val menuList = mutableListOf<GetMenuPresetResponse>()
|
||||
|
||||
private val isAdultLiveData = MutableLiveData(false)
|
||||
private val isActivateMenuLiveData = MutableLiveData(false)
|
||||
private val selectedMenuLiveData = MutableLiveData<LiveRoomCreateViewModel.SelectedMenu>()
|
||||
|
||||
private var menu: String = ""
|
||||
private var isAdult: Boolean = false
|
||||
private var isActivateMenu: Boolean? = null
|
||||
|
||||
private lateinit var selectedMenu: LiveRoomCreateViewModel.SelectedMenu
|
||||
|
@ -96,6 +99,15 @@ class LiveRoomInfoEditDialog(
|
|||
selectMenuPreset(LiveRoomCreateViewModel.SelectedMenu.MENU_3)
|
||||
}
|
||||
|
||||
if (SharedPreferenceManager.isAuth) {
|
||||
dialogView.llAdult.visibility = View.VISIBLE
|
||||
dialogView.ivAdultSwitch.setOnClickListener {
|
||||
isAdultLiveData.value = !isAdultLiveData.value!!
|
||||
}
|
||||
} else {
|
||||
dialogView.llAdult.visibility = View.GONE
|
||||
}
|
||||
|
||||
selectedMenuLiveData.observe(activity) {
|
||||
deselectAllMenuPreset()
|
||||
|
||||
|
@ -129,14 +141,28 @@ class LiveRoomInfoEditDialog(
|
|||
dialogView.ivSwitch.setImageResource(R.drawable.btn_toggle_off_big)
|
||||
}
|
||||
}
|
||||
|
||||
isAdultLiveData.observe(activity) {
|
||||
dialogView.ivAdultSwitch.setImageResource(
|
||||
if (it) {
|
||||
R.drawable.btn_toggle_on_big
|
||||
} else {
|
||||
R.drawable.btn_toggle_off_big
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun setRoomInfo(
|
||||
currentTitle: String,
|
||||
currentContent: String,
|
||||
isAdult: Boolean
|
||||
) {
|
||||
dialogView.etTitle.setText(currentTitle)
|
||||
dialogView.etNotice.setText(currentContent)
|
||||
|
||||
this.isAdult = isAdult
|
||||
isAdultLiveData.value = isAdult
|
||||
}
|
||||
|
||||
fun setCoverImageUri(coverImageUri: Uri) {
|
||||
|
@ -176,7 +202,7 @@ class LiveRoomInfoEditDialog(
|
|||
}
|
||||
}
|
||||
|
||||
fun setConfirmAction(confirmAction: (String, String, Uri?, Boolean?, Long, String) -> Unit) {
|
||||
fun setConfirmAction(confirmAction: (String, String, Uri?, Boolean?, Long, String, Boolean?) -> Unit) {
|
||||
dialogView.tvConfirm.setOnClickListener {
|
||||
alertDialog.dismiss()
|
||||
|
||||
|
@ -202,7 +228,12 @@ class LiveRoomInfoEditDialog(
|
|||
isActivateMenu
|
||||
},
|
||||
menuId,
|
||||
menu
|
||||
menu,
|
||||
if (isAdult != isAdultLiveData.value!!) {
|
||||
isAdultLiveData.value!!
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
coverImageUri = null
|
||||
coverImageUrl = null
|
||||
|
|
|
@ -138,6 +138,48 @@
|
|||
tools:ignore="LabelFor" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_adult"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:layout_marginTop="33.3dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_bold"
|
||||
android:text="연령제한"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="16.7sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:lineSpacingExtra="5sp"
|
||||
android:text="19세 이상"
|
||||
android:textColor="@color/color_eeeeee"
|
||||
android:textSize="13.3sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_adult_switch"
|
||||
android:layout_width="33.3dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/btn_toggle_off_big" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/bg_round_corner_10_13181b">
|
||||
android:background="@drawable/bg_round_corner_10_13181b"
|
||||
android:paddingHorizontal="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
|
@ -27,7 +28,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_bbbbbb"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -38,7 +38,6 @@
|
|||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16.7dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginBottom="16.7dp"
|
||||
android:gravity="center"
|
||||
|
|
Loading…
Reference in New Issue