Skip to content

Commit

Permalink
Merge "style: address tv material design feedback" into androidx-main
Browse files Browse the repository at this point in the history
  • Loading branch information
vighnesh153 authored and Gerrit Code Review committed Mar 19, 2024
2 parents 4bb101b + 69cb216 commit 6994324
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ package androidx.tv.samples
import androidx.annotation.Sampled
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -57,7 +55,6 @@ fun PillIndicatorTabRow() {

TabRow(
selectedTabIndex = selectedTabIndex,
separator = { Spacer(modifier = Modifier.width(12.dp)) },
modifier = Modifier.focusRestorer()
) {
tabs.forEachIndexed { index, tab ->
Expand Down Expand Up @@ -89,7 +86,6 @@ fun UnderlinedIndicatorTabRow() {

TabRow(
selectedTabIndex = selectedTabIndex,
separator = { Spacer(modifier = Modifier.width(12.dp)) },
indicator = { tabPositions, doesTabRowHaveFocus ->
TabRowDefaults.UnderlinedIndicator(
currentTabPosition = tabPositions[selectedTabIndex],
Expand All @@ -108,7 +104,7 @@ fun UnderlinedIndicatorTabRow() {
Text(
text = tab,
fontSize = 12.sp,
modifier = Modifier.padding(bottom = 4.dp)
modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
)
}
}
Expand Down Expand Up @@ -137,7 +133,6 @@ fun TabRowWithDebounce() {

TabRow(
selectedTabIndex = selectedTabIndex,
separator = { Spacer(modifier = Modifier.width(12.dp)) },
modifier = Modifier.focusRestorer()
) {
tabs.forEachIndexed { index, tab ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ class IconTest {

@Test
fun painter_noIntrinsicSize_dimensions() {
val width = 24.dp
val height = 24.dp
val width = 20.dp
val height = 20.dp
val painter = ColorPainter(Color.Red)
val testTag = "testTag"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object ButtonDefaults {
)

/** The default size of the icon when used inside any button. */
val IconSize = 18.dp
val IconSize = 20.dp

/**
* The default size of the spacing between an icon and a text when they used inside any button.
Expand Down Expand Up @@ -209,7 +209,7 @@ object OutlinedButtonDefaults {
)

/** The default size of the icon when used inside any button. */
val IconSize = 18.dp
val IconSize = 20.dp

/**
* The default size of the spacing between an icon and a text when they used inside any button.
Expand Down
4 changes: 1 addition & 3 deletions tv/tv-material/src/main/java/androidx/tv/material3/Icon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.role
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp

/**
* A Material Design icon component that draws [imageVector] using [tint], with a default value
Expand Down Expand Up @@ -169,5 +168,4 @@ private fun Modifier.defaultSizeFor(painter: Painter) =
private fun Size.isInfinite() = width.isInfinite() && height.isInfinite()

// Default icon size, for icons with no intrinsic size information
// TODO(rvighnesh): change this to IconButtonTokens.IconSize when we introduce IconButton
private val DefaultIconSizeModifier = Modifier.size(24.dp)
private val DefaultIconSizeModifier = Modifier.size(IconButtonDefaults.MediumIconSize)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal object TypeScaleTokens {
val BodySmallFont = TypefaceTokens.Plain
val BodySmallLineHeight = 16.0.sp
val BodySmallSize = 12.sp
val BodySmallTracking = 0.4.sp
val BodySmallTracking = 0.2.sp
val BodySmallWeight = TypefaceTokens.WeightRegular
val DisplayLargeFont = TypefaceTokens.Brand
val DisplayLargeLineHeight = 64.0.sp
Expand Down

0 comments on commit 6994324

Please sign in to comment.