parent
3fe01f8def
commit
db364d9bf7
|
@ -479,6 +479,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
binding.tvMenuPan.setOnClickListener { viewModel.toggleShowMenuPan() }
|
binding.tvMenuPan.setOnClickListener { viewModel.toggleShowMenuPan() }
|
||||||
|
|
||||||
binding.tvBgSwitch.setOnClickListener { viewModel.toggleBackgroundImage() }
|
binding.tvBgSwitch.setOnClickListener { viewModel.toggleBackgroundImage() }
|
||||||
|
binding.tvSignatureSwitch.setOnClickListener { viewModel.toggleSignatureImage() }
|
||||||
binding.llDonation.setOnClickListener {
|
binding.llDonation.setOnClickListener {
|
||||||
LiveRoomDonationRankingDialog(
|
LiveRoomDonationRankingDialog(
|
||||||
activity = this,
|
activity = this,
|
||||||
|
@ -637,6 +638,31 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.isSignatureOn.observe(this) {
|
||||||
|
if (it) {
|
||||||
|
binding.tvSignatureSwitch.text = "시그 ON"
|
||||||
|
binding.tvSignatureSwitch.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_3bb9f1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.tvSignatureSwitch
|
||||||
|
.setBackgroundResource(R.drawable.bg_round_corner_5_3_transparent_3bb9f1)
|
||||||
|
} else {
|
||||||
|
binding.tvSignatureSwitch.text = "시그 OFF"
|
||||||
|
binding.tvSignatureSwitch.setTextColor(
|
||||||
|
ContextCompat.getColor(
|
||||||
|
applicationContext,
|
||||||
|
R.color.color_eeeeee
|
||||||
|
)
|
||||||
|
)
|
||||||
|
binding.tvSignatureSwitch
|
||||||
|
.setBackgroundResource(R.drawable.bg_round_corner_5_3_transparent_bbbbbb)
|
||||||
|
binding.ivSignature.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
viewModel.isLoading.observe(this) {
|
viewModel.isLoading.observe(this) {
|
||||||
if (it) {
|
if (it) {
|
||||||
loadingDialog.show(screenWidth)
|
loadingDialog.show(screenWidth)
|
||||||
|
@ -770,21 +796,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
binding.ivEdit.visibility = View.GONE
|
binding.ivEdit.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.ivShare.setOnClickListener {
|
|
||||||
viewModel.shareRoomLink(
|
|
||||||
response.roomId,
|
|
||||||
response.isPrivateRoom,
|
|
||||||
response.password
|
|
||||||
) {
|
|
||||||
val intent = Intent(Intent.ACTION_SEND)
|
|
||||||
intent.type = "text/plain"
|
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, it)
|
|
||||||
|
|
||||||
val shareIntent = Intent.createChooser(intent, "라이브 공유")
|
|
||||||
startActivity(shareIntent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.creatorId == SharedPreferenceManager.userId) {
|
if (response.creatorId == SharedPreferenceManager.userId) {
|
||||||
binding.llViewUsers.visibility = View.VISIBLE
|
binding.llViewUsers.visibility = View.VISIBLE
|
||||||
binding.llViewUsers.setOnClickListener { roomProfileDialog.show() }
|
binding.llViewUsers.setOnClickListener { roomProfileDialog.show() }
|
||||||
|
@ -1790,12 +1801,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
|
|
||||||
private fun showSignatureImage() {
|
private fun showSignatureImage() {
|
||||||
if (signature != null) {
|
if (signature != null) {
|
||||||
|
if (viewModel.isSignatureOn.value!!) {
|
||||||
Glide
|
Glide
|
||||||
.with(this)
|
.with(this)
|
||||||
.load(signature!!.imageUrl)
|
.load(signature!!.imageUrl)
|
||||||
.into(binding.ivSignature)
|
.into(binding.ivSignature)
|
||||||
|
|
||||||
binding.ivSignature.visibility = View.VISIBLE
|
binding.ivSignature.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
handler.postDelayed({
|
handler.postDelayed({
|
||||||
if (signatureList.isNotEmpty()) {
|
if (signatureList.isNotEmpty()) {
|
||||||
|
@ -1808,12 +1821,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||||
}
|
}
|
||||||
}, signature!!.time * 1000L)
|
}, signature!!.time * 1000L)
|
||||||
} else if (signatureImageUrl.isNotBlank()) {
|
} else if (signatureImageUrl.isNotBlank()) {
|
||||||
|
if (viewModel.isSignatureOn.value!!) {
|
||||||
Glide
|
Glide
|
||||||
.with(this)
|
.with(this)
|
||||||
.load(signatureImageUrl)
|
.load(signatureImageUrl)
|
||||||
.into(binding.ivSignature)
|
.into(binding.ivSignature)
|
||||||
|
|
||||||
binding.ivSignature.visibility = View.VISIBLE
|
binding.ivSignature.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
handler.postDelayed({
|
handler.postDelayed({
|
||||||
if (signatureImageUrlList.isNotEmpty()) {
|
if (signatureImageUrlList.isNotEmpty()) {
|
||||||
signatureImageUrl = signatureImageUrlList.removeAt(0)
|
signatureImageUrl = signatureImageUrlList.removeAt(0)
|
||||||
|
|
|
@ -84,6 +84,10 @@ class LiveRoomViewModel(
|
||||||
val isBgOn: LiveData<Boolean>
|
val isBgOn: LiveData<Boolean>
|
||||||
get() = _isBgOn
|
get() = _isBgOn
|
||||||
|
|
||||||
|
private var _isSignatureOn = MutableLiveData(true)
|
||||||
|
val isSignatureOn: LiveData<Boolean>
|
||||||
|
get() = _isSignatureOn
|
||||||
|
|
||||||
lateinit var getRealPathFromURI: (Uri) -> String?
|
lateinit var getRealPathFromURI: (Uri) -> String?
|
||||||
|
|
||||||
fun getUserNickname(memberId: Int): String {
|
fun getUserNickname(memberId: Int): String {
|
||||||
|
@ -249,43 +253,6 @@ class LiveRoomViewModel(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shareRoomLink(
|
|
||||||
roomId: Long,
|
|
||||||
isPrivateRoom: Boolean,
|
|
||||||
password: String?,
|
|
||||||
onSuccess: (String) -> Unit
|
|
||||||
) {
|
|
||||||
_isLoading.value = true
|
|
||||||
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
|
||||||
link = Uri.parse("https://sodalive.net/?room_id=$roomId")
|
|
||||||
domainUriPrefix = "https://sodalive.page.link"
|
|
||||||
androidParameters { }
|
|
||||||
iosParameters("kr.co.vividnext.sodalive") {
|
|
||||||
appStoreId = "6461721697"
|
|
||||||
}
|
|
||||||
}.addOnSuccessListener {
|
|
||||||
val uri = it.shortLink
|
|
||||||
if (uri != null) {
|
|
||||||
val message = if (isPrivateRoom) {
|
|
||||||
"${SharedPreferenceManager.nickname}님이 귀하를 " +
|
|
||||||
"소다라이브의 비공개라이브에 초대하였습니다.\n" +
|
|
||||||
"※ 라이브 참여: $uri\n" +
|
|
||||||
"(입장 비밀번호 : $password)"
|
|
||||||
} else {
|
|
||||||
"${SharedPreferenceManager.nickname}님이 귀하를 " +
|
|
||||||
"소다라이브의 공개라이브에 초대하였습니다.\n" +
|
|
||||||
"※ 라이브 참여: $uri"
|
|
||||||
}
|
|
||||||
|
|
||||||
onSuccess(message)
|
|
||||||
}
|
|
||||||
}.addOnFailureListener {
|
|
||||||
_toastLiveData.postValue("공유링크를 생성하지 못했습니다.\n다시 시도해 주세요.")
|
|
||||||
}.addOnCompleteListener {
|
|
||||||
_isLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun creatorFollow(creatorId: Long, roomId: Long, isGetUserProfile: Boolean = false) {
|
fun creatorFollow(creatorId: Long, roomId: Long, isGetUserProfile: Boolean = false) {
|
||||||
_isLoading.value = true
|
_isLoading.value = true
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
|
@ -379,6 +346,10 @@ class LiveRoomViewModel(
|
||||||
_isBgOn.value = !isBgOn.value!!
|
_isBgOn.value = !isBgOn.value!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun toggleSignatureImage() {
|
||||||
|
_isSignatureOn.value = !isSignatureOn.value!!
|
||||||
|
}
|
||||||
|
|
||||||
fun editLiveRoomInfo(
|
fun editLiveRoomInfo(
|
||||||
roomId: Long,
|
roomId: Long,
|
||||||
newTitle: String,
|
newTitle: String,
|
||||||
|
|
|
@ -212,6 +212,21 @@
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:ignore="SmallSp" />
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_signature_switch"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:background="@drawable/bg_round_corner_5_3_transparent_bbbbbb"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingHorizontal="8dp"
|
||||||
|
android:paddingVertical="4.7dp"
|
||||||
|
android:text="시그 OFF"
|
||||||
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_bg_switch"
|
android:id="@+id/tv_bg_switch"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -227,16 +242,6 @@
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
tools:ignore="SmallSp" />
|
tools:ignore="SmallSp" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_share"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:background="@drawable/bg_round_corner_5_3_transparent_bbbbbb"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:src="@drawable/ic_share" />
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_edit"
|
android:id="@+id/iv_edit"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
Loading…
Reference in New Issue