@Test public void updateDurationWidget_shouldShowWhenVideoEnds() throws Exception { final TextView durationWidgetTextView = getDurationWidgetTextView(); assertThat(durationWidgetTextView.getText()).isEqualTo(""); subject.updateDurationWidget(100000); assertThat(durationWidgetTextView.getText()).isEqualTo("Ends in 100 seconds"); subject.updateDurationWidget(99000); assertThat(durationWidgetTextView.getText()).isEqualTo("Ends in 99 seconds"); }
@VisibleForTesting void updateDurationWidget(final int remainingTime) { if (remainingTime >= THRESHOLD_FOR_HIDING_VIDEO_DURATION) { mDurationWidget.updateText("Ends in " + formatTime(remainingTime)); } else if (remainingTime >= 0) { mDurationWidget.updateText("Thanks for watching"); } }
VastVideoToolbar extends LinearLayout { @VisibleForTesting void updateDurationWidget(final int remainingTime) { if (remainingTime >= THRESHOLD_FOR_HIDING_VIDEO_DURATION) { mDurationWidget.updateText("Ends in " + formatTime(remainingTime)); } else if (remainingTime >= 0) { mDurationWidget.updateText("Thanks for watching"); } } }
VastVideoToolbar extends LinearLayout { @VisibleForTesting void updateDurationWidget(final int remainingTime) { if (remainingTime >= THRESHOLD_FOR_HIDING_VIDEO_DURATION) { mDurationWidget.updateText("Ends in " + formatTime(remainingTime)); } else if (remainingTime >= 0) { mDurationWidget.updateText("Thanks for watching"); } } VastVideoToolbar(final Context context); }
VastVideoToolbar extends LinearLayout { @VisibleForTesting void updateDurationWidget(final int remainingTime) { if (remainingTime >= THRESHOLD_FOR_HIDING_VIDEO_DURATION) { mDurationWidget.updateText("Ends in " + formatTime(remainingTime)); } else if (remainingTime >= 0) { mDurationWidget.updateText("Thanks for watching"); } } VastVideoToolbar(final Context context);  }
VastVideoToolbar extends LinearLayout { @VisibleForTesting void updateDurationWidget(final int remainingTime) { if (remainingTime >= THRESHOLD_FOR_HIDING_VIDEO_DURATION) { mDurationWidget.updateText("Ends in " + formatTime(remainingTime)); } else if (remainingTime >= 0) { mDurationWidget.updateText("Thanks for watching"); } } VastVideoToolbar(final Context context);   }