From dc217f97afc9a6110abdb7e79518eaf49a89f4b1 Mon Sep 17 00:00:00 2001 From: klaus Date: Mon, 15 Jun 2026 19:10:49 +0900 Subject: [PATCH] =?UTF-8?q?feat(creator):=20=EC=B1=84=EB=84=90=20=ED=99=88?= =?UTF-8?q?=20=ED=83=AD=20=EA=B3=A0=EC=A0=95=20=EC=8A=A4=ED=81=AC=EB=A1=A4?= =?UTF-8?q?=EC=9D=84=20=EC=97=B0=EA=B2=B0=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channel/CreatorChannelHomeActivity.kt | 36 ++++++++++++++++++- .../layout/activity_creator_channel_home.xml | 1 + .../CreatorChannelHomeActivitySourceTest.kt | 18 ++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivity.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivity.kt index 977dd865..675dc018 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivity.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivity.kt @@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.v2.creator.channel import android.content.Context import android.content.Intent +import android.graphics.Color import android.graphics.Typeface import android.view.Gravity import android.view.View @@ -30,6 +31,7 @@ import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelAudioConte import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelScheduleResponse import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelHeaderUiModel import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelHomeUiState +import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelScrollState import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelTab import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelTitleBarState import kr.co.vividnext.sodalive.v2.creator.channel.ui.CreatorChannelHomeSectionAdapter @@ -44,6 +46,8 @@ class CreatorChannelHomeActivity : BaseActivity val topInset = insets.getInsets(WindowInsetsCompat.Type.systemBars()).top + statusBarHeight = topInset view.updatePadding(top = topInset) view.updateLayoutParams { height = baseTitleBarHeight + topInset } + updateScrollState(binding.nestedScrollView.scrollY) insets } + ViewCompat.requestApplyInsets(binding.titleBarContainer) + } + + private fun setupScrollListener() { + binding.nestedScrollView.setOnScrollChangeListener { _, _, scrollY, _, _ -> + updateScrollState(scrollY) + } + } + + private fun updateScrollState(scrollY: Int) { + val stickyTop = CreatorChannelScrollState.calculateStickyTop(statusBarHeight, baseTitleBarHeight) + val headerHeight = binding.headerContainer.height + if (headerHeight <= 0) return + + val tabTranslationY = (scrollY - (headerHeight - stickyTop)).coerceAtLeast(0) + binding.horizontalTabScrollView.translationY = tabTranslationY.toFloat() + + val tabBarTop = headerHeight - scrollY + tabTranslationY + val profileVisibleHeight = (headerHeight - scrollY).coerceIn(0, headerHeight) + val shouldUseBlackTitleBar = CreatorChannelScrollState.shouldUseBlackTitleBar( + titleBarBottom = stickyTop, + tabBarTop = tabBarTop, + profileImageVisibleHeight = profileVisibleHeight, + profileImageTotalHeight = headerHeight + ) + binding.titleBarContainer.setBackgroundColor( + if (shouldUseBlackTitleBar) Color.BLACK else Color.TRANSPARENT + ) } private fun setStatusBarIconAppearance() { diff --git a/app/src/main/res/layout/activity_creator_channel_home.xml b/app/src/main/res/layout/activity_creator_channel_home.xml index d88438c0..8ba072d7 100644 --- a/app/src/main/res/layout/activity_creator_channel_home.xml +++ b/app/src/main/res/layout/activity_creator_channel_home.xml @@ -119,6 +119,7 @@ android:layout_width="match_parent" android:layout_height="52dp" android:background="@color/black" + android:elevation="1dp" android:fillViewport="false" android:overScrollMode="never" android:scrollbars="none"> diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivitySourceTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivitySourceTest.kt index 234f695d..356e6b22 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivitySourceTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelHomeActivitySourceTest.kt @@ -60,6 +60,7 @@ class CreatorChannelHomeActivitySourceTest { assertTrue(layout.contains("