fix(content): 크리에이터 랭킹 rank 간격을 보정한다
This commit is contained in:
@@ -126,6 +126,7 @@ class CreatorRankingCompactCardView @JvmOverloads constructor(
|
|||||||
private fun positionMedium(size: CreatorRankingCardSize) {
|
private fun positionMedium(size: CreatorRankingCardSize) {
|
||||||
val scale = size.widthPx / 185f
|
val scale = size.widthPx / 185f
|
||||||
requireNotNull(rankText).layoutParams = LayoutParams((56 * scale).roundToInt(), (70 * scale).roundToInt())
|
requireNotNull(rankText).layoutParams = LayoutParams((56 * scale).roundToInt(), (70 * scale).roundToInt())
|
||||||
|
requireNotNull(rankText).setPadding(0, 0, 0, (6 * scale).roundToInt())
|
||||||
findViewById<View>(R.id.ll_creator_ranking_delta).layoutParams = LayoutParams(
|
findViewById<View>(R.id.ll_creator_ranking_delta).layoutParams = LayoutParams(
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
@@ -150,6 +151,7 @@ class CreatorRankingCompactCardView @JvmOverloads constructor(
|
|||||||
).apply {
|
).apply {
|
||||||
leftMargin = 0
|
leftMargin = 0
|
||||||
}
|
}
|
||||||
|
requireNotNull(rankText).setPadding(0, 0, 0, (5 * scale).roundToInt())
|
||||||
findViewById<View>(R.id.ll_creator_ranking_delta).layoutParams = LayoutParams(
|
findViewById<View>(R.id.ll_creator_ranking_delta).layoutParams = LayoutParams(
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ class CreatorRankingHorizontalCardView @JvmOverloads constructor(
|
|||||||
(48 * scale).roundToInt(),
|
(48 * scale).roundToInt(),
|
||||||
(52 * scale).roundToInt()
|
(52 * scale).roundToInt()
|
||||||
)
|
)
|
||||||
|
requireNotNull(rankText).setPadding(0, 0, 0, (4 * scale).roundToInt())
|
||||||
requireNotNull(rankText).applyCreatorRankingRankGradient()
|
requireNotNull(rankText).applyCreatorRankingRankGradient()
|
||||||
imageView().layoutParams = LayoutParams((80 * scale).roundToInt(), (80 * scale).roundToInt()).apply {
|
imageView().layoutParams = LayoutParams((80 * scale).roundToInt(), (80 * scale).roundToInt()).apply {
|
||||||
leftMargin = (77 * scale).roundToInt()
|
leftMargin = (77 * scale).roundToInt()
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ class CreatorRankingLargeCardView @JvmOverloads constructor(
|
|||||||
leftMargin = 0
|
leftMargin = 0
|
||||||
topMargin = 0
|
topMargin = 0
|
||||||
}
|
}
|
||||||
|
requireNotNull(rankText).setPadding(0, 0, 0, (10 * scale).roundToInt())
|
||||||
requireNotNull(rankText).applyCreatorRankingRankGradient()
|
requireNotNull(rankText).applyCreatorRankingRankGradient()
|
||||||
requireNotNull(nameText).layoutParams = LayoutParams(
|
requireNotNull(nameText).layoutParams = LayoutParams(
|
||||||
(334 * scale).roundToInt(),
|
(334 * scale).roundToInt(),
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ class CreatorRankingAdapterLayoutTest {
|
|||||||
expectedWidth = 86,
|
expectedWidth = 86,
|
||||||
expectedHeight = 116,
|
expectedHeight = 116,
|
||||||
expectedLeft = 0,
|
expectedLeft = 0,
|
||||||
expectedTop = 0
|
expectedTop = 0,
|
||||||
|
expectedBottomPadding = 10
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +68,8 @@ class CreatorRankingAdapterLayoutTest {
|
|||||||
expectedWidth = 56,
|
expectedWidth = 56,
|
||||||
expectedHeight = 70,
|
expectedHeight = 70,
|
||||||
expectedLeft = 0,
|
expectedLeft = 0,
|
||||||
expectedTop = 0
|
expectedTop = 0,
|
||||||
|
expectedBottomPadding = 6
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +84,8 @@ class CreatorRankingAdapterLayoutTest {
|
|||||||
expectedWidth = 52,
|
expectedWidth = 52,
|
||||||
expectedHeight = 50,
|
expectedHeight = 50,
|
||||||
expectedLeft = 0,
|
expectedLeft = 0,
|
||||||
expectedTop = 0
|
expectedTop = 0,
|
||||||
|
expectedBottomPadding = 5
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +107,8 @@ class CreatorRankingAdapterLayoutTest {
|
|||||||
expectedWidth = 48,
|
expectedWidth = 48,
|
||||||
expectedHeight = 52,
|
expectedHeight = 52,
|
||||||
expectedLeft = 0,
|
expectedLeft = 0,
|
||||||
expectedTop = 0
|
expectedTop = 0,
|
||||||
|
expectedBottomPadding = 4
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,7 +207,8 @@ class CreatorRankingAdapterLayoutTest {
|
|||||||
expectedWidth: Int,
|
expectedWidth: Int,
|
||||||
expectedHeight: Int,
|
expectedHeight: Int,
|
||||||
expectedLeft: Int,
|
expectedLeft: Int,
|
||||||
expectedTop: Int
|
expectedTop: Int,
|
||||||
|
expectedBottomPadding: Int
|
||||||
) {
|
) {
|
||||||
val params = view.layoutParams as ViewGroup.MarginLayoutParams
|
val params = view.layoutParams as ViewGroup.MarginLayoutParams
|
||||||
assertEquals(expectedWidth, params.width)
|
assertEquals(expectedWidth, params.width)
|
||||||
@@ -211,6 +216,8 @@ class CreatorRankingAdapterLayoutTest {
|
|||||||
assertEquals(expectedLeft, params.leftMargin)
|
assertEquals(expectedLeft, params.leftMargin)
|
||||||
assertEquals(expectedTop, params.topMargin)
|
assertEquals(expectedTop, params.topMargin)
|
||||||
assertEquals(Gravity.CENTER, view.gravity)
|
assertEquals(Gravity.CENTER, view.gravity)
|
||||||
|
assertEquals(false, view.includeFontPadding)
|
||||||
|
assertEquals(expectedBottomPadding, view.paddingBottom)
|
||||||
}
|
}
|
||||||
|
|
||||||
private inline fun <reified T : View> inflateView(layoutResId: Int): T {
|
private inline fun <reified T : View> inflateView(layoutResId: Int): T {
|
||||||
|
|||||||
Reference in New Issue
Block a user