/** * Speaks the previously stored instruction text again. * * <p>Assumes that {@code mTextToRepeat} is non-null. */ private void repeatInstruction() { if (!sTutorialIsActive) { mRepeatHandler.removeMessages(RepeatHandler.MSG_REPEAT); return; } lockOrientation(); setTouchGuardActive(true); speakInternal(mResourceIdToRepeat, mRepeatedFormatArgs); }
/** * Speaks a new tutorial instruction. * * @param resId The resource value of the instruction string. * @param repeat Whether the instruction should be repeated indefinitely. * @param formatArgs Optional formatting arguments. * @see String#format(String, Object...) */ public void speakInstruction(int resId, boolean repeat, Object... formatArgs) { stopRepeating(); lockOrientation(); setTouchGuardActive(true); speakInternal(resId, formatArgs); if (repeat) { mResourceIdToRepeat = resId; mRepeatedFormatArgs = formatArgs; } else { mResourceIdToRepeat = 0; } }