55 lines
2.2 KiB
Plaintext
55 lines
2.2 KiB
Plaintext
import { XDANIMATION_FLIP3D_OPTIONS, XDANIMATION_TRANSLATE_OPTIONS, XDANIMATION_ROTATE_OPTIONS, XDANIMATION_SCALE_OPTIONS } from "../interface.uts"
|
|
|
|
/**
|
|
* 截止 4.76 官方未提供鸿蒙下实现节点获取的方法,因此暂无法兼容鸿蒙。
|
|
*/
|
|
|
|
export class xAnimationS {
|
|
public static translate(opts : XDANIMATION_TRANSLATE_OPTIONS) {
|
|
if (opts.ele == null) return
|
|
// let view = (opts.ele as UniElement).getAndroidView()! as View
|
|
let duration_s = (opts?.duration ?? 1000).toLong()
|
|
let delay_s = (opts?.delay ?? 0).toLong()
|
|
let translation_s = (opts?.translation ?? 0).toInt()
|
|
let fromlen_s = (opts?.from ?? 360).toFloat()
|
|
let len_s = (opts?.len ?? 360).toFloat()
|
|
let loop_s = (opts?.loop ?? 0).toInt()
|
|
}
|
|
public static rotate(opts : XDANIMATION_ROTATE_OPTIONS) {
|
|
if (opts.ele == null) return
|
|
// let view = (opts.ele as UniElement).getAndroidView()! as View
|
|
let duration_s = (opts?.duration ?? 1000).toLong()
|
|
let delay_s = (opts?.delay ?? 0).toLong()
|
|
let from_s = (opts?.from ?? 0).toFloat()
|
|
let deg_s = (opts?.deg ?? 360).toFloat()
|
|
let loop_s = (opts?.loop ?? 0).toInt()
|
|
}
|
|
public static scale(opts : XDANIMATION_SCALE_OPTIONS) {
|
|
if (opts.ele == null) return
|
|
// let view = (opts.ele as UniElement).getAndroidView()! as View
|
|
let duration_s = (opts?.duration ?? 1000).toLong()
|
|
let delay_s = (opts?.delay ?? 0).toLong()
|
|
let direction_s = (opts?.direction ?? 2).toInt()
|
|
let scale_s = (opts?.scale ?? 1).toFloat()
|
|
let from_s = (opts?.from ?? 0).toFloat()
|
|
|
|
let loop_s = (opts?.loop ?? 0).toInt()
|
|
}
|
|
public static flip3D(opts : XDANIMATION_FLIP3D_OPTIONS) {
|
|
if (opts.ele == null) return
|
|
// let view = (opts.ele as UniElement).getAndroidView()! as View
|
|
let duration_s = (opts?.duration ?? 1000).toLong()
|
|
let delay_s = (opts?.delay ?? 0).toLong()
|
|
let axis_s = (opts?.axis ?? 1).toInt()
|
|
let from_s = (opts?.from ?? 0).toFloat()
|
|
let deg_s = (opts?.deg ?? 360).toFloat()
|
|
let loop_s = (opts?.loop ?? 0).toInt()
|
|
let cameraDistance_s = (opts?.cameraDistance ?? 12).toFloat()
|
|
let scaleZ_s = (opts?.scaleZ ?? 0.5).toFloat()
|
|
}
|
|
public static clearAnimations(ele : UniElement | null, reset : boolean = true) {
|
|
if (ele == null) return
|
|
// let view = (ele as UniElement).getAndroidView()! as View
|
|
}
|
|
|
|
} |