Skip to content

Commit 92905c5

Browse files
committed
library: TabRow: Optimize tab width calculation
1 parent ebb08cd commit 92905c5

File tree

3 files changed

+189
-74
lines changed

3 files changed

+189
-74
lines changed

docs/components/tabrow.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TabRowWithContour(
4848
| modifier | Modifier | Modifier for the tab row | Modifier | No |
4949
| colors | TabRowColors | Color configuration | TabRowDefaults.tabRowColors() | No |
5050
| minWidth | Dp | Minimum width of each tab | TabRowDefaults.TabRowMinWidth | No |
51+
| maxWidth | Dp | Maximum width of each tab | TabRowDefaults.TabRowMaxWidth | No |
5152
| height | Dp | Height of the tab row | TabRowDefaults.TabRowHeight | No |
5253
| cornerRadius | Dp | Corner radius of tabs | TabRowDefaults.TabRowCornerRadius | No |
5354
| onTabSelected | ((Int) -> Unit)? | Callback when tab is selected | null | No |
@@ -61,6 +62,7 @@ TabRowWithContour(
6162
| modifier | Modifier | Modifier for the tab row | Modifier | No |
6263
| colors | TabRowColors | Color configuration | TabRowDefaults.tabRowColors() | No |
6364
| minWidth | Dp | Minimum width of each tab | TabRowDefaults.TabRowWithContourMinWidth | No |
65+
| maxWidth | Dp | Maximum width of each tab | TabRowDefaults.TabRowWithContourMaxWidth | No |
6466
| height | Dp | Height of the tab row | TabRowDefaults.TabRowHeight | No |
6567
| cornerRadius | Dp | Corner radius of tabs | TabRowDefaults.TabRowWithContourCornerRadius | No |
6668
| onTabSelected | ((Int) -> Unit)? | Callback when tab is selected | null | No |
@@ -78,6 +80,8 @@ The TabRowDefaults object provides default configurations for the TabRow compone
7880
| TabRowWithContourCornerRadius | Dp | 10.dp | Default corner radius for contour style |
7981
| TabRowMinWidth | Dp | 76.dp | Min width of tabs for standard style |
8082
| TabRowWithContourMinWidth | Dp | 62.dp | Min width of tabs for contour style |
83+
| TabRowMaxWidth | Dp | 98.dp | Max width of tabs for standard style |
84+
| TabRowWithContourMaxWidth | Dp | 84.dp | Max width of tabs for contour style |
8185

8286
#### Methods
8387

docs/zh_CN/components/tabrow.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ TabRowWithContour(
4848
| modifier | Modifier | 应用于标签行的修饰符 | Modifier ||
4949
| colors | TabRowColors | 标签行的颜色配置 | TabRowDefaults.tabRowColors() ||
5050
| minWidth | Dp | 每个标签的最小宽度 | TabRowDefaults.TabRowMinWidth ||
51+
| maxWidth | Dp | 每个标签的最大宽度 | TabRowDefaults.TabRowMaxWidth ||
5152
| height | Dp | 标签行的高度 | TabRowDefaults.TabRowHeight ||
5253
| cornerRadius | Dp | 标签的圆角半径 | TabRowDefaults.TabRowCornerRadius ||
5354
| onTabSelected | ((Int) -> Unit)? | 标签选中时的回调函数 | null ||
@@ -61,6 +62,7 @@ TabRowWithContour(
6162
| modifier | Modifier | 应用于标签行的修饰符 | Modifier ||
6263
| colors | TabRowColors | 标签行的颜色配置 | TabRowDefaults.tabRowColors() ||
6364
| minWidth | Dp | 每个标签的最小宽度 | TabRowDefaults.TabRowWithContourMinWidth ||
65+
| maxWidth | Dp | 每个标签的最大宽度 | TabRowDefaults.TabRowWithContourMaxWidth ||
6466
| height | Dp | 标签行的高度 | TabRowDefaults.TabRowHeight ||
6567
| cornerRadius | Dp | 标签的圆角半径 | TabRowDefaults.TabRowWithContourCornerRadius ||
6668
| onTabSelected | ((Int) -> Unit)? | 标签选中时的回调函数 | null ||
@@ -78,6 +80,8 @@ TabRowDefaults 对象提供了 TabRow 组件的默认配置。
7880
| TabRowWithContourCornerRadius | Dp | 10.dp | 带轮廓样式的默认圆角半径 |
7981
| TabRowMinWidth | Dp | 76.dp | 标准样式的每个标签最小宽度 |
8082
| TabRowWithContourMinWidth | Dp | 62.dp | 带轮廓样式的每个标签最小宽度 |
83+
| TabRowMaxWidth | Dp | 98.dp | 标准样式的每个标签最大宽度 |
84+
| TabRowWithContourMaxWidth | Dp | 84.dp | 带轮廓样式的每个标签最大宽度 |
8185

8286
#### 方法
8387

0 commit comments

Comments
 (0)