private boolean fitsInSentence ( String word , List < String > sentence , boolean addSpaces ) { String stringSentence = getSentenceFromList ( sentence , addSpaces ) ; stringSentence += word ; float sentenceWidth = getPaint ( ) . measureText ( stringSentence ) ; return sentenceWidth < viewWidth ; }
Verifies if word to be added will fit into the sentence