华为仓颉鸿蒙HarmonyOS NEXT原生UI转场动画之页面间转场

本文篇幅较长,建议点赞收藏,以免找不到哟(^U^)ノ~YO

当路由进行切换时,可以通过在 onTransition 函数中自定义页面入场和页面退场的转场动效。

函数

onTransition()

protected open func onTransition(): Unit

进入此页面或移动到其他页面时实现动画。

自定义类型

PageTransitionEnter

public class PageTransitionEnter {
        public init(value: PageTransitionOptions)
        public func slide(value: SlideEffect): This
        public func translate(x!: Length = 0.vp, y!: Length = 0.vp, z!: Length = 0.vp): This
        public func translate(x!: Length = 0.vp, y!: Length = 0.vp, z!: Length = 0.vp): This
        public func translate(x!: Int32 = 0, y!: Int32 = 0, z!: Int32 = 0): This
        public func translate(x!: CJResource, y!: CJResource, z!: CJResource): This
        public func translate(x!: Int64 = 0, y!: Int64 = 0, z!: Int64 = 0): This
        public func translate(x!: Float64 = 0.0, y!: Float64 = 0.0, z!: Float64 = 0.0): This
        public func translate(value: Length): This
        public func translate(value: CJResource): This
        public func translate(value: Int64): This
        public func translate(value: Float64): This
        public func translateX(value: Length): This
        public func translateX(value: CJResource): This
        public func translateX(value: Int64): This
        public func translateX(value: Float64): This
        public func translateY(value: Length): This
        public func translateY(value: CJResource): This
        public func translateY(value: Int64): This
        public func translateY(value: Float64): This
        public func scale(scaleValue: Float32): This
        public func scale(scaleValue: Int32): This
        public func scale(x!: Float32 = 1.0, y!: Float32 = 1.0, z!: Float32 = 1.0, centerX!: Length = 50.percent, centerY!: Length = 50.percent): This
        public func scale(x!: Float32 = 1.0, y!: Float32 = 1.0, z!: Float32 = 1.0, centerX!: CJResource, centerY!: CJResource): This
        public func scaleX(scale: Float32): This
        public func scaleX(scale: Int32): This
        public func scaleY(scale: Float32): This
        public func scaleY(scale: Int32): This
        public func opacity(value: Float64): This
        public func opacity(value: Int64): This
    }

页面的自定义入场动效类型。

init(PageTransitionOptions)

public init(value: PageTransitionOptions)

创建一个 PageTransitionExit 类型的对象。

参数名 参数类型 必填 默认值 描述
value PageTransitionOptions - 配置入场动效的参数。

slide(SlideEffect)

public func slide(value: SlideEffect): This

设置页面转场时的滑入滑出效果。

参数名 参数类型 必填 默认值 描述
value SlideEffect - 页面转场时的滑入滑出效果。

translate(Length, Length, Length)

public func translate(x!: Length = 0.vp, y!: Length = 0.vp, z!: Length = 0.vp): This

设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。

参数名 参数类型 必填 默认值 描述
x Length 0.vp 横向的平移距离。
y Length 0.vp 纵向的平移距离。
z Length 0.vp 竖向的平移距离。

translate(Float64, Float64, Float64)

public func translate(x!: Float64 = 0.0, y!: Float64 = 0.0, z!: Float64 = 0.0)
参数名 参数类型 必填 默认值 描述
x Float64 0.0 横向的平移距离。
y Float64 0.0 纵向的平移距离。
z Float64 0.0 竖向的平移距离。

translate(Int32, Int32, Int32)

public func translate(x!: Int32 = 0, y!: Int32 = 0, z!: Int32 = 0): This
参数名 参数类型 必填 默认值 描述
x Int32 0 横向的平移距离。
y Int32 0 纵向的平移距离。
z Int32 0 竖向的平移距离。

translate(CJResource, CJResource, CJResource)

