当前位置:网站首页>Android gap animation translate, scale, alpha, rotate
Android gap animation translate, scale, alpha, rotate
2022-06-26 03:36:00 【kingsley1212】
Patch animation
Between the two keyframes, you need to do “ Patch animation ”, In order to realize the movement of pictures ; The interpolation frame between two key frames after interpolation animation is automatically calculated by computer .
1. transparency : alpha
2. Displacement :translate
3. The zoom :scale
4. rotate : rotate
android:interpolator( Interpolator )
- Animate to speed up the animation ( The animation is playing faster and faster )
android:interpolator="@android:anim/accelerate_interpolator" - Animate to slow down ( The animation is playing more and more slowly )
android:interpolator="@android:anim/decelerate_interpolator" - Animate to accelerate first and decelerate ( The fastest way to start Gradually slow down )
android:interpolator="@android:anim/accelerate_decelerate_interpolator" - First reverse the execution of a paragraph , Then accelerate the reverse direction back ( It's equivalent to our spring , First, compress a short segment in reverse , Then it's speeding up the pop-up )
android:interpolator="@android:anim/anticipate_interpolator" - As above, reverse a paragraph first , And then accelerate the reverse , After the execution, it has its own rebound effect ( More vivid spring effect )
android:interpolator="@android:anim/anticipate_overshoot_interpolator" - After execution, it will spring back and jump for several segments ( It's equivalent to dropping a ball of leather from the sky , It beats a few times to the ground )
android:interpolator="@android:anim/bounce_interpolator" - loop , Animation cycle a certain number of times , The value changes to a sine function :Math.sin(2* mCycles* Math.PI* input)
android:interpolator="@android:anim/cycle_interpolator" - Linear uniform change
android:interpolator="@android:anim/linear_interpolator" Linear uniform change - Speed up execution , Rebound at the end
android:interpolator="@android:anim/overshoot_interpolator"
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator">
<!--
fromXDelta,fromYDelta At the beginning X,Y coordinate , The coordinates in the lower right corner of the screen are X:320,Y:480
toXDelta, toYDelta At the end of the animation X,Y The coordinates of -->
<!--
The common ones are accelerometers and decelerators accelerate_decelerate_interpolator
Speed up the inserter accelerate_interpolator,
The retarder inserts decelerate_interpolator.
fromXScale,fromYScale, Before the animation starts X,Y Zoom in ,0.0 Not shown , 1.0 Normal size
toXScale,toYScale, The final zoom multiple of the animation , 1.0 Normal size , Greater than 1.0 Zoom in
pivotX, pivotY Animation start position , Percentage relative to screen , All two are 50% The animation starts in the middle of the screen
startOffset, The interval between multiple animations , If only once , It will be suspended before execution ,
Unit millisecond duration, The amount of time an animation takes , Unit millisecond ,
The smaller the value, the faster the animation repeatCount, Count of animation repetitions , The animation will execute the value +1 Time
repeatMode, The pattern of animation repetition ,reverse Is reverse , On the second execution , The animation will go in the opposite direction .
restart To re execute , Direction unchanged -->
<scale
android:startOffset="0"
android:fromXScale="0.0"
android:fromYScale="0.0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.0"
android:toYScale="1.0"
android:repeatMode="reverse"
android:duration = "3000"/>
<!--
fromAlpha: In the beginning, transparency
toAlpha: Transparency at the end
duration: Animation duration -->
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.5"
android:duration="3000"/>
<!-- fromDegrees The angle at which the animation starts
toDegrees The rotation angle of the object at the end of the animation , Positive represents clockwise
pivotX Property is the... Of the animation relative to the object X The starting position of the coordinates
pivotY Property is the... Of the animation relative to the object Y The starting position of the coordinates -->
<rotate android:fromDegrees="0"
android:toDegrees="720"
android:pivotY="50%"
android:pivotX="50%"
android:duration = "3000"/>
<!--
fromXDelta,fromYDelta At the beginning X,Y coordinate , Coordinates of the lower right corner of the screen X:320,Y:480
toXDelta, toYDelta At the end of the animation X,Y The coordinates of -->
<translate
android:fromXDelta="0"
android:toXDelta="100"
android:fromYDelta="0"
android:toYDelta="100" />
</set>
边栏推荐
猜你喜欢
Utonmos: digital collections help the inheritance of Chinese culture and the development of digital technology
解析社交机器人中的技术变革
显卡、GPU、CPU、CUDA、显存、RTX/GTX及查看方式
Mysql database foundation
解决uniapp插件robin-editor设置字体颜色和背景颜色报错的问题
Todolist incomplete, completed
MySQL addition, deletion, query and modification (primary level)
UE5全局光照系統Lumen解析與優化
MySQL开发环境
解析少儿编程的多元评价体系
随机推荐
Hardware creation principle of campus maker space
On virtual memory and oom in project development
Various errors in kitti2bag installation
路由跳轉之點擊列錶的操作按鈕,跳轉至另一個菜單頁面並激活相應的菜單
【Appium踩坑】io.appium.uiautomator2.common.exceptions.InvalidArgumentException: ‘capabilities‘ are mand
Drawing structure diagram with idea
Group note data representation and operation check code
golang正則regexp包使用-06-其他用法(特殊字符轉換、查找正則共同前綴、切換貪婪模式、查詢正則分組個數、查詢正則分組名稱、用正則切割、查詢正則字串)
gstreamer分配器与pool的那些事
P2483-[template]k short circuit /[sdoi2010] Magic pig college [chairman tree, pile]
【读点论文】FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining 网络结构和超参数全当训练参数给训练了
请求对象,发送请求
ArrayList # sublist these four holes, you get caught accidentally
校园创客空间的硬件造物原理
Analysis of the multiple evaluation system of children's programming
360 秒了解 SmartX 超融合基础设施
Double carbon bonus + great year of infrastructure construction 𞓜 deep ploughing into the field of green intelligent equipment for water conservancy and hydropower
Matlab| short term load forecasting of power system based on BP neural network
USB driver -debug
给网站添加“开放搜索描述“以适配浏览器的“站点搜索“