From 938e13899c6e9e920b461a143648e39c4eca77eb Mon Sep 17 00:00:00 2001 From: Zachary Sweigart Date: Sat, 23 Sep 2017 17:46:24 -0700 Subject: [PATCH] Allow InkPageIndicator colors to be updated programmatically --- .../java/io/plaidapp/ui/widget/InkPageIndicator.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/io/plaidapp/ui/widget/InkPageIndicator.java b/app/src/main/java/io/plaidapp/ui/widget/InkPageIndicator.java index b6888e47e..ce212f8e9 100644 --- a/app/src/main/java/io/plaidapp/ui/widget/InkPageIndicator.java +++ b/app/src/main/java/io/plaidapp/ui/widget/InkPageIndicator.java @@ -175,6 +175,18 @@ public void onChanged() { setCurrentPageImmediate(); } + public void setUnselectedColour(int unselectedColour) { + this.unselectedColour = unselectedColour; + unselectedPaint.setColor(unselectedColour); + invalidate(); + } + + public void setSelectedColour(int selectedColour) { + this.selectedColour = selectedColour; + selectedPaint.setColor(selectedColour); + invalidate(); + } + @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { if (isAttachedToWindow) {