@@ -77,15 +77,36 @@ fun GroupRow(
7777 },
7878 overflow = FlowRowOverflow .expandOrCollapseIndicator(
7979 expandIndicator = {
80- // Some padding is required on the end to stop it overflowing the screen.
81- TextGroupButton (
82- modifier = Modifier .padding(end = 16 .dp),
83- onClick = { viewAllState = true },
84- text = stringResource(R .string.home_new_view_all_groups_button),
85- enabled = enabled,
86- )
80+ // Show new group button in the expand indicator if the new group button
81+ // in the flow row has overflowed.
82+ Row {
83+ NewGroupButton (
84+ onClick = onNewGroupClick,
85+ text = if (isSubgroups) {
86+ stringResource(R .string.home_new_subgroup_button)
87+ } else {
88+ stringResource(R .string.home_new_group_button)
89+ },
90+ icon = {
91+ Icon (imageVector = Icons .Rounded .Add , null )
92+ },
93+ showText = groups.isEmpty(),
94+ enabled = enabled,
95+ )
96+
97+ Spacer (Modifier .width(8 .dp))
98+
99+ // Some padding is required on the end to stop it overflowing the screen.
100+ TextGroupButton (
101+ modifier = Modifier .padding(end = 16 .dp),
102+ onClick = { viewAllState = true },
103+ text = stringResource(R .string.home_new_view_all_groups_button),
104+ enabled = enabled,
105+ )
106+ }
87107 },
88108 collapseIndicator = {
109+ // Some padding is required on the end to stop it overflowing the screen.
89110 TextGroupButton (
90111 modifier = Modifier .padding(end = 16 .dp),
91112 onClick = { viewAllState = false },
@@ -96,20 +117,6 @@ fun GroupRow(
96117 minRowsToShowCollapse = 3 ,
97118 ),
98119 ) {
99- NewGroupButton (
100- onClick = onNewGroupClick,
101- text = if (isSubgroups) {
102- stringResource(R .string.home_new_subgroup_button)
103- } else {
104- stringResource(R .string.home_new_group_button)
105- },
106- icon = {
107- Icon (imageVector = Icons .Rounded .Add , null )
108- },
109- showText = groups.isEmpty(),
110- enabled = enabled,
111- )
112-
113120 if (showThisGroupButton) {
114121 TextGroupButton (
115122 onClick = onThisGroupClick,
@@ -152,6 +159,20 @@ fun GroupRow(
152159 },
153160 )
154161 }
162+
163+ NewGroupButton (
164+ onClick = onNewGroupClick,
165+ text = if (isSubgroups) {
166+ stringResource(R .string.home_new_subgroup_button)
167+ } else {
168+ stringResource(R .string.home_new_group_button)
169+ },
170+ icon = {
171+ Icon (imageVector = Icons .Rounded .Add , null )
172+ },
173+ showText = groups.isEmpty(),
174+ enabled = enabled,
175+ )
155176 }
156177 }
157178}
0 commit comments