Android 安卓动画 属性动画 - 组合动画

补间动画-缩放动画:  https://blog.csdn.net/qq_40881680/article/details/82260914

补间动画-旋转动画:  https://blog.csdn.net/qq_40881680/article/details/82261557

补间动画-透明/渐变动画:  https://blog.csdn.net/qq_40881680/article/details/82261869

补间动画-组合动画(四个动画一起播放):  https://blog.csdn.net/qq_40881680/article/details/82285987

属性动画

属性动画-渐变透明动画:  https://blog.csdn.net/qq_40881680/article/details/82318363

属性动画-旋转动画:  https://blog.csdn.net/qq_40881680/article/details/82354017

属性动画-缩放动画:  https://blog.csdn.net/qq_40881680/article/details/82377850

属性动画-移动动画:  https://blog.csdn.net/qq_40881680/article/details/82378391

属性动画-组合动画:  https://blog.csdn.net/qq_40881680/article/details/82381258


布局文件 篇


<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”

xmlns:app=“http://schemas.android.com/apk/res-auto”

xmlns:tools=“http://schemas.android.com/tools”

android:layout_width=“match_parent”

android:layout_height=“match_parent”

android:orientation=“vertical”

tools:context=“.MainActivity”>

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“0dp”

android:layout_weight=“1”

android:background=“#9c98ce”

android:orientation=“vertical”

android:paddingLeft=“20dp”

android:paddingRight=“20dp”

android:paddingTop=“10dp”>

<Button

android:id=“@+id/button”

android:layout_width=“match_parent”

android:layout_height=“wrap_content”

android:background=“#5b7bda”

android:text=“点击演示动画”

android:textColor=“#fff” />

<LinearLayout

android:layout_width=“match_parent”

android:layout_height=“0dp”

android:layout_weight=“4”

android:orientation=“vertical”>

<ImageView

android:id=“@+id/image”

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:layout_marginTop=“20dp”

android:background=“@mipmap/kuiba” />

<TextView

android:layout_width=“wrap_content”

android:layout_height=“wrap_content”

android:layout_gravity=“center”

android:text=“《魁拔》”

android:textSize=“18sp” />


代码逻辑 篇


属性动画用到的是:ObjectAnimator

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

ObjectAnimator objectAnimator1;

ObjectAnimator objectAnimator2;

ObjectAnimator objectAnimator3;

private Button button;

private ImageView image;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

initView();

}

private void initView() {

button = (Button) findViewById(R.id.button);

image = (ImageView) findViewById(R.id.image);

button.setOnClickListener(this);

image.setOnClickListener(this);

}

@Override

public void onClick(View v) {

switch (v.getId()) {

case R.id.button:

objectAnimator1 = ObjectAnimator.ofFloat(image,“translationX”,0f,60f,0f);

objectAnimator2 = ObjectAnimator.ofFloat(image,“translationY”,0f,60f,0f);

objectAnimator3 = ObjectAnimator.ofFloat(image,“alpha”,1f,0f);

AnimatorSet animatorSet = new AnimatorSet();

最后

只要是程序员,不管是Java还是Android,如果不去阅读源码,只看API文档,那就只是停留于皮毛,这对我们知识体系的建立和完备以及实战技术的提升都是不利的。

真正最能锻炼能力的便是直接去阅读源码,不仅限于阅读各大系统源码,还包括各种优秀的开源库。

腾讯、字节跳动、阿里、百度等BAT大厂 2019-2021面试真题解析

资料太多,全部展示会影响篇幅,暂时就先列举这些部分截图

《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》点击传送门,即可获取!
转存中…(img-zO8o2g2o-1714641235166)]

腾讯、字节跳动、阿里、百度等BAT大厂 2019-2021面试真题解析

[外链图片转存中…(img-kWkL5XlA-1714641235166)]

资料太多,全部展示会影响篇幅,暂时就先列举这些部分截图

《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》点击传送门,即可获取!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值