code: private float getPasswordStrength() {
          int absoluteScore = 0;
          CharSequence password = getView().getText();
  
          for (Constraint<CharSequence> constraint : constraints) {
              if (constraint.isSatisfied(password)) {
                  absoluteScore++;
              }
          }
  
          return ((float) absoluteScore / (float) constraints.size());
      }
docs: Returns the strength of the current password, depending on the constraints, which have been
  added.
  
  @return The fraction of constraints, which are satisfied, as a {@link Float} value between
  0.0 and 1.0