public func translate(x!: CJResource, y!: CJResource, z!: CJResource): This

设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。

参数名 参数类型 必填 默认值 描述
x CJResource - 横向的平移距离。
y CJResource - 纵向的平移距离。
z CJResource - 竖向的平移距离。

translate(Int64, Int64, Int64)

public func translate(x!: Int64 = 0, y!: Int64 = 0, z!: Int64 = 0): This

设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。

参数名 参数类型 必填 默认值 描述
x Int64 0 横向的平移距离。
y Int64 0 纵向的平移距离。
z Int64 0 竖向的平移距离。

translate(Float64, Float64, Float64)

public func translate(x!: Float64 = 0.0, y!: Float64 = 0.0, z!: Float64 = 0.0): This

设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。

参数名 参数类型 必填 默认值 描述
x Float64 0.0 横向的平移距离。
y Float64 0.0 纵向的平移距离。
z Float64 0.0 竖向的平移距离。

translate(Length)

public func translate(value: Length): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value Length - 平移距离。

translate(CJResource)

public func translate(value: CJResource): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value CJResource - 平移距离。

translate(Int64)

public func translate(value: Int64): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value Int64 - 平移距离。

translate(Float64)

设置页面转场时的平移效果。

public func translate(value: Float64): This
参数名 参数类型 必填 默认值 描述
value Float64 - 平移距离。

translateX(Length)

public func translateX(value: Length): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value Length - 横向平移距离。

translateX(CJResource)

public func translateX(value: CJResource): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value CJResource - 横向平移距离。

translateX(Int64)

public func translateX(value: Int64): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value Int64 - 横向平移距离。

translateX(Float64)

public func translateX(value: Float64): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value Float64 - 横向平移距离。

translateY(Length)

public func translateY(value: Length): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value Length - 纵向平移距离。

translateY(CJResource)

public func translateY(value: CJResource): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value CJResource - 纵向平移距离。

translateY(Int64)

public func translateY(value: Int64): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value Int64 - 纵向平移距离。

translateY(Float64)

public func translateY(value: Float64): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value Float64 - 纵向平移距离。

scale(Float32)

public func scale(scaleValue: Float32): This

设置页面转场时的缩放效果。

参数名 参数类型 必填 默认值 描述
scaleValue Float32 - 放大倍数(或缩小比例)。

scale(Int32)

public func scale(scaleValue: Int32): This

设置页面转场时的缩放效果。

参数名 参数类型 必填 默认值 描述
scaleValue Int32 - 放大倍数(或缩小比例)。

scale(Float32, Float32, Float32, Length, Length)

public func scale(
            x!: Float32 = 1.0,
            y!: Float32 = 1.0,
            z!: Float32 = 1.0,
            centerX!: Length = 50.percent,
            centerY!: Length = 50.percent
        ): This

设置页面转场时的缩放效果,为入场时起点和退场时终点的值。

参数名 参数类型 必填 默认值 描述
x Float32 1.0 横向放大倍数(或缩小比例)。
y Float32 1.0 纵向放大倍数(或缩小比例)。
z Float32 1.0 竖向放大倍数(或缩小比例)。
centerX Length 50.percent 中心点坐标。
centerY Length 50.percent 中心点坐标。

scale(Float32, Float32, Float32, CJResource, CJResource)

public func scale(
        x!: Float32,
        y!: Float32,
        z!: Float32,
        centerX!: CJResource,
        centerY!: CJResource
    ): This

设置页面转场时的缩放效果,为入场时起点和退场时终点的值。

参数名 参数类型 必填 默认值 描述
x Float32 - 横向放大倍数(或缩小比例)。
y Float32 - 纵向放大倍数(或缩小比例)。
z Float32 - 竖向放大倍数(或缩小比例)。
centerX CJResource - 中心点坐标。
centerY CJResource - 中心点坐标。

scaleX(Float32)

public func scaleX(scale: Float32): This

设置页面转场时的横向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Float32 - 放大倍数(或缩小比例)。

