Fix text on tab was not located in the middle

Use minimum size instead of fixed height to fix this issue.

Fix: 277673763
Test: Manually with All apps page with font size scale
Change-Id: Id96af72dcb026a30714ffcc1cff32b691297313f
This commit is contained in:
Chaohui Wang
2023-04-12 12:29:57 +08:00
parent a8846e426b
commit 3eebe48ae5

View File

@@ -18,11 +18,11 @@ package com.android.settingslib.spa.widget.scaffold
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Tab
import androidx.compose.material3.Text
import androidx.compose.material3.minimumInteractiveComponentSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
@@ -46,7 +46,7 @@ internal fun SettingsTab(
selected = selected,
onClick = onClick,
modifier = Modifier
.height(48.dp)
.minimumInteractiveComponentSize()
.padding(horizontal = 4.dp, vertical = 6.dp)
.clip(SettingsShape.CornerMedium)
.background(