public void setDisplayMode(final DisplayMode displayMode) {
        patternDisplayMode = displayMode;
        if (displayMode == DisplayMode.Animate) {
            if (mPattern.size() == 0) {
                throw new IllegalStateException(
                        "you must have a pattern to "
                                + "animate if you want to set the display mode to animate");
            }
            animatingPeriodStart = SystemClock.elapsedRealtime();
            final Cell first = mPattern.get(0);
            inProgressX = getCenterXForColumn(first.getColumn());
            inProgressY = getCenterYForRow(first.getRow());
            clearPatternDrawLookup();
        }
        invalidate();
    }
Set the display mode of the current pattern. This can be useful, for
instance, after detecting a pattern to tell this view whether change the
in progress result to correct or wrong.

@param displayMode The display mode.
android-patternview/src/main/java/com/eftimoff/patternview/PatternView.java