scaleX(Int32)

public func scaleX(scale: Int32): This

设置页面转场时的横向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Int32 - 放大倍数(或缩小比例)。

scaleY(Float32)

public func scaleY(scale: Float32): This

设置页面转场时的纵向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Float32 - 放大倍数(或缩小比例)。

scaleY(Int32)

public func scaleY(scale: Int32): This

设置页面转场时的纵向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Int32 - 放大倍数(或缩小比例)。

opacity(Float64)

public func opacity(value: Float64): This

设置入场的起点透明度值或者退场的终点透明度值。

参数名 参数类型 必填 默认值 描述
value Float64 - 入场的起点透明度值或者退场的终点透明度值。

opacity(Int64)

public func opacity(value: Int64): This

设置入场的起点透明度值或者退场的终点透明度值。

参数名 参数类型 必填 默认值 描述
value Int64 - 入场的起点透明度值或者退场的终点透明度值。

PageTransitionExit

public class PageTransitionExit {
        public init(value: PageTransitionOptions)
        public func slide(value: SlideEffect): This
        public func translate(x!: Length = 0.vp, y!: Length = 0.vp, z!: Length = 0.vp): This
        public func translate(x!: Length = 0.vp, y!: Length = 0.vp, z!: Length = 0.vp): This
        public func translate(x!: Int32 = 0, y!: Int32 = 0, z!: Int32 = 0): This
        public func translate(x!: CJResource, y!: CJResource, z!: CJResource): This
        public func translate(x!: Int64 = 0, y!: Int64 = 0, z!: Int64 = 0): This
        public func translate(x!: Float64 = 0.0, y!: Float64 = 0.0, z!: Float64 = 0.0): This
        public func translate(value: Length): This
        public func translate(value: CJResource): This
        public func translate(value: Int64): This
        public func translate(value: Float64): This
        public func translateX(value: Length): This
        public func translateX(value: CJResource): This
        public func translateX(value: Int64): This
        public func translateX(value: Float64): This
        public func translateY(value: Length): This
        public func translateY(value: CJResource): This
        public func translateY(value: Int64): This
        public func translateY(value: Float64): This
        public func scale(scaleValue: Float32): This
        public func scale(scaleValue: Int32): This
        public func scale(scaleValue: Float32): This
        public func scale(scaleValue: Int32): This
        public func scale(x!: Float32 = 1.0, y!: Float32 = 1.0, z!: Float32 = 1.0, centerX!: Length = 50.percent, centerY!: Length = 50.percent): This
        public func scale(x!: Float32 = 1.0, y!: Float32 = 1.0, z!: Float32 = 1.0, centerX!: CJResource, centerY!: CJResource): This
        public func scaleX(scale: Float32): This
        public func scaleX(scale: Int32): This
        public func scaleY(scale: Float32): This
        public func scaleY(scale: Int32): This
        public func opacity(value: Float64): This
        public func opacity(value: Int64): This
    }

页面的自定义退场动效类型。

init(PageTransitionOptions)

public init(value: PageTransitionOptions)

创建一个 PageTransitionExit 类型的对象。

参数名 参数类型 必填 默认值 描述
value PageTransitionOptions - 配置退场动效的参数。

slide(SlideEffect)

public func slide(value: SlideEffect): This

设置页面转场时的滑入滑出效果。

参数名 参数类型 必填 默认值 描述
value SlideEffect - 页面转场时的滑入滑出效果。

translate(Length, Length, Length)

public func translate(x!: Length = 0.vp, y!: Length = 0.vp, z!: Length = 0.vp): This

设置页面转场时的平移效果,为入场时起点和退场时终点的值,和slide同时设置时默认生效slide。

参数名 参数类型 必填 默认值 描述
x Length 0.vp 横向的平移距离。
y Length 0.vp 纵向的平移距离。
z Length 0.vp 竖向的平移距离。

