summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-06-03 01:06:26 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-06-03 01:06:26 +0000
commit9642db40f471a33476142d1f0c3561db2b436af4 (patch)
tree60216556afa202c1d2f35d05e500d74fdc3bfb5a
parent22b541a6dc009ba04d2da63ceb790e241f1c53b8 (diff)
parent74f6535e6682986175b57f5d76309f20c3f7ebef (diff)
downloadsetupdesign-android11-d1-s7-release.tar.gz
Change-Id: I836dbd26ee87b9a84433aa102f24e08af8424b44
-rw-r--r--main/src/com/google/android/setupdesign/template/ListMixin.java20
-rw-r--r--main/src/com/google/android/setupdesign/view/IllustrationVideoView.java12
2 files changed, 23 insertions, 9 deletions
diff --git a/main/src/com/google/android/setupdesign/template/ListMixin.java b/main/src/com/google/android/setupdesign/template/ListMixin.java
index 6e2cb20..38928aa 100644
--- a/main/src/com/google/android/setupdesign/template/ListMixin.java
+++ b/main/src/com/google/android/setupdesign/template/ListMixin.java
@@ -187,15 +187,17 @@ public class ListMixin implements Mixin {
if (defaultDivider == null) {
defaultDivider = listView.getDivider();
}
- divider =
- DrawableLayoutDirectionHelper.createRelativeInsetDrawable(
- defaultDivider,
- dividerInsetStart /* start */,
- 0 /* top */,
- dividerInsetEnd /* end */,
- 0 /* bottom */,
- templateLayout);
- listView.setDivider(divider);
+ if (defaultDivider != null) {
+ divider =
+ DrawableLayoutDirectionHelper.createRelativeInsetDrawable(
+ defaultDivider,
+ dividerInsetStart /* start */,
+ 0 /* top */,
+ dividerInsetEnd /* end */,
+ 0 /* bottom */,
+ templateLayout);
+ listView.setDivider(divider);
+ }
}
}
diff --git a/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java b/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java
index 0654b02..2e4fd71 100644
--- a/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java
+++ b/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java
@@ -368,6 +368,18 @@ public class IllustrationVideoView extends TextureView
return false;
}
+ /**
+ * Seeks to specified time position.
+ *
+ * @param milliseconds the offset in milliseconds from the start to seek to
+ * @throws IllegalStateException if the internal player engine has not been initialized
+ */
+ public void seekTo(int milliseconds) {
+ if (mediaPlayer != null) {
+ mediaPlayer.seekTo(milliseconds);
+ }
+ }
+
@VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
public MediaPlayer getMediaPlayer() {
return mediaPlayer;