parent
3fe01f8def
commit
db364d9bf7
|
@ -479,6 +479,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
binding.tvMenuPan.setOnClickListener { viewModel.toggleShowMenuPan() }
|
||||
|
||||
binding.tvBgSwitch.setOnClickListener { viewModel.toggleBackgroundImage() }
|
||||
binding.tvSignatureSwitch.setOnClickListener { viewModel.toggleSignatureImage() }
|
||||
binding.llDonation.setOnClickListener {
|
||||
LiveRoomDonationRankingDialog(
|
||||
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) {
|
||||
if (it) {
|
||||
loadingDialog.show(screenWidth)
|
||||
|
@ -770,21 +796,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
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) {
|
||||
binding.llViewUsers.visibility = View.VISIBLE
|
||||
binding.llViewUsers.setOnClickListener { roomProfileDialog.show() }
|
||||
|
@ -1790,12 +1801,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
|
||||
private fun showSignatureImage() {
|
||||
if (signature != null) {
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signature!!.imageUrl)
|
||||
.into(binding.ivSignature)
|
||||
if (viewModel.isSignatureOn.value!!) {
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signature!!.imageUrl)
|
||||
.into(binding.ivSignature)
|
||||
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
handler.postDelayed({
|
||||
if (signatureList.isNotEmpty()) {
|
||||
|
@ -1808,12 +1821,14 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
|||
}
|
||||
}, signature!!.time * 1000L)
|
||||
} else if (signatureImageUrl.isNotBlank()) {
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signatureImageUrl)
|
||||
.into(binding.ivSignature)
|
||||
if (viewModel.isSignatureOn.value!!) {
|
||||
Glide
|
||||
.with(this)
|
||||
.load(signatureImageUrl)
|
||||
.into(binding.ivSignature)
|
||||
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
binding.ivSignature.visibility = View.VISIBLE
|
||||
}
|
||||
handler.postDelayed({
|
||||
if (signatureImageUrlList.isNotEmpty()) {
|
||||
signatureImageUrl = signatureImageUrlList.removeAt(0)
|
||||
|
|
|
@ -84,6 +84,10 @@ class LiveRoomViewModel(
|
|||
val isBgOn: LiveData<Boolean>
|
||||
get() = _isBgOn
|
||||
|
||||
private var _isSignatureOn = MutableLiveData(true)
|
||||
val isSignatureOn: LiveData<Boolean>
|
||||
get() = _isSignatureOn
|
||||
|
||||
lateinit var getRealPathFromURI: (Uri) -> 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) {
|
||||
_isLoading.value = true
|
||||
compositeDisposable.add(
|
||||
|
@ -379,6 +346,10 @@ class LiveRoomViewModel(
|
|||
_isBgOn.value = !isBgOn.value!!
|
||||
}
|
||||
|
||||
fun toggleSignatureImage() {
|
||||
_isSignatureOn.value = !isSignatureOn.value!!
|
||||
}
|
||||
|
||||
fun editLiveRoomInfo(
|
||||
roomId: Long,
|
||||
newTitle: String,
|
||||
|
|
|
@ -212,6 +212,21 @@
|
|||
android:visibility="gone"
|
||||
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
|
||||
android:id="@+id/tv_bg_switch"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -227,16 +242,6 @@
|
|||
android:textSize="12sp"
|
||||
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
|
||||
android:id="@+id/iv_edit"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
Loading…
Reference in New Issue