Skip to content

Commit

Permalink
Merge pull request nickbutcher#214 from zsweigart/zds_update_colors_p…
Browse files Browse the repository at this point in the history
…rogrammatically

Allow InkPageIndicator colors to be updated programmatically
  • Loading branch information
nickbutcher authored Sep 24, 2017
2 parents e6716fb + 938e138 commit 88814ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/io/plaidapp/ui/widget/InkPageIndicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 88814ff

Please sign in to comment.