parent
772005910c
commit
78323103fd
|
@ -4,10 +4,10 @@
|
||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<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">
|
<Target type="DEFAULT_BOOT">
|
||||||
<handle>
|
<handle>
|
||||||
<DeviceId pluginId="LocalEmulator" identifier="path=/Users/klaus/.android/avd/Pixel_8_Pro_API_34.avd" />
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=2cec640c34017ece" />
|
||||||
</handle>
|
</handle>
|
||||||
</Target>
|
</Target>
|
||||||
</DropdownSelection>
|
</DropdownSelection>
|
||||||
|
|
|
@ -35,8 +35,8 @@ android {
|
||||||
applicationId "kr.co.vividnext.sodalive"
|
applicationId "kr.co.vividnext.sodalive"
|
||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 104
|
versionCode 106
|
||||||
versionName "1.17.0"
|
versionName "1.18.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
@ -46,6 +46,7 @@ import io.agora.rtm.RtmMessageType
|
||||||
import kr.co.vividnext.sodalive.R
|
import kr.co.vividnext.sodalive.R
|
||||||
import kr.co.vividnext.sodalive.agora.Agora
|
import kr.co.vividnext.sodalive.agora.Agora
|
||||||
import kr.co.vividnext.sodalive.base.BaseActivity
|
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.Constants
|
||||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||||
import kr.co.vividnext.sodalive.common.RealPathUtil
|
import kr.co.vividnext.sodalive.common.RealPathUtil
|
||||||
|
@ -689,6 +690,20 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
it?.let { showToast(it) }
|
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) {
|
donationMessageViewModel.isLoading.observe(this) {
|
||||||
if (it) {
|
if (it) {
|
||||||
loadingDialog.show(screenWidth)
|
loadingDialog.show(screenWidth)
|
||||||
|
@ -758,10 +773,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
if (response.creatorId == SharedPreferenceManager.userId) {
|
if (response.creatorId == SharedPreferenceManager.userId) {
|
||||||
binding.ivEdit.setOnClickListener {
|
binding.ivEdit.setOnClickListener {
|
||||||
viewModel.getAllMenuPreset {
|
viewModel.getAllMenuPreset {
|
||||||
roomInfoEditDialog.setRoomInfo(response.title, response.notice)
|
roomInfoEditDialog.setRoomInfo(
|
||||||
|
response.title,
|
||||||
|
response.notice,
|
||||||
|
response.isAdult
|
||||||
|
)
|
||||||
roomInfoEditDialog.setCoverImageUrl(response.coverImageUrl)
|
roomInfoEditDialog.setCoverImageUrl(response.coverImageUrl)
|
||||||
roomInfoEditDialog.setMenuPreset(it)
|
roomInfoEditDialog.setMenuPreset(it)
|
||||||
roomInfoEditDialog.setConfirmAction { newTitle, newContent, newCoverImageUri, isActivateMenu, menuId, menu ->
|
roomInfoEditDialog.setConfirmAction { newTitle, newContent, newCoverImageUri, isActivateMenu, menuId, menu, isAdult ->
|
||||||
viewModel.editLiveRoomInfo(
|
viewModel.editLiveRoomInfo(
|
||||||
response.roomId,
|
response.roomId,
|
||||||
newTitle,
|
newTitle,
|
||||||
|
@ -770,6 +789,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
isActivateMenu,
|
isActivateMenu,
|
||||||
menuId,
|
menuId,
|
||||||
menu,
|
menu,
|
||||||
|
isAdult,
|
||||||
onSuccess = {
|
onSuccess = {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
applicationContext,
|
applicationContext,
|
||||||
|
@ -1639,10 +1659,8 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
Logger.e("onAudioVolumeIndication - $speakers")
|
Logger.e("onAudioVolumeIndication - $speakers")
|
||||||
|
|
||||||
val activeSpeakerIds = speakers
|
val activeSpeakerIds = speakers
|
||||||
.asSequence()
|
|
||||||
.filter { it.volume > 0 }
|
.filter { it.volume > 0 }
|
||||||
.map { it.uid }
|
.map { it.uid }
|
||||||
.toList()
|
|
||||||
|
|
||||||
Logger.e("onAudioVolumeIndication - $activeSpeakerIds")
|
Logger.e("onAudioVolumeIndication - $activeSpeakerIds")
|
||||||
handler.post {
|
handler.post {
|
||||||
|
|
|
@ -72,6 +72,10 @@ class LiveRoomViewModel(
|
||||||
val coverImageUrlLiveData: LiveData<String>
|
val coverImageUrlLiveData: LiveData<String>
|
||||||
get() = _coverImageUrlLiveData
|
get() = _coverImageUrlLiveData
|
||||||
|
|
||||||
|
private val _changeIsAdultLiveData = MutableLiveData(false)
|
||||||
|
val changeIsAdultLiveData: LiveData<Boolean>
|
||||||
|
get() = _changeIsAdultLiveData
|
||||||
|
|
||||||
lateinit var roomInfoResponse: GetRoomInfoResponse
|
lateinit var roomInfoResponse: GetRoomInfoResponse
|
||||||
|
|
||||||
fun isRoomInfoInitialized() = this::roomInfoResponse.isInitialized
|
fun isRoomInfoInitialized() = this::roomInfoResponse.isInitialized
|
||||||
|
@ -212,6 +216,10 @@ class LiveRoomViewModel(
|
||||||
|
|
||||||
getTotalDonationCan(roomId = roomId)
|
getTotalDonationCan(roomId = roomId)
|
||||||
|
|
||||||
|
if (it.data.isAdult && !SharedPreferenceManager.isAuth) {
|
||||||
|
_changeIsAdultLiveData.value = true
|
||||||
|
}
|
||||||
|
|
||||||
if (userId > 0 && it.data.creatorId == SharedPreferenceManager.userId) {
|
if (userId > 0 && it.data.creatorId == SharedPreferenceManager.userId) {
|
||||||
val nickname = getUserNickname(userId)
|
val nickname = getUserNickname(userId)
|
||||||
onSuccess(nickname)
|
onSuccess(nickname)
|
||||||
|
@ -425,6 +433,7 @@ class LiveRoomViewModel(
|
||||||
isActivateMenu: Boolean?,
|
isActivateMenu: Boolean?,
|
||||||
menuId: Long,
|
menuId: Long,
|
||||||
menu: String,
|
menu: String,
|
||||||
|
isAdult: Boolean?,
|
||||||
onSuccess: () -> Unit
|
onSuccess: () -> Unit
|
||||||
) {
|
) {
|
||||||
val request = EditLiveRoomInfoRequest(
|
val request = EditLiveRoomInfoRequest(
|
||||||
|
@ -443,13 +452,15 @@ class LiveRoomViewModel(
|
||||||
timezone = null,
|
timezone = null,
|
||||||
menuPanId = if (isActivateMenu == true) menuId else 0,
|
menuPanId = if (isActivateMenu == true) menuId else 0,
|
||||||
menuPan = if (isActivateMenu == true) menu else "",
|
menuPan = if (isActivateMenu == true) menu else "",
|
||||||
isActiveMenuPan = isActivateMenu
|
isActiveMenuPan = isActivateMenu,
|
||||||
|
isAdult = isAdult
|
||||||
)
|
)
|
||||||
|
|
||||||
val requestJson = if (
|
val requestJson = if (
|
||||||
request.title != null ||
|
request.title != null ||
|
||||||
request.notice != null ||
|
request.notice != null ||
|
||||||
request.isActiveMenuPan != null ||
|
request.isActiveMenuPan != null ||
|
||||||
|
request.isAdult != null ||
|
||||||
request.menuPan.isNotBlank()
|
request.menuPan.isNotBlank()
|
||||||
) {
|
) {
|
||||||
Gson().toJson(request)
|
Gson().toJson(request)
|
||||||
|
|
|
@ -12,5 +12,6 @@ data class EditLiveRoomInfoRequest(
|
||||||
@SerializedName("timezone") val timezone: String?,
|
@SerializedName("timezone") val timezone: String?,
|
||||||
@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
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,6 +19,7 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import coil.load
|
import coil.load
|
||||||
import coil.transform.RoundedCornersTransformation
|
import coil.transform.RoundedCornersTransformation
|
||||||
import kr.co.vividnext.sodalive.R
|
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.databinding.DialogLiveRoomInfoUpdateBinding
|
||||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||||
import kr.co.vividnext.sodalive.live.room.create.LiveRoomCreateViewModel
|
import kr.co.vividnext.sodalive.live.room.create.LiveRoomCreateViewModel
|
||||||
|
@ -39,10 +40,12 @@ class LiveRoomInfoEditDialog(
|
||||||
private var menuId = 0L
|
private var menuId = 0L
|
||||||
private val menuList = mutableListOf<GetMenuPresetResponse>()
|
private val menuList = mutableListOf<GetMenuPresetResponse>()
|
||||||
|
|
||||||
|
private val isAdultLiveData = MutableLiveData(false)
|
||||||
private val isActivateMenuLiveData = MutableLiveData(false)
|
private val isActivateMenuLiveData = MutableLiveData(false)
|
||||||
private val selectedMenuLiveData = MutableLiveData<LiveRoomCreateViewModel.SelectedMenu>()
|
private val selectedMenuLiveData = MutableLiveData<LiveRoomCreateViewModel.SelectedMenu>()
|
||||||
|
|
||||||
private var menu: String = ""
|
private var menu: String = ""
|
||||||
|
private var isAdult: Boolean = false
|
||||||
private var isActivateMenu: Boolean? = null
|
private var isActivateMenu: Boolean? = null
|
||||||
|
|
||||||
private lateinit var selectedMenu: LiveRoomCreateViewModel.SelectedMenu
|
private lateinit var selectedMenu: LiveRoomCreateViewModel.SelectedMenu
|
||||||
|
@ -96,6 +99,15 @@ class LiveRoomInfoEditDialog(
|
||||||
selectMenuPreset(LiveRoomCreateViewModel.SelectedMenu.MENU_3)
|
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) {
|
selectedMenuLiveData.observe(activity) {
|
||||||
deselectAllMenuPreset()
|
deselectAllMenuPreset()
|
||||||
|
|
||||||
|
@ -129,14 +141,28 @@ class LiveRoomInfoEditDialog(
|
||||||
dialogView.ivSwitch.setImageResource(R.drawable.btn_toggle_off_big)
|
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(
|
fun setRoomInfo(
|
||||||
currentTitle: String,
|
currentTitle: String,
|
||||||
currentContent: String,
|
currentContent: String,
|
||||||
|
isAdult: Boolean
|
||||||
) {
|
) {
|
||||||
dialogView.etTitle.setText(currentTitle)
|
dialogView.etTitle.setText(currentTitle)
|
||||||
dialogView.etNotice.setText(currentContent)
|
dialogView.etNotice.setText(currentContent)
|
||||||
|
|
||||||
|
this.isAdult = isAdult
|
||||||
|
isAdultLiveData.value = isAdult
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setCoverImageUri(coverImageUri: Uri) {
|
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 {
|
dialogView.tvConfirm.setOnClickListener {
|
||||||
alertDialog.dismiss()
|
alertDialog.dismiss()
|
||||||
|
|
||||||
|
@ -202,7 +228,12 @@ class LiveRoomInfoEditDialog(
|
||||||
isActivateMenu
|
isActivateMenu
|
||||||
},
|
},
|
||||||
menuId,
|
menuId,
|
||||||
menu
|
menu,
|
||||||
|
if (isAdult != isAdultLiveData.value!!) {
|
||||||
|
isAdultLiveData.value!!
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
)
|
)
|
||||||
coverImageUri = null
|
coverImageUri = null
|
||||||
coverImageUrl = null
|
coverImageUrl = null
|
||||||
|
|
|
@ -138,6 +138,48 @@
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</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
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:background="@drawable/bg_round_corner_10_13181b">
|
android:background="@drawable/bg_round_corner_10_13181b"
|
||||||
|
android:paddingHorizontal="24dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_title"
|
android:id="@+id/tv_title"
|
||||||
|
@ -27,7 +28,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="6dp"
|
android:layout_marginTop="6dp"
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
android:gravity="center"
|
|
||||||
android:textColor="@color/color_bbbbbb"
|
android:textColor="@color/color_bbbbbb"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -38,7 +38,6 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16.7dp"
|
|
||||||
android:layout_marginTop="45dp"
|
android:layout_marginTop="45dp"
|
||||||
android:layout_marginBottom="16.7dp"
|
android:layout_marginBottom="16.7dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
|
Loading…
Reference in New Issue