feat(home): 최근 데뷔 크리에이터 카드를 정리한다
This commit is contained in:
@@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.v2.main.home
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -16,6 +17,7 @@ import androidx.test.core.app.ApplicationProvider
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationLiveUiModel
|
||||
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeLiveAdapter
|
||||
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeRecentDebutCreatorAdapter
|
||||
import kr.co.vividnext.sodalive.v2.widget.TextTabBarView
|
||||
import kr.co.vividnext.sodalive.v2.widget.banner.BannerView
|
||||
import org.junit.Assert.assertEquals
|
||||
@@ -116,6 +118,34 @@ class HomeMainFragmentLayoutTest {
|
||||
assertEquals(52.dpToPx(), profileImage.layoutParams.height)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `recent debut creator item matches figma card dimensions`() {
|
||||
val recentDebut = inflateViewWithParent(R.layout.item_home_recent_debut_creator)
|
||||
val profileImage = recentDebut.findViewById<ImageView>(R.id.iv_home_recent_debut_creator_profile)
|
||||
val nicknameText = recentDebut.findViewById<TextView>(R.id.tv_home_recent_debut_creator_nickname)
|
||||
|
||||
assertEquals(205.dpToPx(), recentDebut.layoutParams.width)
|
||||
assertEquals(259.dpToPx(), recentDebut.layoutParams.height)
|
||||
assertEquals(205.dpToPx(), profileImage.layoutParams.width)
|
||||
assertEquals(259.dpToPx(), profileImage.layoutParams.height)
|
||||
assertEquals(24f, nicknameText.textSize / nicknameText.resources.displayMetrics.scaledDensity)
|
||||
assertEquals(Gravity.CENTER, nicknameText.gravity)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `home recent debut section matches figma list spacing`() {
|
||||
val root = inflateView(R.layout.fragment_v2_main_home)
|
||||
val recentDebutList = root.findViewById<RecyclerView>(R.id.rv_home_recent_debut_creators)
|
||||
val context = ApplicationProvider.getApplicationContext<Context>()
|
||||
val parent = RecyclerView(context)
|
||||
parent.layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
|
||||
val viewHolder = HomeRecentDebutCreatorAdapter().onCreateViewHolder(parent, 0)
|
||||
val layoutParams = viewHolder.itemView.layoutParams as ViewGroup.MarginLayoutParams
|
||||
|
||||
assertEquals(14.dpToPx(), recentDebutList.paddingStart)
|
||||
assertEquals(4.dpToPx(), layoutParams.marginEnd)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `popular community section is hidden until phase7 binding is implemented`() {
|
||||
val root = inflateView(R.layout.fragment_v2_main_home)
|
||||
@@ -125,12 +155,12 @@ class HomeMainFragmentLayoutTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `home live section matches figma row dimensions`() {
|
||||
fun `home live section height follows its items`() {
|
||||
val root = inflateView(R.layout.fragment_v2_main_home)
|
||||
val liveList = root.findViewById<RecyclerView>(R.id.rv_home_lives)
|
||||
|
||||
assertNotNull(liveList)
|
||||
assertEquals(102.dpToPx(), liveList.layoutParams.height)
|
||||
assertEquals(ViewGroup.LayoutParams.WRAP_CONTENT, liveList.layoutParams.height)
|
||||
assertEquals(20.dpToPx(), liveList.paddingStart)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user