feat(user-channel): 유저 채널의 프로필 이미지 사이즈와 섹션 순서 변경
This commit is contained in:
@@ -2,18 +2,16 @@ package kr.co.vividnext.sodalive.explorer.profile
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.Rect
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.webkit.URLUtil
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.OptIn
|
||||
@@ -94,7 +92,7 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
userId = intent.getLongExtra(Constants.EXTRA_USER_ID, 0)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
imm = getSystemService(Service.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
if (userId <= 0) {
|
||||
Toast.makeText(applicationContext, "잘못된 요청입니다.", Toast.LENGTH_LONG).show()
|
||||
finish()
|
||||
@@ -109,7 +107,6 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
|
||||
override fun setupView() {
|
||||
loadingDialog = LoadingDialog(this, layoutInflater)
|
||||
binding.tvBack.text = "채널"
|
||||
binding.tvBack.setOnClickListener { finish() }
|
||||
binding.ivMenu.setOnClickListener {
|
||||
showOptionMenu(
|
||||
@@ -189,7 +186,7 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
val dialog = AlertDialog.Builder(this)
|
||||
dialog.setTitle("사용자 차단")
|
||||
dialog.setMessage(
|
||||
"${binding.layoutUserProfile.tvNickname.text}님을 차단하시겠습니까?\n\n" +
|
||||
"${binding.tvNickname.text}님을 차단하시겠습니까?\n\n" +
|
||||
"사용자를 차단하면 사용자는 아래 기능이 제한됩니다.\n" +
|
||||
"- 내가 개설한 라이브 입장 불가\n" +
|
||||
"- 나에게 메시지 보내기 불가\n" +
|
||||
@@ -593,25 +590,15 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
setCheers(it.cheers)
|
||||
|
||||
if (it.isCreator) {
|
||||
binding.layoutUserProfile.ivShare.visibility = View.VISIBLE
|
||||
setSeriesList(it.seriesList)
|
||||
setAudioContentList(it.contentList)
|
||||
setLiveRoomList(it.liveRoomList)
|
||||
setUserDonationRanking(it.userDonationRanking)
|
||||
setActivitySummary(it.activitySummary)
|
||||
setCommunityPostList(it.communityPostList)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setActivitySummary(activitySummary: GetCreatorActivitySummary) {
|
||||
binding.llActivitySummary.visibility = View.VISIBLE
|
||||
binding.tvLiveCount.text = activitySummary.liveCount.moneyFormat()
|
||||
binding.tvLiveContributorCount.text = activitySummary.liveContributorCount.moneyFormat()
|
||||
binding.tvLiveTime.text = activitySummary.liveTime.moneyFormat()
|
||||
binding.tvContentCount.text = activitySummary.contentCount.moneyFormat()
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged", "SetTextI18n")
|
||||
private fun setCheers(cheers: GetCheersResponse) {
|
||||
binding.layoutUserProfileFanTalk.etCheer.setText("")
|
||||
@@ -644,84 +631,25 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun setCreatorProfile(creator: CreatorResponse) {
|
||||
val layoutUserProfile = binding.layoutUserProfile
|
||||
|
||||
layoutUserProfile.ivShare.setOnClickListener {
|
||||
viewModel.shareChannel(
|
||||
userId = creator.creatorId,
|
||||
nickname = creator.nickname
|
||||
) {
|
||||
val intent = Intent(Intent.ACTION_SEND)
|
||||
intent.type = "text/plain"
|
||||
intent.putExtra(Intent.EXTRA_TEXT, it)
|
||||
|
||||
val shareIntent = Intent.createChooser(intent, "채널 공유")
|
||||
startActivity(shareIntent)
|
||||
}
|
||||
}
|
||||
binding.ivProfile.load(creator.profileUrl)
|
||||
binding.tvNickname.text = creator.nickname
|
||||
|
||||
if (creator.creatorId == SharedPreferenceManager.userId) {
|
||||
layoutUserProfile.tvFollowerList.visibility = View.VISIBLE
|
||||
layoutUserProfile.llNotification.visibility = View.GONE
|
||||
binding.tvFollowerList.visibility = View.VISIBLE
|
||||
binding.ivNotification.visibility = View.GONE
|
||||
|
||||
layoutUserProfile.tvFollowerList.setOnClickListener {
|
||||
binding.tvFollowerList.setOnClickListener {
|
||||
val intent = Intent(applicationContext, UserFollowerListActivity::class.java)
|
||||
intent.putExtra(Constants.EXTRA_USER_ID, creator.creatorId)
|
||||
startActivity(intent)
|
||||
}
|
||||
} else {
|
||||
layoutUserProfile.llNotification.visibility = View.VISIBLE
|
||||
layoutUserProfile.tvFollowerList.visibility = View.GONE
|
||||
}
|
||||
|
||||
layoutUserProfile.ivProfile.load(creator.profileUrl) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.ic_place_holder)
|
||||
transformations(CircleCropTransformation())
|
||||
}
|
||||
|
||||
binding.tvBack.text = "${creator.nickname}님의 채널"
|
||||
layoutUserProfile.tvNickname.text = creator.nickname
|
||||
layoutUserProfile.tvTags.text = creator.tags.joinToString(" ") { "#$it" }
|
||||
|
||||
if (creator.websiteUrl.isNullOrBlank() || !URLUtil.isValidUrl(creator.websiteUrl)) {
|
||||
layoutUserProfile.ivWebsite.visibility = View.GONE
|
||||
} else {
|
||||
layoutUserProfile.ivWebsite.visibility = View.VISIBLE
|
||||
layoutUserProfile.ivWebsite.setOnClickListener {
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(creator.websiteUrl)))
|
||||
}
|
||||
}
|
||||
|
||||
if (creator.blogUrl.isNullOrBlank() || !URLUtil.isValidUrl(creator.blogUrl)) {
|
||||
layoutUserProfile.ivBlog.visibility = View.GONE
|
||||
} else {
|
||||
layoutUserProfile.ivBlog.visibility = View.VISIBLE
|
||||
layoutUserProfile.ivBlog.setOnClickListener {
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(creator.blogUrl)))
|
||||
}
|
||||
}
|
||||
|
||||
if (creator.instagramUrl.isNullOrBlank() || !URLUtil.isValidUrl(creator.instagramUrl)) {
|
||||
layoutUserProfile.ivInstagram.visibility = View.GONE
|
||||
} else {
|
||||
layoutUserProfile.ivInstagram.visibility = View.VISIBLE
|
||||
layoutUserProfile.ivInstagram.setOnClickListener {
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(creator.instagramUrl)))
|
||||
}
|
||||
}
|
||||
|
||||
if (creator.youtubeUrl.isNullOrBlank() || !URLUtil.isValidUrl(creator.youtubeUrl)) {
|
||||
layoutUserProfile.ivYoutube.visibility = View.GONE
|
||||
} else {
|
||||
layoutUserProfile.ivYoutube.visibility = View.VISIBLE
|
||||
layoutUserProfile.ivYoutube.setOnClickListener {
|
||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(creator.youtubeUrl)))
|
||||
}
|
||||
binding.ivNotification.visibility = View.VISIBLE
|
||||
binding.tvFollowerList.visibility = View.GONE
|
||||
}
|
||||
|
||||
if (creator.isFollow) {
|
||||
layoutUserProfile.ivNotification.setImageResource(
|
||||
binding.ivNotification.setImageResource(
|
||||
if (creator.isNotify) {
|
||||
R.drawable.btn_following_big
|
||||
} else {
|
||||
@@ -729,7 +657,7 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
}
|
||||
)
|
||||
|
||||
layoutUserProfile.ivNotification.setOnClickListener {
|
||||
binding.ivNotification.setOnClickListener {
|
||||
if (notifyFragment == null) {
|
||||
notifyFragment = CreatorFollowNotifyFragment(
|
||||
onClickNotifyAll = {
|
||||
@@ -748,15 +676,39 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
|
||||
notifyFragment!!.show(supportFragmentManager, notifyFragment!!.tag)
|
||||
}
|
||||
} else {
|
||||
layoutUserProfile.ivNotification.setImageResource(R.drawable.btn_follow_big)
|
||||
layoutUserProfile.ivNotification.setOnClickListener {
|
||||
binding.ivNotification.setImageResource(R.drawable.btn_follow_big)
|
||||
binding.ivNotification.setOnClickListener {
|
||||
viewModel.follow(creator.creatorId)
|
||||
}
|
||||
}
|
||||
|
||||
layoutUserProfile
|
||||
binding
|
||||
.tvNotificationCount
|
||||
.text = "팔로워 ${creator.notificationRecipientCount.moneyFormat()}명"
|
||||
.text = "팔로워 ${creator.notificationRecipientCount.moneyFormat()}"
|
||||
|
||||
binding.nestedScrollView.setOnScrollChangeListener { _, _, scrollY, _, _ ->
|
||||
if (scrollY >= screenWidth) {
|
||||
binding.toolbar.setBackgroundColor(Color.BLACK)
|
||||
binding.tvBack.text = creator.nickname
|
||||
} else {
|
||||
binding.toolbar.setBackgroundColor(Color.TRANSPARENT)
|
||||
binding.tvBack.text = ""
|
||||
}
|
||||
}
|
||||
|
||||
binding.ivShare.setOnClickListener {
|
||||
viewModel.shareChannel(
|
||||
userId = creator.creatorId,
|
||||
nickname = creator.nickname
|
||||
) {
|
||||
val intent = Intent(Intent.ACTION_SEND)
|
||||
intent.type = "text/plain"
|
||||
intent.putExtra(Intent.EXTRA_TEXT, it)
|
||||
|
||||
val shareIntent = Intent.createChooser(intent, "채널 공유")
|
||||
startActivity(shareIntent)
|
||||
}
|
||||
}
|
||||
|
||||
val introduce = creator.introduce.ifBlank {
|
||||
"채널 소개내용이 없습니다."
|
||||
|
||||
Reference in New Issue
Block a user