Skip to content

Commit

Permalink
Merge pull request #1329 from DroidsOnRoids/empty-pager-indicator
Browse files Browse the repository at this point in the history
[Pager indicators]Don't draw active dot indicators for empty pagers.
  • Loading branch information
andkulikov authored Oct 10, 2022
2 parents 856e9c2 + 268fea0 commit 2fad8c2
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ fun HorizontalPagerIndicator(
)
}
.size(width = indicatorWidth, height = indicatorHeight)
.background(
color = activeColor,
shape = indicatorShape,
.then(
if (pageCount > 0) Modifier.background(
color = activeColor,
shape = indicatorShape,
)
else Modifier
)
)
}
Expand Down Expand Up @@ -195,9 +198,12 @@ fun VerticalPagerIndicator(
)
}
.size(width = indicatorWidth, height = indicatorHeight)
.background(
color = activeColor,
shape = indicatorShape,
.then(
if (pageCount > 0) Modifier.background(
color = activeColor,
shape = indicatorShape,
)
else Modifier
)
)
}
Expand Down

0 comments on commit 2fad8c2

Please sign in to comment.