translate(Float64, Float64, Float64)

public func translate(x!: Float64 = 0.0, y!: Float64 = 0.0, z!: Float64 = 0.0)
参数名 参数类型 必填 默认值 描述
x Float64 0.0 横向的平移距离。
y Float64 0.0 纵向的平移距离。
z Float64 0.0 竖向的平移距离。

translate(Int32, Int32, Int32)

public func translate(x!: Int32 = 0, y!: Int32 = 0, z!: Int32 = 0): This
参数名 参数类型 必填 默认值 描述
x Int32 0 横向的平移距离。
y Int32 0 纵向的平移距离。
z Int32 0 竖向的平移距离。

translate(CJResource, CJResource, CJResource)

public func translate(x!: CJResource, y!: CJResource, z!: CJResource): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
x CJResource - 横向的平移距离。
y CJResource - 纵向的平移距离。
z CJResource - 竖向的平移距离。

translate(Int64, Int64, Int64)

public func translate(x!: Int64 = 0, y!: Int64 = 0, z!: Int64 = 0): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
x Int64 0 横向的平移距离。
y Int64 0 纵向的平移距离。
z Int64 0 竖向的平移距离。

translate(Float64, Float64, Float64)

public func translate(x!: Float64 = 0.0, y!: Float64 = 0.0, z!: Float64 = 0.0): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
x Float64 0.0 横向的平移距离。
y Float64 0.0 纵向的平移距离。
z Float64 0.0 竖向的平移距离。

translate(Length)

public func translate(value: Length): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value Length - 平移距离。

translate(CJResource)

public func translate(value: CJResource): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value CJResource - 平移距离。

translate(Int64)

public func translate(value: Int64): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value Int64 - 平移距离。

translate(Float64)

public func translate(value: Float64): This

设置页面转场时的平移效果。

参数名 参数类型 必填 默认值 描述
value Float64 - 平移距离。

translateX(Length)

public func translateX(value: Length): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value Length - 横向平移距离。

translateX(CJResource)

public func translateX(value: CJResource): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value CJResource - 横向平移距离。

translateX(Int64)

public func translateX(value: Int64): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value Int64 - 横向平移距离。

translateX(Float64)

public func translateX(value: Float64): This

设置页面转场时的横向平移效果。

参数名 参数类型 必填 默认值 描述
value Float64 - 横向平移距离。

translateY(Length)

public func translateY(value: Length): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value Length - 纵向平移距离。

translateY(CJResource)

public func translateY(value: CJResource): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value CJResource - 纵向平移距离。

translateY(Int64)

public func translateY(value: Int64): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value Int64 - 纵向平移距离。

translateY(Float64)

public func translateY(value: Float64): This

设置页面转场时的纵向平移效果。

参数名 参数类型 必填 默认值 描述
value Float64 - 纵向平移距离。

scale(scaleValue: Float32)

public func scale(scaleValue: Float32): This

设置页面转场时的缩放效果。

参数名 参数类型 必填 默认值 描述
scaleValue Float32 - 放大倍数(或缩小比例)。

scale(scaleValue: Int32)

public func scale(scaleValue: Int32): This

设置页面转场时的缩放效果。

参数名 参数类型 必填 默认值 描述
scaleValue Int32 - 放大倍数(或缩小比例)。

scale(Float32, Float32, Float32, Length, Length)

public func scale(
            x!: Float32 = 1.0,
            y!: Float32 = 1.0,
            z!: Float32 = 1.0,
            centerX!: Length = 50.percent,
            centerY!: Length = 50.percent
        ): This

设置页面转场时的缩放效果,为入场时起点和退场时终点的值。

参数名 参数类型 必填 默认值 描述
x Float32 1.0 横向放大倍数(或缩小比例)。
y Float32 1.0 纵向放大倍数(或缩小比例)。
z Float32 1.0 竖向放大倍数(或缩小比例)。
centerX Length 50.percent 中心点坐标。
centerY Length 50.percent 中心点坐标。

