feat(user-channel): 유저 채널의 프로필 이미지 사이즈와 섹션 순서 변경

This commit is contained in:
2025-10-16 00:13:05 +09:00
parent 0b775ed380
commit 2b8b581082
3 changed files with 175 additions and 284 deletions

View File

@@ -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 {
"채널 소개내용이 없습니다."

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@@ -7,216 +7,103 @@
android:background="@color/black"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="51.7dp"
android:background="@color/black"
android:paddingHorizontal="13.3dp">
<TextView
android:id="@+id/tv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/iv_menu"
android:drawablePadding="6.7dp"
android:fontFamily="@font/gmarket_sans_bold"
android:textColor="@color/color_eeeeee"
android:textSize="18.3sp"
app:drawableStartCompat="@drawable/ic_back"
tools:ignore="RelativeOverlap"
tools:text="바로, 상담 가능한 크리에이터" />
<ImageView
android:id="@+id/iv_menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:contentDescription="@null"
android:paddingHorizontal="6.7dp"
android:src="@drawable/ic_seemore_vertical" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar">
android:id="@+id/nested_scroll_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_below="@+id/toolbar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/layout_user_profile"
layout="@layout/layout_user_profile" />
<LinearLayout
android:id="@+id/ll_activity_summary"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="13.3dp"
android:background="@drawable/bg_round_corner_16_7_222222_3bb9f1"
android:baselineAligned="false"
android:gravity="center"
android:padding="13.3dp"
android:visibility="gone">
android:layout_height="wrap_content">
<RelativeLayout
<ImageView
android:id="@+id/iv_profile"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@null"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_logo_service_center" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
android:orientation="vertical"
android:paddingHorizontal="24dp"
android:paddingBottom="24dp"
app:layout_constraintBottom_toBottomOf="@+id/iv_profile"
app:layout_constraintEnd_toEndOf="@+id/iv_profile"
app:layout_constraintStart_toStartOf="@+id/iv_profile">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:fontFamily="@font/pretendard_bold"
android:maxLines="1"
android:textColor="@color/color_eeeeee"
android:textSize="32sp"
tools:text="김상담김상담김상담" />
<TextView
android:id="@+id/tv_follower_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="6.7dp"
android:background="@drawable/bg_round_corner_16_7_transparent_3bb9f1"
android:fontFamily="@font/gmarket_sans_bold"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:text="팔로워 리스트"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:contentDescription="@null"
tools:src="@drawable/btn_following_big" />
</LinearLayout>
<TextView
android:id="@+id/tv_title_live_count"
android:id="@+id/tv_notification_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="center"
android:text="라이브\n횟수"
android:textColor="@color/color_909090"
android:textSize="12sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/tv_live_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title_live_count"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:fontFamily="@font/gmarket_sans_bold"
android:textColor="@color/color_eeeeee"
android:textSize="13.3sp"
tools:text="10" />
</RelativeLayout>
<FrameLayout
android:layout_width="1dp"
android:layout_height="33.3dp"
android:layout_marginHorizontal="10dp"
android:background="@color/color_3bb9f1" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/tv_title_live_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="center"
android:text="라이브\n시간"
android:textColor="@color/color_909090"
android:textSize="12sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/tv_live_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title_live_time"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:fontFamily="@font/gmarket_sans_bold"
android:textColor="@color/color_eeeeee"
android:textSize="13.3sp"
tools:text="10" />
</RelativeLayout>
<FrameLayout
android:layout_width="1dp"
android:layout_height="33.3dp"
android:layout_marginHorizontal="10dp"
android:background="@color/color_3bb9f1" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/tv_title_live_contributor_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="center"
android:text="라이브\n참여자"
android:textColor="@color/color_909090"
android:textSize="12sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/tv_live_contributor_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title_live_contributor_count"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:fontFamily="@font/gmarket_sans_bold"
android:textColor="@color/color_eeeeee"
android:textSize="13.3sp"
tools:text="10" />
</RelativeLayout>
<FrameLayout
android:layout_width="1dp"
android:layout_height="33.3dp"
android:layout_marginHorizontal="10dp"
android:background="@color/color_3bb9f1" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:id="@+id/tv_title_content_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:fontFamily="@font/gmarket_sans_medium"
android:gravity="center"
android:text="등록\n콘텐츠"
android:textColor="@color/color_909090"
android:textSize="12sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/tv_content_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title_content_count"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:fontFamily="@font/gmarket_sans_bold"
android:textColor="@color/color_eeeeee"
android:textSize="13.3sp"
tools:text="10" />
</RelativeLayout>
</LinearLayout>
android:fontFamily="@font/pretendard_medium"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="팔로워 1,000명" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<include
android:id="@+id/layout_creator_community_post"
layout="@layout/layout_creator_community_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="26.7dp"
android:visibility="gone" />
<include
android:id="@+id/layout_creator_channel_series"
layout="@layout/layout_creator_channel_series"
android:id="@+id/layout_user_profile_live"
layout="@layout/layout_user_profile_live"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
@@ -233,8 +120,17 @@
android:visibility="gone" />
<include
android:id="@+id/layout_user_profile_live"
layout="@layout/layout_user_profile_live"
android:id="@+id/layout_creator_community_post"
layout="@layout/layout_creator_community_post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
android:layout_marginTop="26.7dp"
android:visibility="gone" />
<include
android:id="@+id/layout_creator_channel_series"
layout="@layout/layout_creator_channel_series"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="13.3dp"
@@ -294,4 +190,47 @@
android:layout_marginTop="26.7dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
<RelativeLayout
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="50dp"
android:paddingHorizontal="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:drawablePadding="6.7dp"
android:fontFamily="@font/pretendard_bold"
android:gravity="center_vertical"
android:textColor="@color/white"
android:textSize="20sp"
app:drawableStartCompat="@drawable/ic_back"
tools:ignore="RelativeOverlap"
tools:text="User03" />
<ImageView
android:id="@+id/iv_share"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
android:layout_marginEnd="14dp"
android:layout_toStartOf="@+id/iv_menu"
android:contentDescription="@null"
android:src="@drawable/ic_new_share" />
<ImageView
android:id="@+id/iv_menu"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:contentDescription="@null"
android:src="@drawable/ic_seemore_vertical" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>