zoukankan      html  css  js  c++  java
  • 安卓——animotion

    1. 在 layout下建立文件夹 animator写入动画文件xml
    <?xml version="1.0" encoding="utf-8"?>
    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="textSize"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="10.0"-->
    <!--android:valueTo="40.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse"-->
    <!--/>-->
    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="alpha"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="1.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->

    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="translationX"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="300.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->
    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="rotation"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="360.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="restart" />-->

    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="scaleX"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="2.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->



    <!--android:translationX=""-->
    <!--android:alpha=""-->
    <!--android:rotation=""-->
    <!--android:scaleX=""-->

    <set android:ordering="together"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:propertyName="rotationY"
    android:valueType="floatType"
    android:valueFrom="0.0"
    android:valueTo="360.0"
    android:repeatCount="-1"
    android:repeatMode="restart" />

    <!--<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"-->
    <!--android:duration="3000"-->
    <!--android:propertyName="translationY"-->
    <!--android:valueType="floatType"-->
    <!--android:valueFrom="0.0"-->
    <!--android:valueTo="300.0"-->
    <!--android:repeatCount="-1"-->
    <!--android:repeatMode="reverse" />-->

    <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="3000"
    android:propertyName="textSize"
    android:valueType="floatType"
    android:valueFrom="10.0"
    android:valueTo="16.0"
    android:repeatCount="-1"
    android:repeatMode="reverse"
    />

    <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:propertyName="textColor"
    android:valueType="colorType"
    android:valueFrom="#95868686"
    android:valueTo="#951455ed"
    android:repeatCount="-1"
    android:repeatMode="reverse"
    />

    </set>





    2. JAVA加载
    tv=(TextView) findViewById(R.id.tv);
    // 1 context
    Animator animator= AnimatorInflater.loadAnimator(MainActivity.this,R.animator.animator);
    animator.setTarget(tv);
    animator.start();
  • 相关阅读:
    HTML-body标签介绍-2
    HTML-body标签介绍-1
    HTML-简介及header
    中文字体编辑工具 Fontmin
    移动端点击复制文本 clipboard.js
    alert弹窗样式修改
    关闭微信页面与微信分享等配置
    Emmet 使用
    js cookie
    select 清除默认样式
  • 原文地址:https://www.cnblogs.com/embaobao/p/10720862.html
Copyright © 2011-2022 走看看