scale(Float32, Float32, Float32, CJResource, CJResource)

public func scale(
            x!: Float32,
            y!: Float32,
            z!: Float32,
            centerX!: CJResource,
            centerY!: CJResource
        ): This

设置页面转场时的缩放效果,为入场时起点和退场时终点的值。

参数名 参数类型 必填 默认值 描述
x Float32 - 横向放大倍数(或缩小比例)。
y Float32 - 纵向放大倍数(或缩小比例)。
z Float32 - 竖向放大倍数(或缩小比例)。
centerX CJResource - 中心点坐标。
centerY CJResource - 中心点坐标。

scaleX(Float32)

public func scaleX(scale: Float32): This

设置页面转场时的横向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Float32 - 放大倍数(或缩小比例)。

scaleX(Int32)

public func scaleX(scale: Int32): This

设置页面转场时的横向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Int32 - 放大倍数(或缩小比例)。

scaleY(Float32)

public func scaleY(scale: Float32): This

设置页面转场时的纵向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Float32 - 放大倍数(或缩小比例)。

scaleY(Int32)

public func scaleY(scale: Int32): This

设置页面转场时的纵向缩放效果。

参数名 参数类型 必填 默认值 描述
scale Int32 - 放大倍数(或缩小比例)。

opacity(Float64)

public func opacity(value: Float64): This

设置入场的起点透明度值或者退场的终点透明度值。

参数名 参数类型 必填 默认值 描述
value Float64 - 入场的起点透明度值或者退场的终点透明度值。

opacity(Int64)

public func opacity(value: Int64): This

设置入场的起点透明度值或者退场的终点透明度值。

参数名 参数类型 必填 默认值 描述
value Int64 - 入场的起点透明度值或者退场的终点透明度值。

PageTransitionOptions

init(RouteType, Int32, Curve, Int32)

public init(
        `type`!: RouteType = RouteType.None,
        duration!: Int32 = 1000,
        curve!: Curve = Curve.Linear,
        delay!: Int32 = 0
    )

新建一个 PageTransitionOptions 类型对象。

说明

没有匹配时使用系统默认的页面转场效果(根据设备可能会有差异),如需禁用系统默认页面转场效果,可以指定duration为0。

参数名 参数类型 必填 默认值 描述
type RouteType RouteType.None 页面转场效果生效的路由类型。
duration Int32 1000 动画的时长。
curve Curve Curve.Linear 动画曲线。
delay Int32 0 动画延迟时长。

事件

onEnter((RouteType, Float64)->Unit)

public func onEnter(event: (RouteType, Float64)->Unit): This
参数名 参数类型 描述
event (RouteType, Float64)->Unit 回调入参为当前入场动画的归一化进度[0 - 1]。- type:RouteType 跳转方法。- progress:Float64 当前进度。触发该事件的条件:逐帧回调,直到入场动画结束,progress从0变化到1。

onExit((RouteType, Float64)->Unit)

public func onExit(event: (RouteType, Float64)->Unit): This
参数名 参数类型 描述
event (RouteType, Float64)->Unit 回调入参为当前退场动画的归一化进度[0 - 1]。- type:RouteType 跳转方法。- progress:Float64 当前进度。触发该事件的条件:逐帧回调,直到退场动画结束,progress从0变化到1。

枚举说明

RouteType

枚举值 描述
Push 重定向指定页面。从PageB回退到之前的页面PageA。对于PageB,指定RouteType为None或者Pop的PageTransitionExit组件样式生效,对于PageA,指定RouteType为None或者Pop的PageTransitionEnter组件样式生效。
Pop 跳转到下一页面。PageA跳转到下一个新的界面PageB。对于PageA,指定RouteType为None或者Push的PageTransitionExit组件样式生效,对于PageB,指定RouteType为None或者Push的PageTransitionEnter组件样式生效。
None 页面未重定向。如Push和Pop描述中RouteType为None的情形,即页面进场时PageTransitionEnter的转场效果生效;退场时PageTransitionExit的转场效果生效。

