==== Animaciones a nivel de props ====
\\
Las animaciones para las propiedades (props) se han implementado a través de script, definiendo el **Objeto** [[https://xoneisp.com/xonewiki/doku.php?id=wiki:2.-desarrollo-app:2.4.-scripting-modelo-objetos:b.-objetos-complementarios:start#animation|Animation]].
\\
\\
|<50%>|
^ Animación ^
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Oculta y Muestra una propiedad|Oculta y Muestra una propiedad]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Movimiento de una propiedad según posición XY|Movimiento de una propiedad según posición XY]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Movimiento horizontal (derecha)|Movimiento horizontal (derecha)]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Movimiento (horizontal) Izquierda|Movimiento (horizontal) Izquierda]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Movimiento vertical arriba|Movimiento vertical arriba]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Movimiento vertical abajo|Movimiento vertical abajo]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Aumento tamaño ancho|Aumento tamaño ancho]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Aumento de tamaño alto|Aumento de tamaño alto]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Entrada efecto circular arriba|Entrada efecto circular arriba]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Ocultar efecto circular arriba|Ocultar efecto circular arriba]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Cambio color fondo|Cambio color fondo]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#RelativeScaleX|RelativeScaleX]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#RelativeScaleY|RelativeScaleY]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Rotar|Rotar]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#RelativeRotar|RelativeRotar]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#RelativeRotar|CreceryDecrecer]] |
| [[wiki:2.-desarrollo-app:2.5.-controles-by-xone:animaciones:animaciones_prop:start#Detener|Detener]] |
\\
=== Oculta y Muestra una propiedad ===
**Ejemplo:**
function doAlphaAnim(sProp) {
let window = ui.getView(self);
let property = window[sProp];
let animation = new Animation();
animation.setTarget(property);
animation.setDuration(3000);
animation.setAlpha(0);
animation.setStartCallback(function() {
ui.showToast("Iniciando alpha animation");
});
animation.setEndCallback(function() {
animation.setAlpha(1);
\\
=== Movimiento de una propiedad según posición XY ===
**Ejemplo:**
function doSetXY(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setX(500)
.setY(400);
}
\\
=== Movimiento horizontal (derecha) ===
**Ejemplo:**
function doSetRelativeX(sProp, nValue) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeX(nValue);
}
\\
=== Movimiento (horizontal) Izquierda ===
**Ejemplo:**
function doSetRelativeX(sProp, nValue) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeX(nValue);
}
\\
=== Movimiento vertical (arriba) ===
**Ejemplo:**
function doSetRelativeY(sProp, nValue) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeY(nValue);
}
\\
=== Movimiento vertical (abajo) ===
function doSetRelativeY(sProp, nValue) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeY(nValue);
}
\\
=== Aumento tamaño (ancho) ===
function doSetWidth(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setWidth("650p");
}
\\
=== Aumento de tamaño (alto) ===
function doSetHeight(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setHeight("350p");
//.setHeight("350p");
}
\\
=== Entrada efecto circular desde esquina superior izquierda ===
function doSetCircularRevealShow(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(500)
.setCircularReveal(0, 0, true);
}
\\
=== Ocultar efecto circular desde esquina superior izquierda ===
function doSetCircularRevealHide(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(500)
.setCircularReveal(0, 0, false);
}
\\
=== Cambio color fondo ===
function doSetBackgroundColor(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(200)
.setBackgroundColor("#FF0000", "#00FF00");
}
\\
=== RelativeScaleX ===
function doRelativeScaleX(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeScaleX(2);
}
\\
=== RelativeScaleY ===
function doRelativeScaleY(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeScaleY(2);
}
\\
=== Rotar ===
function doRotateAnim(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRotation(45);
}
\\
=== RelativeRotar ===
function doRelativeRotateAnim(sProp) {
let window = ui.getView(self);
let property = window[sProp];
new Animation()
.setTarget(property)
.setDuration(250)
.setRelativeRotation(45);
}
\\
=== Crecer y Decrecer ===
function doGrowAndShrinkAnim(sProp) {
let window = ui.getView(self);
let property = window[sProp];
widthAnimation = new Animation()
.setTarget(property)
.setDuration(250)
.setRepeatMode(-1)
.setWidth("650p");
heightAnimation = new Animation()
.setTarget(property)
.setDuration(250)
.setRepeatMode(-1)
.setHeight("350p");
}
\\
=== Detener ===
function doStop() {
widthAnimation.stop(true);
heightAnimation.stop(true);
}