public void setPinLength(int pinLength) {
        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mRoundContainer.removeAllViews();
        List<ImageView> temp = new ArrayList<>(pinLength);
        for (int i = 0; i < pinLength; i++) {
            ImageView roundView;
            if (i < mRoundViews.size()) {
                roundView = mRoundViews.get(i);
            } else {
                roundView = (ImageView) inflater.inflate(R.layout.view_round, mRoundContainer, false);
            }
            mRoundContainer.addView(roundView);
            temp.add(roundView);
        }
        mRoundViews.clear();
        mRoundViews.addAll(temp);
        refresh(0);
    }
Sets the length of the pin code.

@param pinLength the length of the pin code
lib/src/main/java/com/github/omadahealth/lollipin/lib/views/PinCodeRoundView.java