SlideEffect

枚举值 描述
Left 设置到入场时表示从左边滑入,出场时表示滑出到左边。
Right 设置到入场时表示从右边滑入,出场时表示滑出到右边。
Top 设置到入场时表示从上边滑入,出场时表示滑出到上边。
Bottom 设置到入场时表示从下边滑入,出场时表示滑出到下边。

示例代码

import ohos.base.*
    import ohos.component.Column
    import ohos.component.Row
    import ohos.component.Button
    import ohos.component.Text
    import ohos.component.CustomView
    import ohos.component.CJEntry
    import ohos.component.loadNativeView
    import ohos.component.*
    import ohos.router.*
    import ohos.state_manage.SubscriberManager
    import ohos.state_manage.ObservedProperty
    import ohos.state_macro_manage.Entry
    import ohos.state_macro_manage.Component
    import ohos.state_macro_manage.State
    import ohos.state_macro_manage.r
    
    @Entry
    @Component
    class MyView {
        @State var scale2: Float32 = 1.0
        @State var opacity2: Float64 = 1.0
    
        func build() {
            Column() {
                Image(@r(app.media.background)).width(100.percent).height(100.percent)
            }
            .width(100.percent)
            .height(100.percent)
            .scale(x: scale2, y: 1.0)
            .opacity(this.opacity2)
            .onClick { e =>
                Router.push(url: "Page1")
            }
        }
    
        protected func onTransition(): Unit {
            PageTransitionEnter(PageTransitionOptions(duration: 1200, curve: Curve.Linear))
            .onEnter { ty: RouteType, progress: Float64 =>
                match (ty) {
                    case RouteType.Push | RouteType.Pop =>
                        scale2 = Float32(progress)
                        opacity2 = progress
                    case _ => ()
                }
            }
            PageTransitionExit(PageTransitionOptions(duration: 1200, curve: Curve.Ease))
            .onExit { ty: RouteType, progress: Float64 =>
                match (ty) {
                    case RouteType.Push =>
                        this.scale2 = Float32(1.0 - progress)
                        this.opacity2 = 1.0 - progress
                    case _ => ()
                }
            }
        }
    }
    // page1.cj
    @Entry
    @Component
    class Page1 {
        @State var scale1: Float32   = 1.0
        @State var opacity1: Float64  = 1.0
    
        func build() {
            Column() {
                Image(@r(app.media.background)).width(50.percent).height(50.percent)
            }
            .width(100.percent)
            .height(100.percent)
            .scale(x: scale1, y: 1.0)
            .opacity(opacity1)
            .onClick { e =>
                Router.push(url: "MyView")
            }
        }
    
        protected func onTransition(): Unit {
            PageTransitionEnter(PageTransitionOptions(duration: 1200, curve: Curve.Linear))
            .onEnter { ty: RouteType, progress: Float64 =>
                match (ty) {
                    case RouteType.Push | RouteType.Pop =>
                        scale1 = Float32(progress)
                        opacity1 = progress
                    case _ => ()
                }
            }
            PageTransitionExit(PageTransitionOptions(duration: 1200, curve: Curve.Ease))
            .onExit { ty: RouteType, progress: Float64 =>
                match (ty) {
                    case RouteType.Push =>
                        this.scale1 = Float32(1.0 - progress)
                        this.opacity1 = 1.0 - progress
                    case _ => ()
                }
            }
        }
    }

[图片上传失败...(image-af19c9-1735046595391)]

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 217,657评论 6 505
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,889评论 3 394
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,057评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,509评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,562评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,443评论 1 302
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,251评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,129评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,561评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,779评论 3 335
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,902评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,621评论 5 345
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,220评论 3 328
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,838评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,971评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,025评论 2 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,843评论 2 354

推荐阅读更多精彩内容