mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Do not draw the dot icon if there is only one page
This commit is contained in:
parent
1c23e53ed7
commit
c5f39cf9ee
1 changed files with 4 additions and 0 deletions
|
|
@ -51,6 +51,10 @@ public class DotsIndicatorDecoration extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
int itemCount = (int) Math.ceil((double) parent.getAdapter().getItemCount() / 5);
|
int itemCount = (int) Math.ceil((double) parent.getAdapter().getItemCount() / 5);
|
||||||
|
|
||||||
|
if (itemCount <= 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// center horizontally, calculate width and subtract half from center
|
// center horizontally, calculate width and subtract half from center
|
||||||
float totalLength = this.radius * 2 * itemCount;
|
float totalLength = this.radius * 2 * itemCount;
|
||||||
float paddingBetweenItems = Math.max(0, itemCount - 1) * indicatorItemPadding;
|
float paddingBetweenItems = Math.max(0, itemCount - 1) * indicatorItemPadding;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue