-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Do you have a prop to change animation direction? I did the following because I didn't see any.
type PlaceholderContainerProps = { duration: number, delay: number, style: Object, animatedComponent: React.Element<*>, loader: Function, replace: boolean, rtl: boolean };
and
_setAnimationPositions = (): void => {
const {
ContainerComponent,
AnimatedComponent,
isContainerComponentMeasured,
isAnimatedComponentMeasured
} = this.state;
const {rtl} = this.props;
if (!isContainerComponentMeasured || !isAnimatedComponentMeasured) {
return;
}
const startPosition = rtl ? (ContainerComponent.x + ContainerComponent.width + AnimatedComponent.width) : -(ContainerComponent.x + AnimatedComponent.width);
const stopPosition = rtl ? -(ContainerComponent.x + AnimatedComponent.width) : (ContainerComponent.x + ContainerComponent.width + AnimatedComponent.width);
this.setState(
() => ({
startPosition,
stopPosition
}),
() => {
this.position.setValue(startPosition);
this._startAndRepeat();
}
);
};
I don't know whether this is right but got my job done
Metadata
Metadata
Assignees
Labels
No labels