mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-03 07:53:37 +00:00
Do not draw the dot icon if there is only one page
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user