@Override public void onPress(String string){
  if (correctPassword == null) {
    throw new RuntimeException("The correct password has NOT been set!");
  }
  if (passwordStack.size() >= passwordLength)   return;
  passwordStack.push(string);
  indicator.add();
  StringBuilder nowPassword=new StringBuilder("");
  for (  String s : passwordStack) {
    nowPassword.append(s);
  }
  String nowPasswordString=nowPassword.toString();
  if (correctPassword.equals(nowPasswordString)) {
    if (onPasswordInputListener != null)     onPasswordInputListener.correct(nowPasswordString);
  }
 else {
    if (correctPassword.length() > nowPasswordString.length()) {
      if (onPasswordInputListener != null)       onPasswordInputListener.input(nowPasswordString);
    }
 else {
      if (onPasswordInputListener != null)       onPasswordInputListener.incorrect(nowPasswordString);
      incorrectInputTimes++;
      indicator.clear();
      passwordStack.clear();
    }
  }
}

@ Override public void onPress ( String string ) { if ( correctPassword == null ) { throw new RuntimeException ( "The correct password has NOT been set!" ) ; } if ( passwordStack . size ( ) >= passwordLength ) return ; passwordStack . push ( string ) ; indicator . add ( ) ; StringBuilder nowPassword = new StringBuilder ( "" ) ; for ( String s : passwordStack ) { nowPassword . append ( s ) ; } String nowPasswordString = nowPassword . toString ( ) ; if ( correctPassword . equals ( nowPasswordString ) ) { if ( onPasswordInputListener != null ) onPasswordInputListener . correct ( nowPasswordString ) ; } else { if ( correctPassword . length ( ) > nowPasswordString . length ( ) ) { if ( onPasswordInputListener != null ) onPasswordInputListener . input ( nowPasswordString ) ; } else { if ( onPasswordInputListener != null ) onPasswordInputListener . incorrect ( nowPasswordString ) ; incorrectInputTimes ++ ; indicator . clear ( ) ; passwordStack . clear ( ) ; } } }
from the button views .
