Rename delayMillis to startDelayMillis in proto file
Add repeatable delays to proto
Note: Updates to the builders are done in a separate CL.
Bug: N/A
Test: TBA
Change-Id: Ia90f8bb0fa630ec3ab0375092e93fa7024736af3
diff --git a/wear/protolayout/protolayout-expression-pipeline/src/main/java/androidx/wear/protolayout/expression/pipeline/AnimationsHelper.java b/wear/protolayout/protolayout-expression-pipeline/src/main/java/androidx/wear/protolayout/expression/pipeline/AnimationsHelper.java
index 57490a3..a6aa523 100644
--- a/wear/protolayout/protolayout-expression-pipeline/src/main/java/androidx/wear/protolayout/expression/pipeline/AnimationsHelper.java
+++ b/wear/protolayout/protolayout-expression-pipeline/src/main/java/androidx/wear/protolayout/expression/pipeline/AnimationsHelper.java
@@ -69,8 +69,8 @@
/** Returns the delay from the given {@link AnimationSpec} or default value if not set. */
@NonNull
public static Duration getDelayOrDefault(@NonNull AnimationSpec spec) {
- return spec.getDelayMillis() > 0
- ? Duration.ofMillis(spec.getDelayMillis())
+ return spec.getStartDelayMillis() > 0
+ ? Duration.ofMillis(spec.getStartDelayMillis())
: DEFAULT_ANIM_DELAY;
}
diff --git a/wear/protolayout/protolayout-expression/src/main/java/androidx/wear/protolayout/expression/AnimationParameterBuilders.java b/wear/protolayout/protolayout-expression/src/main/java/androidx/wear/protolayout/expression/AnimationParameterBuilders.java
index 9b6c389..55ee6d1 100644
--- a/wear/protolayout/protolayout-expression/src/main/java/androidx/wear/protolayout/expression/AnimationParameterBuilders.java
+++ b/wear/protolayout/protolayout-expression/src/main/java/androidx/wear/protolayout/expression/AnimationParameterBuilders.java
@@ -138,7 +138,7 @@
* @since 1.2
*/
public int getDelayMillis() {
- return mImpl.getDelayMillis();
+ return mImpl.getStartDelayMillis();
}
/**
@@ -246,7 +246,7 @@
*/
@NonNull
public Builder setDelayMillis(int delayMillis) {
- mImpl.setDelayMillis(delayMillis);
+ mImpl.setStartDelayMillis(delayMillis);
mFingerprint.recordPropertyUpdate(2, delayMillis);
return this;
}
diff --git a/wear/protolayout/protolayout-proto/src/main/proto/animation_parameters.proto b/wear/protolayout/protolayout-proto/src/main/proto/animation_parameters.proto
index aee13fe..5581a04 100644
--- a/wear/protolayout/protolayout-proto/src/main/proto/animation_parameters.proto
+++ b/wear/protolayout/protolayout-proto/src/main/proto/animation_parameters.proto
@@ -14,7 +14,7 @@
// The delay to start the animation in milliseconds. If not set, defaults to
// 0.
- uint32 delay_millis = 2;
+ uint32 start_delay_millis = 2;
// The easing to be used for adjusting an animation's fraction. If not set,
// defaults to Linear Interpolator.
@@ -68,6 +68,13 @@
// The repeat mode to specify how animation will behave when repeated. If not
// set, defaults to restart.
RepeatMode repeat_mode = 2;
+
+ // The delay before the forward part of the repeat in milliseconds. If not set, defaults to 0.
+ uint32 forward_repeat_delay_millis = 3;
+
+ // The delay before the reversed part of the repeat in milliseconds. This delay will not be used
+ // when the repeat mode is restart. If not set, defaults to 0.
+ uint32 reverse_repeat_delay_millis = 4;
}
// The repeat mode to specify how animation will behave when repeated.