├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── clwater
│ │ │ │ └── androidanimation
│ │ │ │ └── MainActivity.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── clwater
│ │ │ └── androidanimation
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── clwater
│ │ └── androidanimation
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle
├── androidanimation01
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── clwater
│ │ │ │ └── androidanimation01
│ │ │ │ └── MainActivity.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── clwater
│ │ │ └── androidanimation01
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── clwater
│ │ └── androidanimation01
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle
├── androidanimation02
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── clwater
│ │ │ └── androidanimation02
│ │ │ ├── MainActivity.kt
│ │ │ ├── AnimationViewLightning.kt
│ │ │ └── AnimationViewWater.kt
│ ├── test
│ │ └── java
│ │ │ └── clwater
│ │ │ └── androidanimation02
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── clwater
│ │ └── androidanimation02
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle
├── androidanimation03
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── clwater
│ │ │ │ └── androidanimation03
│ │ │ │ └── MainActivity.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── clwater
│ │ │ └── androidanimation03
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── clwater
│ │ └── androidanimation03
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle
├── androidanimation05
├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── themes.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ ├── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ │ ├── values-night
│ │ │ │ │ └── themes.xml
│ │ │ │ ├── drawable-v24
│ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ └── drawable
│ │ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── clwater
│ │ │ │ │ └── androidanimation
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── CustomSunView.java
│ │ │ └── AndroidManifest.xml
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── clwater
│ │ │ │ └── androidanimation
│ │ │ │ └── ExampleUnitTest.java
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── com
│ │ │ └── clwater
│ │ │ └── androidanimation
│ │ │ └── ExampleInstrumentedTest.java
│ ├── proguard-rules.pro
│ └── build.gradle
├── settings.gradle
├── preview.gif
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── build.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
├── androidanimation06
├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── themes.xml
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── aaa.jpg
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ ├── values-night
│ │ │ │ │ └── themes.xml
│ │ │ │ ├── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ │ ├── drawable-v24
│ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ └── drawable
│ │ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── clwater
│ │ │ │ │ └── animation
│ │ │ │ │ └── MainActivity.java
│ │ │ └── AndroidManifest.xml
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── clwater
│ │ │ │ └── animation
│ │ │ │ └── ExampleUnitTest.java
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── com
│ │ │ └── clwater
│ │ │ └── animation
│ │ │ └── ExampleInstrumentedTest.java
│ ├── proguard-rules.pro
│ └── build.gradle
├── settings.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── .gitignore
├── build.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
├── androidanimation04_weather
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ │ └── clwater
│ │ │ │ └── androidanimation04_weather
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── SunView.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── clwater
│ │ │ └── androidanimation04_weather
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── clwater
│ │ └── androidanimation04_weather
│ │ └── ExampleInstrumentedTest.kt
├── .idea
│ └── runConfigurations.xml
├── proguard-rules.pro
└── build.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── caches
│ └── build_file_checksums.ser
├── vcs.xml
├── smartfox_info.xml
├── runConfigurations.xml
├── gradle.xml
├── modules.xml
├── misc.xml
├── codeStyles
│ └── Project.xml
└── inspectionProfiles
│ └── Project_Default.xml
├── settings.gradle
├── .gitignore
├── gradle.properties
├── README.md
├── gradlew.bat
├── gradlew
└── Android自定义View之鲨鱼和小鱼的等待动画.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/androidanimation01/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/androidanimation02/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/androidanimation03/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/androidanimation05/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/androidanimation06/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/androidanimation04_weather/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/androidanimation06/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "Animation_06"
2 | include ':app'
3 |
--------------------------------------------------------------------------------
/androidanimation05/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "AndroidAnimation"
2 | include ':app'
3 |
--------------------------------------------------------------------------------
/androidanimation05/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/preview.gif
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidAnimation
3 |
4 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Animation_06
3 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':androidanimation01', ':androidanimation02', ':androidanimation03', ':androidanimation04_weather'
2 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidAnimation01
3 |
4 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | androidanimation02
3 |
4 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | androidanimation03
3 |
4 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AndroidAnimation
3 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | androidanimation04_Weather
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation05/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/androidanimation06/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xxhdpi/aaa.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xxhdpi/aaa.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation03/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 | *.idea/
11 | *local.properties
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation01/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation02/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation05/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation06/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clwater/AndroidAnimation/HEAD/androidanimation04_weather/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.idea/smartfox_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Feb 06 10:54:38 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/androidanimation05/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Feb 09 13:49:13 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/androidanimation06/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jun 16 09:34:07 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/androidanimation05/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/androidanimation06/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/clwater/androidanimation/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 |
6 | class MainActivity : AppCompatActivity() {
7 |
8 | override fun onCreate(savedInstanceState: Bundle?) {
9 | super.onCreate(savedInstanceState)
10 | setContentView(R.layout.activity_main)
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/androidanimation04_weather/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/java/com/clwater/androidanimation/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.clwater.androidanimation;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 |
7 | public class MainActivity extends AppCompatActivity {
8 |
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.activity_main);
13 | }
14 | }
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/clwater/androidanimation/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/androidanimation01/src/test/java/clwater/androidanimation01/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation01
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/androidanimation02/src/test/java/clwater/androidanimation02/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation02
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/androidanimation03/src/test/java/clwater/androidanimation03/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation03
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/test/java/clwater/androidanimation04_weather/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation04_weather
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/test/java/com/clwater/animation/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.clwater.animation;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/androidanimation05/app/src/test/java/com/clwater/androidanimation/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.clwater.androidanimation;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/java/clwater/androidanimation04_weather/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation04_weather
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import kotlinx.android.synthetic.main.activity_main.*
6 |
7 | class MainActivity : AppCompatActivity() {
8 |
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | setContentView(R.layout.activity_main)
12 |
13 | sunView.satrtView()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/java/com/clwater/animation/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.clwater.animation;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.os.Bundle;
6 |
7 | public class MainActivity extends AppCompatActivity {
8 |
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.activity_main);
13 |
14 | CustomSunView cv_main = findViewById(R.id.cv_main);
15 | cv_main.setText("测试");
16 | cv_main.start();
17 | }
18 | }
--------------------------------------------------------------------------------
/androidanimation03/src/main/java/clwater/androidanimation03/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation03
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import kotlinx.android.synthetic.main.activity_main.*
6 |
7 | class MainActivity : AppCompatActivity() {
8 |
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | setContentView(R.layout.activity_main)
12 |
13 | animationplanet.setOnClickListener {
14 | animationplanet.changeView()
15 | }
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/androidanimation05/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath "com.android.tools.build:gradle:4.2.1"
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | jcenter() // Warning: this repository is going to shut down soon
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
--------------------------------------------------------------------------------
/androidanimation06/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath "com.android.tools.build:gradle:4.2.1"
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | jcenter() // Warning: this repository is going to shut down soon
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
--------------------------------------------------------------------------------
/androidanimation01/src/main/java/clwater/androidanimation01/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation01
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import kotlinx.android.synthetic.main.activity_main.*
6 |
7 | class MainActivity : AppCompatActivity() {
8 |
9 |
10 | override fun onCreate(savedInstanceState: Bundle?) {
11 | super.onCreate(savedInstanceState)
12 | setContentView(R.layout.activity_main)
13 |
14 | animationView.initView(0F,0F, 0xFFF9FAF9.toInt())
15 |
16 | button_main_start.setOnClickListener{ animationView.startView() }
17 |
18 | button_main_stop.setOnClickListener{ animationView.stopView() }
19 |
20 |
21 | }
22 | }
23 |
24 |
25 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/clwater/androidanimation/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("clwater.androidanimation", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AndroidAnimation
2 |
3 | [ Android自定义View之鲨鱼和小鱼的等待动画](https://github.com/clwater/AndroidAnimation/blob/master/%20Android%E8%87%AA%E5%AE%9A%E4%B9%89View%E4%B9%8B%E9%B2%A8%E9%B1%BC%E5%92%8C%E5%B0%8F%E9%B1%BC%E7%9A%84%E7%AD%89%E5%BE%85%E5%8A%A8%E7%94%BB.md)
4 |
5 | [Android自定义View之元素按钮](https://github.com/clwater/AndroidAnimation/blob/master/Android%E8%87%AA%E5%AE%9A%E4%B9%89View%E4%B9%8B%E5%85%83%E7%B4%A0%E6%8C%89%E9%92%AE.md)
6 |
7 | [Android自定义View之星球运动](https://github.com/clwater/AndroidAnimation/blob/master/Android%E8%87%AA%E5%AE%9A%E4%B9%89View%E4%B9%8B%E6%98%9F%E7%90%83%E8%BF%90%E5%8A%A8.md)
8 |
9 | [Android杂食店-一次自定义动画的实现](https://github.com/clwater/AndroidAnimation/blob/master/Android%E6%9D%82%E9%A3%9F%E5%BA%97-%E4%B8%80%E6%AC%A1%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8A%A8%E7%94%BB%E7%9A%84%E5%AE%9E%E7%8E%B0.md)
10 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/androidanimation01/src/androidTest/java/clwater/androidanimation01/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation01
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("clwater.androidanimation01", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/androidanimation02/src/androidTest/java/clwater/androidanimation02/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation02
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("clwater.androidanimation02", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/androidanimation03/src/androidTest/java/clwater/androidanimation03/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation03
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("clwater.androidanimation03", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/androidanimation05/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/androidanimation06/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/androidanimation01/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/androidanimation02/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/androidanimation03/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/androidanimation04_weather/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/androidTest/java/clwater/androidanimation04_weather/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation04_weather
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("clwater.androidanimation04_weather", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/java/clwater/androidanimation02/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation02
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import kotlinx.android.synthetic.main.activity_main.*
6 | import org.jetbrains.anko.sdk25.coroutines.onClick
7 |
8 | class MainActivity : AppCompatActivity() {
9 |
10 |
11 | override fun onCreate(savedInstanceState: Bundle?) {
12 | super.onCreate(savedInstanceState)
13 | setContentView(R.layout.activity_main)
14 |
15 | animationviewater_main.onClick {
16 | animationviewater_main.changeView()
17 | }
18 |
19 | animationvielighting_main.onClick {
20 | animationvielighting_main.changeView()
21 | }
22 |
23 | animationviefire_main.onClick {
24 | animationviefire_main.changeView()
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/androidTest/java/com/clwater/animation/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.clwater.animation;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.clwater.animation", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/androidTest/java/com/clwater/androidanimation/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.clwater.androidanimation;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.clwater.androidanimation", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/androidanimation05/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
--------------------------------------------------------------------------------
/androidanimation06/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
22 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/androidanimation06/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | compileSdkVersion 30
7 | buildToolsVersion "30.0.3"
8 |
9 | defaultConfig {
10 | applicationId "com.clwater.animation"
11 | minSdkVersion 26
12 | targetSdkVersion 30
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_1_8
27 | targetCompatibility JavaVersion.VERSION_1_8
28 | }
29 | }
30 |
31 | dependencies {
32 |
33 | implementation 'androidx.appcompat:appcompat:1.3.1'
34 | implementation 'com.google.android.material:material:1.4.0'
35 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
36 | testImplementation 'junit:junit:4.+'
37 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
39 | }
--------------------------------------------------------------------------------
/androidanimation05/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | }
4 |
5 | android {
6 | compileSdkVersion 30
7 | buildToolsVersion "30.0.3"
8 |
9 | defaultConfig {
10 | applicationId "com.clwater.androidanimation"
11 | minSdkVersion 28
12 | targetSdkVersion 30
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | compileOptions {
26 | sourceCompatibility JavaVersion.VERSION_1_8
27 | targetCompatibility JavaVersion.VERSION_1_8
28 | }
29 | }
30 |
31 | dependencies {
32 |
33 | implementation 'androidx.appcompat:appcompat:1.3.1'
34 | implementation 'com.google.android.material:material:1.4.0'
35 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
36 | testImplementation 'junit:junit:4.+'
37 | androidTestImplementation 'androidx.test.ext:junit:1.1.3'
38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
39 | }
--------------------------------------------------------------------------------
/androidanimation03/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | android {
5 | compileSdkVersion 27
6 |
7 |
8 |
9 | defaultConfig {
10 | applicationId "clwater.androidanimation03"
11 | minSdkVersion 23
12 | targetSdkVersion 27
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 |
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 | implementation fileTree(dir: 'libs', include: ['*.jar'])
31 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
32 | implementation 'com.android.support:appcompat-v7:26.1.0'
33 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
34 | testImplementation 'junit:junit:4.12'
35 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
36 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
37 | }
38 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | android {
8 | compileSdkVersion 26
9 | buildToolsVersion '27.0.3'
10 | defaultConfig {
11 | applicationId "clwater.androidanimation"
12 | minSdkVersion 23
13 | targetSdkVersion 26
14 | versionCode 1
15 | versionName "1.0"
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | implementation 'com.android.support:appcompat-v7:26.1.0'
29 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
30 | testImplementation 'junit:junit:4.12'
31 | androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
32 | exclude group: 'com.android.support', module: 'support-annotations'
33 | })
34 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
35 | }
36 |
--------------------------------------------------------------------------------
/androidanimation04_weather/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | android {
5 | compileSdkVersion 27
6 |
7 |
8 |
9 |
10 |
11 | defaultConfig {
12 | applicationId "clwater.androidanimation04_weather"
13 | minSdkVersion 23
14 | targetSdkVersion 27
15 | versionCode 1
16 | versionName "1.0"
17 |
18 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
19 |
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 |
29 | }
30 |
31 | dependencies {
32 | implementation fileTree(dir: 'libs', include: ['*.jar'])
33 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
34 | implementation 'com.android.support:appcompat-v7:27.1.1'
35 | implementation 'com.android.support.constraint:constraint-layout:1.1.0'
36 | testImplementation 'junit:junit:4.12'
37 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
38 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
39 |
40 | implementation "org.jetbrains.anko:anko:$anko_version"
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/androidanimation01/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | android {
5 | compileSdkVersion 26
6 | buildToolsVersion '27.0.3'
7 |
8 |
9 | defaultConfig {
10 | applicationId "clwater.androidanimation01"
11 | minSdkVersion 23
12 | targetSdkVersion 26
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 |
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 | implementation fileTree(dir: 'libs', include: ['*.jar'])
31 | implementation 'com.android.support:appcompat-v7:26.1.0'
32 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
33 | testImplementation 'junit:junit:4.12'
34 | androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
35 | exclude group: 'com.android.support', module: 'support-annotations'
36 | })
37 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
38 | implementation "org.jetbrains.anko:anko:$anko_version"
39 | }
40 |
--------------------------------------------------------------------------------
/androidanimation02/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | android {
5 | compileSdkVersion 26
6 | buildToolsVersion "27.0.3"
7 |
8 |
9 | defaultConfig {
10 | applicationId "clwater.androidanimation02"
11 | minSdkVersion 23
12 | targetSdkVersion 26
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 |
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 | implementation fileTree(dir: 'libs', include: ['*.jar'])
31 | implementation 'com.android.support:appcompat-v7:26.1.0'
32 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
33 | testImplementation 'junit:junit:4.12'
34 | androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
35 | exclude group: 'com.android.support', module: 'support-annotations'
36 | })
37 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
38 | implementation "org.jetbrains.anko:anko:$anko_version"
39 | }
40 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
19 |
24 |
25 |
30 |
31 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/androidanimation05/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/androidanimation06/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
17 |
22 |
27 |
32 |
37 |
42 |
47 |
52 |
57 |
62 |
67 |
72 |
77 |
82 |
87 |
92 |
97 |
102 |
107 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/androidanimation01/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
17 |
22 |
27 |
32 |
37 |
42 |
47 |
52 |
57 |
62 |
67 |
72 |
77 |
82 |
87 |
92 |
97 |
102 |
107 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
17 |
22 |
27 |
32 |
37 |
42 |
47 |
52 |
57 |
62 |
67 |
72 |
77 |
82 |
87 |
92 |
97 |
102 |
107 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/java/clwater/androidanimation04_weather/SunView.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation04_weather
2 |
3 | import android.animation.ValueAnimator
4 | import android.content.Context
5 | import android.graphics.*
6 | import android.util.AttributeSet
7 | import android.util.Log
8 | import android.view.View
9 | import android.view.animation.OvershootInterpolator
10 | import org.jetbrains.anko.doAsync
11 | import org.jetbrains.anko.uiThread
12 |
13 |
14 | class SunView : View {
15 | constructor(context: Context, radius: Float) : super(context) {
16 | this.radius = radius
17 | }
18 |
19 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
20 |
21 | var radius: Float = 0.0f
22 | var perIndex: Float = 0.0f
23 | val sacle = 0.6f
24 |
25 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
26 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
27 | }
28 |
29 | override fun onDraw(canvas: Canvas) {
30 | super.onDraw(canvas)
31 |
32 | radius = width * sacle
33 |
34 | canvas.translate(width.toFloat(), 0f)
35 | canvas.rotate(-45f)
36 |
37 | // canvas.translate(-300f, 0f)
38 |
39 | drawBaseSun(canvas)
40 | drawLightArc(canvas)
41 |
42 | }
43 |
44 | private fun drawLightArc(canvas: Canvas) {
45 | val offsetIndex = Math.sin(Math.PI * perIndex).toFloat()
46 | val offsetRadius = -(perIndex - 0.5f) * (perIndex - 0.5f) + 1
47 |
48 | canvas.rotate(-60f)
49 | canvas.rotate((offsetIndex * 60f))
50 |
51 |
52 | val r1 = (0.1f * radius * offsetRadius)
53 | val rectF1 = RectF(-r1, -r1, r1, r1)
54 | val r2 = (0.05f * radius * offsetRadius)
55 | val rectF2 = RectF(-r2, -r2, r2, r2)
56 |
57 |
58 | val paint1 = Paint()
59 | paint1.style = Paint.Style.FILL
60 |
61 | val paint2 = Paint()
62 | paint2.style = Paint.Style.FILL
63 |
64 |
65 | val colors = intArrayOf(0xffFFF5AF.toInt(), 0x30FFF5AF.toInt())
66 | val stops = floatArrayOf(0f, 1f)
67 |
68 | val radialGradient1 = RadialGradient(-r1 * 0.6f, 0f, 1.4f * r1, colors, stops, Shader.TileMode.MIRROR)
69 | paint1.shader = radialGradient1
70 | val radialGradient2 = RadialGradient(-r2 * 0.6f, 0f, 1.4f * r2, colors, stops, Shader.TileMode.MIRROR)
71 | paint2.shader = radialGradient2
72 |
73 | canvas.translate(-radius / 4f * 3 * offsetRadius, 0f)
74 | canvas.drawArc(rectF2, 0f, 360f, true, paint2)
75 |
76 | canvas.translate(-radius / 4f * offsetRadius, 0f)
77 | canvas.drawArc(rectF1, 0f, 360f, true, paint1)
78 | }
79 |
80 | private fun drawBaseSun(canvas: Canvas) {
81 | val rect = RectF(-radius, -radius, radius, radius)
82 | val paint = Paint()
83 |
84 | val colors = intArrayOf(Color.parseColor("#F19733"), Color.parseColor("#FBD650"))
85 | val stops = floatArrayOf(0f, 1f)
86 |
87 | val offsetX: Float
88 | val offsetY: Float
89 |
90 | if (perIndex <= 0.5) {
91 | offsetX = -radius * perIndex * 2 * 2
92 | } else {
93 | offsetX = -radius * (1 - perIndex) * 2 * 2
94 | }
95 |
96 |
97 | offsetY = -Math.sin(Math.PI * perIndex * 2).toFloat() * radius / 4
98 |
99 | val radialGradient = RadialGradient(offsetX, offsetY, 2 * radius, colors, stops, Shader.TileMode.MIRROR)
100 | paint.shader = radialGradient
101 |
102 | canvas.drawArc(rect,
103 | 135f,
104 | 90f,
105 | true,
106 | paint)
107 |
108 | }
109 |
110 |
111 | fun satrtView() {
112 | val timing = 1000 * 15
113 | doAsync {
114 | kotlin.run {
115 | while (true) {
116 | //动画的策略
117 | uiThread {
118 | startAnimator(timing.toLong())
119 | }
120 | Thread.sleep(timing.toLong())
121 | }
122 | }
123 | }
124 | }
125 |
126 | fun startAnimator(timing : Long){
127 | val va = ValueAnimator.ofFloat(0F, 1F)
128 | va.duration = timing
129 | va.addUpdateListener { animation ->
130 | perIndex = animation.animatedValue as Float
131 | perIndex = perIndex
132 | invalidate()
133 | }
134 | va.start()
135 | }
136 | }
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/androidanimation05/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/androidanimation06/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/java/clwater/androidanimation02/AnimationViewLightning.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation02
2 |
3 | import android.animation.ValueAnimator
4 | import android.content.Context
5 | import android.graphics.*
6 | import android.util.AttributeSet
7 | import android.view.View
8 | import android.graphics.RectF
9 | import android.view.animation.OvershootInterpolator
10 | import kotlin.collections.ArrayList
11 |
12 |
13 | /**
14 | * Created by gengzhibo on 2018/1/9.setLatestEventInfo
15 | */
16 | class AnimationViewLightning : View {
17 |
18 | var viewWidth : Float = 0F //背景宽度
19 | var viewHeight : Float = 0F //背景高度
20 | var perIndex : Float = 0F //当前坐标
21 | val baseR = 100F //展示view的半径
22 | val coefficient = 0.5F //内部闪电占整体的比例
23 | var viewBackgroundColor = 0xFFF9FAF9.toInt() //背景颜色
24 |
25 | data class Point(val x: Float , val y:Float) //坐标点的数据类
26 |
27 |
28 | constructor(context: Context) : super(context)
29 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
30 |
31 |
32 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
33 | val width = View.MeasureSpec.getSize(widthMeasureSpec)
34 | val heitht = View.MeasureSpec.getSize(heightMeasureSpec)
35 | //设置当前的背景高和宽为整个组件
36 | if (viewWidth == 0F) {
37 | viewWidth = width.toFloat()
38 | }
39 | if (viewHeight== 0F) {
40 | viewHeight = heitht.toFloat()
41 | }
42 | setMeasuredDimension(width, heitht)
43 | }
44 |
45 |
46 |
47 | //初始化相关参数,非0的宽及高和背景颜色
48 | fun initView(width: Float , height : Float , bgColor: Int) {
49 | if (width != 0F) {
50 | viewWidth = width
51 | }
52 | if (height != 0F) {
53 | viewHeight = height
54 | }
55 | viewBackgroundColor = bgColor
56 | }
57 |
58 |
59 |
60 | override fun onDraw(canvas: Canvas) {
61 | canvas.translate(width / 2F, height / 2F) // 将坐标系移动到画布中央
62 | canvas.scale(1F , -1F) //将画布y轴翻转
63 | canvas.rotate(45F) //旋转画布 方便计算
64 |
65 | //绘制闪电背景
66 | drawBaseButton(canvas , perIndex)
67 | //绘制闪电
68 | drawLighting(canvas , perIndex)
69 |
70 | }
71 |
72 |
73 | private fun drawLighting(canvas: Canvas , index: Float) {
74 | val baseR = baseR * coefficient
75 |
76 | var index = index
77 |
78 | var changeR = 0F
79 |
80 |
81 | //将整个闪电的运动拆成七个部分
82 | if (index <= 0.25){
83 | changeR = this.baseR + baseR
84 | changeR = (changeR * (1 - index / 0.25)).toFloat()
85 | }else if (index <= 0.4){
86 | index = index - 0.25F
87 | changeR = this.baseR
88 | changeR = -(changeR * (index / (0.4F - 0.25F)))
89 | }else if (index <= 0.6F){
90 | index = index - 0.4F
91 | changeR = this.baseR
92 | changeR = -changeR * (1 - index / 0.2F)
93 | }else if (index <= 0.7F){
94 | index = index - 0.6F
95 | changeR = baseR
96 | changeR = changeR * index / 0.1F
97 | }else if (index <= 0.8F){
98 | index = index - 0.7F
99 | changeR = baseR
100 | changeR = baseR - changeR * index / 0.1F
101 | }else if (index <= 0.9F){
102 | index = index - 0.8F
103 | changeR = baseR
104 | changeR = -changeR * index / 0.1F
105 | }else if (index <= 1F){
106 | index = index - 0.9F
107 | changeR = baseR
108 | changeR = -changeR + changeR * (index / 0.1F)
109 | }
110 |
111 |
112 | //设置画笔
113 | val path = Path()
114 | val paint = Paint()
115 | paint.strokeWidth = 5F
116 | paint.style = Paint.Style.FILL
117 | paint.color = viewBackgroundColor
118 |
119 | val points :MutableList = ArrayList()
120 | //设置绘制闪电的路径点
121 | points.add(pointFactory(60 , baseR))
122 | points.add(pointFactory(-45 , baseR / 2F))
123 | points.add(pointFactory(-45 - 90 , baseR / 5F))
124 | points.add(pointFactory(-30 - 90 , baseR))
125 | points.add(pointFactory(45 + 90 , baseR / 2F))
126 | points.add(pointFactory(45 , baseR / 5F))
127 | points.add(pointFactory(60 , baseR))
128 |
129 |
130 | //设置闪电的偏移量(模拟运动情况)
131 | //原本还想实现一个中心放大的透镜效果,但是效果很僵硬,只能移除了
132 | for (i in 0..points.size - 1){
133 | points.set(i , Point(points[i].x + changeR , points[i].y))
134 | }
135 |
136 |
137 | path.moveTo(points[0].x , points[0].y)
138 |
139 | for (index in 1..points.size - 1){
140 | path.lineTo(points[index].x , points[index].y)
141 | }
142 |
143 | canvas.drawPath(path , paint)
144 |
145 | //闪电绘制辅助坐标系
146 | // val paint2 = Paint()
147 | // paint2.strokeWidth = 5F
148 | // paint2.color = Color.YELLOW
149 | // canvas.drawLine(1000F , 0F ,-1000F , 0F , paint2)
150 | // canvas.drawLine( 0F ,-1000F , 0F , 1000F , paint2)
151 | }
152 |
153 |
154 | //绘制闪电背景
155 | private fun drawBaseButton(canvas: Canvas , index: Float) {
156 | //设置画笔
157 | val paint = Paint()
158 |
159 | //添加闪电移动到指定位置时的背景颜色设置
160 | if ((index <= 0.45F && index >= 0.35F) || (index >= 0.65F && index <= 0.75F)) {
161 | paint.color = Color.parseColor("#ACADAC")
162 | }else{
163 | paint.color = Color.parseColor("#595A59")
164 | }
165 |
166 | paint.style = Paint.Style.FILL
167 |
168 | //绘制闪电背景
169 | canvas.drawArc(RectF(-baseR, -baseR, baseR, baseR), 0F , 360F,true , paint)
170 |
171 | }
172 |
173 |
174 | //开始动画
175 | fun changeView() {
176 | val va = ValueAnimator.ofFloat(0F, 1F)
177 | va.duration = 2000
178 | va.interpolator = OvershootInterpolator()
179 | va.addUpdateListener { animation ->
180 | perIndex = animation.animatedValue as Float
181 | invalidate()
182 | }
183 | va.start()
184 | }
185 |
186 |
187 | fun pointFactory(angle: Int , length: Float): Point {
188 | val _angle = angle / 180F * Math.PI
189 | return Point((length * Math.sin(_angle)).toFloat(), (length * Math.cos(_angle)).toFloat())
190 | }
191 | }
--------------------------------------------------------------------------------
/androidanimation03/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/androidanimation04_weather/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/androidanimation06/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/androidanimation05/app/src/main/java/com/clwater/androidanimation/CustomSunView.java:
--------------------------------------------------------------------------------
1 | package com.clwater.androidanimation;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorListenerAdapter;
5 | import android.animation.ValueAnimator;
6 | import android.content.Context;
7 | import android.graphics.Canvas;
8 | import android.graphics.Color;
9 | import android.graphics.Paint;
10 | import android.util.AttributeSet;
11 | import android.view.View;
12 | import android.view.animation.AccelerateDecelerateInterpolator;
13 |
14 | import androidx.annotation.Nullable;
15 |
16 |
17 | import java.util.Random;
18 |
19 | /**
20 | * @author: clwater
21 | */
22 | public class CustomSunView extends View {
23 |
24 | //预设的颜色信息
25 | public enum CustomColor{
26 | Blue("#dbf3fb", "#cbebfb", "#bbebfb"),
27 | Yellow("#fbf3e3", "#faf2cb", "#fbebbb"),
28 | Red("#fbebeb", "#fbe3e3", "#fbd3d3"),
29 | Pink("#fbebfb", "#fbdbfb", "#fbd3fb");
30 |
31 | private final String color1, color2, color3;
32 |
33 | CustomColor(String color1, String color2, String color3) {
34 | this.color1 = color1;
35 | this.color2 = color2;
36 | this.color3 = color3;
37 | }
38 | }
39 |
40 | private CustomColor customColor = CustomColor.Blue;
41 | //当前view使用的宽高
42 | private int width, height;
43 | //差值器
44 | //可优化, 差值器工厂生成
45 | private float offset_1_1, offset_1_2, offset_2_1, offset_2_2, offset_3_1, offset_3_2;
46 | //是否开启动画
47 | boolean isStart = false;
48 |
49 | public CustomSunView(Context context) {
50 | super(context);
51 | }
52 |
53 | public CustomSunView(Context context, @Nullable AttributeSet attrs) {
54 | super(context, attrs);
55 | }
56 |
57 | @Override
58 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
59 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
60 | width = View.MeasureSpec.getSize(widthMeasureSpec);
61 | height = View.MeasureSpec.getSize(heightMeasureSpec);
62 | setMeasuredDimension(width, height);
63 | }
64 |
65 | public void setCustomColor(CustomColor customColor) {
66 | this.customColor = customColor;
67 | }
68 |
69 | @Override
70 | protected void onDraw(Canvas canvas) {
71 | super.onDraw(canvas);
72 |
73 | Paint paint = new Paint();
74 | paint.setAntiAlias(true);
75 | paint.setAlpha(50);
76 | paint.setStyle(Paint.Style.FILL);
77 |
78 | //圆的半径
79 | float radius = height * 0.75f;
80 |
81 | //圆的移动范围
82 | float baseRand = height / 32f;
83 |
84 | //依次绘制相应的圆
85 | //三个圆的圆心不同
86 | paint.setColor(Color.parseColor(customColor.color1));
87 | canvas.drawCircle(width + baseRand * offset_1_1,
88 | 0 + baseRand * offset_1_2,
89 | radius, paint);
90 |
91 | paint.setColor(Color.parseColor(customColor.color2));
92 | canvas.drawCircle(width - baseRand * 2 + baseRand * offset_2_1,
93 | 0 - baseRand * 2 + baseRand * offset_2_2,
94 | radius * 0.95f, paint);
95 |
96 |
97 | paint.setColor(Color.parseColor(customColor.color3));
98 | canvas.drawCircle(width + baseRand * 2 + baseRand * offset_3_1,
99 | 0 + baseRand * 2 + baseRand * offset_3_2,
100 | radius * 0.95f, paint);
101 |
102 |
103 | //是否已经开启了动画(差值器)
104 | if (!isStart){
105 | isStart = true;
106 | startAnimator();
107 | }
108 | }
109 |
110 |
111 | /**
112 | * @description 工具方法, 获取一定范围内带有正负的随机数
113 | */
114 | private float getRandomWithBool(){
115 | int random = getRandom(14, 6);
116 | if (getRandom(10, 0) > 5){
117 | return -random / 1f / 10;
118 | }else {
119 | return random / 1f / 10;
120 | }
121 | }
122 |
123 | /**
124 | * @description 工具方法, 获取指定范围内的随机数
125 | */
126 | private float getRandom(){
127 | int random = getRandom(14, 6);
128 | return random / 1f / 10;
129 | }
130 |
131 | /**
132 | * @description 工具方法, 获取一定范围内的随机数
133 | */
134 | private int getRandom(int MAX, int MIN){
135 | Random random = new Random();
136 | return random.nextInt(MAX - MIN + 1) + MIN;
137 | }
138 |
139 | /**
140 | * @description 差值器设定
141 | */
142 | public void animators(int index){
143 | ValueAnimator valueAnimator = ValueAnimator.ofFloat(0f, getRandomWithBool(), 0f , getRandomWithBool() , 0f);
144 | valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
145 | valueAnimator.setDuration((long) (8 * 1000 * getRandom()));
146 | valueAnimator.setRepeatCount(1);
147 | valueAnimator.addListener(new AnimatorListenerAdapter() {
148 | @Override
149 | public void onAnimationEnd(Animator animation) {
150 | super.onAnimationEnd(animation);
151 | //重新设置差值范围
152 | valueAnimator.setFloatValues(0f, getRandomWithBool(), 0f , getRandomWithBool() , 0f);
153 | valueAnimator.start();
154 | }
155 | });
156 | //这里针对不同的检测值使用了不同的差值器, 理论上一次动画循环的时间为每个差值器
157 | //循环时间的最小公约数. 但是我们又在差值器一次周期完成后又设置了新的时间.
158 | //理论上这个重复的周期会变得不易被观测
159 | valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
160 | @Override
161 | public void onAnimationUpdate(ValueAnimator animator) {
162 | //匹配不同差值
163 | switch (index){
164 | case 0:
165 | offset_1_1 = (float) animator.getAnimatedValue();
166 | //已第一个差值器变化为页面更新
167 | invalidate();
168 | break;
169 | case 1:
170 | offset_1_2 = (float) animator.getAnimatedValue();
171 | break;
172 | case 2:
173 | offset_2_1 = (float) animator.getAnimatedValue();
174 | break;
175 | case 3:
176 | offset_2_2 = (float) animator.getAnimatedValue();
177 | break;
178 | case 4:
179 | offset_3_1 = (float) animator.getAnimatedValue();
180 | break;
181 | case 5:
182 | offset_3_2 = (float) animator.getAnimatedValue();
183 | break;
184 | }
185 | }
186 | });
187 | valueAnimator.start();
188 | }
189 |
190 | /**
191 | * @description 开启动画
192 | */
193 | public void startAnimator() {
194 | for (int i = 0; i < 6; i++) {
195 | animators(i);
196 | }
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/ Android自定义View之鲨鱼和小鱼的等待动画.md:
--------------------------------------------------------------------------------
1 | # Android自定义View之鲨鱼和小鱼的等待动画
2 |
3 | > 之前在看文章的时候发现了一个gif动画,感觉很有意思,适逢最近学习kotlin,就打算用kotlin在android中实现一次,部分角度及参数设置的比较随意,如有需要可以可随意修改
4 |
5 | 先看效果图
6 |
7 | 
8 |
9 | 部分角度及速率还有优化的空间,不过主要的效果都已经实现出来了
10 |
11 | ## 设计过程
12 | 因为是个动画,刚看的时候感觉无从下手,仔细分析过后,发现...其实很简单的
13 |
14 | 首先是一个循环的动画,先要找到某个循环的开始或者结束,我截取的某个循环部分是鲨鱼鳍在右侧,本地左右变化几下,然后向左追逐小鱼到左侧部分.向右的部分,通过将向左的部分x镜像一下就可以得到.
15 |
16 | 由此可以将整个画面拆成三个部分:
17 | * 其一是水面的部分,水面以下及水面和鱼接触的部分的留白处理都是在后面鲨鱼和小鱼处进行的,所以最后绘制的是一个水面以下部分的遮挡,这个部分也是一个比较好绘制的部分
18 | * 其二是鲨鱼鳍的部分, 这个部分难度中等,主要的难度是两个圆找交点的计算过程...如果有需要可以根据代码设计相关参数进行调整
19 | * 其三是小鱼的部分,这个是画面中最难实现的部分,主要涉及小鱼的绘制(椭圆及三角形),小鱼的水面的接触时水面的留白,小鱼入水的时候溅起的水花
20 |
21 | ## 代码实现
22 | ### 水面部分
23 | 代码就不放了,因为只是单纯的绘制个线和下部的遮盖,可以看看效果图
24 |
25 | 水面
26 |
27 | 
28 |
29 | 为加遮盖的水面(可以看到水面之下的小鱼)
30 | 
31 |
32 | ### 鲨鱼部分
33 |
34 | 鲨鱼鳍的主要设计思路就是先绘制两个圆,再根据两个圆的交点决定绘制的圆弧范围,注意
35 | 绘制的时候遮盖下部的水面
36 |
37 |
38 | 效果图
39 |
40 | 
41 |
42 |
43 | ```java
44 | //绘制鲨鱼鳍
45 | //鲨鱼鳍由两个圆弧组成
46 | private fun drawShark(index: Float, canvas: Canvas) {
47 | //初始化画笔相关
48 | val p = Paint()
49 | p.strokeWidth = 5F
50 | p.color = Color.BLACK
51 | p.style = Paint.Style.STROKE
52 |
53 | //设置外面鱼鳍的半径
54 | val r = 100F
55 | //设置偏移量
56 | var xofset = -65 //向右为正
57 | var yofset = 0 //向下为正
58 |
59 | //绘制外面鱼鳍
60 | drawSharkOut(canvas , index , r , xofset , yofset , isRight , p)
61 | //绘制内部鱼鳍
62 | drawSharkIn(canvas , index , r , xofset , yofset , isRight , p)
63 |
64 | p.color = viewBackgroundColor
65 | //将鱼鳍出现的水面部分设置为空
66 | canvas.drawLine(index - r - xofset - viewWidth/2, 0F , index + r + xofset - viewWidth/2, 0F, p)
67 |
68 | // p.color = Color.BLACK
69 | // //绘制前面的小鱼
70 | // drawFish(canvas , index , p)
71 |
72 | }
73 |
74 | //区分鱼鳍的方向绘制外部鱼鳍
75 | fun drawSharkOut(canvas: Canvas , index: Float, r: Float, xofset: Int, yofset: Int, directionRight: Boolean, p: Paint) {
76 | if (directionRight){
77 | val xofset = xofset - viewWidth/2
78 | val rectf = RectF(index - r + xofset, -r + yofset , index + r + xofset , r + yofset)
79 | canvas.drawArc(rectf, -95F , 95F, false, p)
80 | }else{
81 | val xofset = 30 + xofset - viewWidth/2
82 | val rectf = RectF(index + xofset + yofset , -r , index + 2 * r + xofset, r + yofset )
83 | canvas.drawArc(rectf, -180F , 95F, false, p)
84 | }
85 |
86 |
87 | }
88 | //区分鱼鳍方向绘制内部鱼鳍
89 | fun drawSharkIn(canvas: Canvas , index: Float, r1: Float, xofset: Int, yofset: Int, directionRight: Boolean, p: Paint) {
90 | val r = (1.5 * r1).toInt()
91 | if (directionRight) {
92 | val xofset = (- (r - ( r - r1) * 0.6)).toInt() + xofset - viewWidth/2
93 | val rectf = RectF(index - r + xofset, (- r + yofset).toFloat(), index + r + xofset, (+ r + yofset).toFloat())
94 | canvas.drawArc(rectf, -42F, 42F, false, p)
95 | }else{
96 | val xofset = -45 + xofset - viewWidth/2
97 | val rectf = RectF(index + r + xofset, (- r + yofset).toFloat(), index + 3 * r + xofset, (+ r + yofset).toFloat())
98 | canvas.drawArc(rectf, -180F, 42F, false, p)
99 | }
100 |
101 | }
102 | ```
103 |
104 |
105 |
106 | ### 小鱼部分
107 | 小鱼部分设计三个部分,鱼身(本体,眼睛,鱼尾),鱼的运动,鱼入水时的水花.
108 |
109 | 小鱼的运动轨迹可以看出来是一个圆弧,涉及的部分就是要根据鲨鱼鳍的位置调整在运动圆环上的位置,简单的canvas变换就可以做到
110 |
111 | 鱼身,相对来说比较简单,一个椭圆,一个三角形,一个点就可以完成了,再实现的时候先绘制了一个和背景色相同的填充内部颜色的鱼,用来实现鱼的水面接触的部分留白.
112 |
113 | 小鱼入水的水花实际上是在鱼的两侧没测画两个圆弧,当小鱼和入水越来越深(canvas的旋转的角度越来越大的时候,同一侧的两个水花之间的间隔也会变大,用来模拟水花的下落)
114 |
115 | 小鱼还未出水的部分(关闭水面下发的遮盖)
116 |
117 | 
118 |
119 | 小鱼和水面接触的部分(遮盖水面的绘制)
120 |
121 | 
122 |
123 | 小鱼入水时的水花效果
124 |
125 | 
126 |
127 | 代码实现
128 |
129 | ```java
130 | //绘制前面逃跑的小鱼
131 | private fun drawFish(canvas: Canvas, index: Float, p: Paint) {
132 |
133 | //设置鱼运动轨迹的圆心
134 | var xofsetFish = viewWidth / 5 * 2
135 | var yofsetFish = 0F
136 | //设置鱼的宽度及高度
137 | val widthFish = 20F
138 | val heightFish = 12F
139 | //设置鱼鳍的宽度及高度
140 | val widthFishTail = 20F
141 | val heightFishTail = 10F
142 |
143 | //将画布中心移动到鱼轨迹的中心位置
144 | canvas.translate(xofsetFish - viewWidth/2 , yofsetFish)
145 | //旋转画布旋转到起始角度
146 | canvas.rotate(90F)
147 | //根据当前的坐标位置计算鱼的偏移量及偏移角度
148 | val per = (index - viewWidth / 5 * 2) / (viewWidth / 5 * 2)
149 | val degreesi =per * 360 + 10
150 | canvas.rotate(degreesi)
151 |
152 |
153 | //如果当前per小于0.4说明整体在水面下,则不进行绘制
154 | if (per > 0.4) {
155 |
156 | xofsetFish = 0F
157 | yofsetFish = -viewWidth / 5
158 |
159 | //绘制鱼的身体部分并通过背景颜色填充
160 | //通过这种方法来覆盖水面和鱼接触的部分
161 | val rectF = RectF(xofsetFish - widthFish, yofsetFish - heightFish, xofsetFish + widthFish, yofsetFish + heightFish)
162 | p.color = viewBackgroundColor
163 | p.style = Paint.Style.FILL
164 | canvas.drawArc(rectF, 0F, 360F, true, p)
165 |
166 | //绘制鱼的身体部分
167 | p.color = Color.BLACK
168 | p.style = Paint.Style.STROKE
169 | canvas.drawArc(rectF, 0F, 360F, true, p)
170 |
171 | //绘制鱼尾的部分
172 | canvas.drawLine(xofsetFish + widthFish, yofsetFish, xofsetFish + widthFish + widthFishTail, yofsetFish + heightFishTail, p)
173 | canvas.drawLine(xofsetFish + widthFish + widthFishTail, yofsetFish + heightFishTail, xofsetFish + widthFish + widthFishTail, yofsetFish - heightFishTail, p)
174 | canvas.drawLine(xofsetFish + widthFish + widthFishTail, yofsetFish - heightFishTail, xofsetFish + widthFish, yofsetFish, p)
175 |
176 | //绘制鱼的眼睛
177 | canvas.drawPoint(xofsetFish - widthFish / 3, yofsetFish , p)
178 |
179 |
180 | //当per在[0.45,0.48]区间中绘制水面的水花
181 | if (per <= 0.48&& per >= 0.45){
182 |
183 | val water = 50F
184 | val waterR = 30F
185 | canvas.translate(0F ,yofsetFish + water)
186 | p.color = Color.BLACK
187 | p.style = Paint.Style.STROKE
188 | val waterRectF = RectF(-waterR , -waterR , waterR , waterR)
189 | canvas.drawArc(waterRectF, -90F , 30F , false, p)
190 | //计算区间的跨度,设置统一方向下两半水花的分散程度
191 | val changeWater = ( 1 - (per - 0.45) / 0.03) * 45
192 | canvas.drawArc(waterRectF, (-60 + changeWater).toFloat(), 30F , false, p)
193 |
194 | canvas.translate(0F , - 2 * water)
195 | canvas.drawArc(waterRectF, 90F , -30F , false, p)
196 | canvas.drawArc(waterRectF, (90 - changeWater).toFloat(), -30F , false, p)
197 | }
198 | }
199 | }
200 | ```
201 |
202 | 至此这个小动画就可以实现了,具体的代码可以查看[我的github](https://github.com/clwater/AndroidAnimation/tree/master/androidanimation01)
203 |
--------------------------------------------------------------------------------
/androidanimation02/src/main/java/clwater/androidanimation02/AnimationViewWater.kt:
--------------------------------------------------------------------------------
1 | package clwater.androidanimation02
2 |
3 | import android.animation.ValueAnimator
4 | import android.content.Context
5 | import android.graphics.*
6 | import android.util.AttributeSet
7 | import android.view.View
8 | import android.graphics.RectF
9 | import android.view.animation.OvershootInterpolator
10 |
11 |
12 |
13 |
14 |
15 | /**
16 | * Created by gengzhibo on 2018/1/4.
17 | */
18 | class AnimationViewWater : View {
19 |
20 | var viewWidth : Float = 0F //背景宽度
21 | var viewHeight : Float = 0F //背景高度
22 | var perIndex : Float = 0F //当前坐标
23 | val baseR = 100F //展示view的半径
24 | val coefficient = 0.35F //内部水滴占整体的比例
25 | val C = 0.552284749831f //利用贝塞尔绘制圆的常数
26 | var viewBackgroundColor = 0xFFF9FAF9.toInt() //背景颜色
27 |
28 | data class Point(val x: Float , val y:Float) //坐标点的数据类
29 |
30 |
31 | constructor(context: Context) : super(context)
32 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
33 |
34 |
35 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
36 | val width = View.MeasureSpec.getSize(widthMeasureSpec)
37 | val heitht = View.MeasureSpec.getSize(heightMeasureSpec)
38 | //设置当前的背景高和宽为整个组件
39 | if (viewWidth == 0F) {
40 | viewWidth = width.toFloat()
41 | }
42 | if (viewHeight== 0F) {
43 | viewHeight = heitht.toFloat()
44 | }
45 | setMeasuredDimension(width, heitht)
46 | }
47 |
48 |
49 |
50 | //初始化相关参数,非0的宽及高和背景颜色
51 | fun initView(width: Float , height : Float , bgColor: Int) {
52 | if (width != 0F) {
53 | viewWidth = width
54 | }
55 | if (height != 0F) {
56 | viewHeight = height
57 | }
58 | viewBackgroundColor = bgColor
59 | }
60 |
61 |
62 |
63 | override fun onDraw(canvas: Canvas) {
64 | canvas.translate(width / 2F, height / 2F) // 将坐标系移动到画布中央
65 | canvas.scale(1F,-1F) // 翻转Y轴
66 |
67 | //绘制水滴背景
68 | drawBaseButton(canvas , perIndex)
69 | //绘制水滴
70 | drawDrops(canvas , perIndex)
71 | }
72 |
73 |
74 | private fun drawDrops(canvas: Canvas , index: Float) {
75 | //设置水滴半径
76 | val baseR = baseR * coefficient
77 | val index = 1 - index
78 |
79 | //根据index将画布中心移动到对应位置
80 | canvas.translate( 0F , (this.baseR * 1.125F + baseR)* index - this.baseR / 8)
81 |
82 | //设置画笔
83 | val paint = Paint()
84 | paint.style = Paint.Style.FILL
85 | paint.color = viewBackgroundColor
86 | //存储关键点坐标
87 | val points : MutableList = ArrayList()
88 | points.add(Point(-baseR , 0F))
89 |
90 | //水滴顶部变换系数
91 | val topCoefficient = 1.5F
92 |
93 | points.add(Point(-baseR , baseR * C))
94 | points.add(Point(-baseR * C , baseR ))
95 | points.add(Point(0F, (1.5 * baseR + baseR * topCoefficient * index).toFloat()))
96 |
97 | points.add(Point(baseR * C , baseR))
98 | points.add(Point(baseR , baseR * C ))
99 | points.add(Point(baseR , 0F))
100 | //水滴底部变换系数
101 | //这两个变换系数使得水滴在下落的过程中渐渐变扁
102 | val bottomCoefficient = 0.3F
103 | val tempBaseR = (baseR - baseR * bottomCoefficient * index)
104 | points.add(Point(baseR , -tempBaseR * C))
105 | points.add(Point(baseR * C , -tempBaseR ))
106 | points.add(Point(0F, -tempBaseR))
107 |
108 | points.add(Point(-baseR * C , -tempBaseR))
109 | points.add(Point(-baseR , -tempBaseR * C ))
110 | points.add(Point(-baseR , 0F))
111 |
112 |
113 |
114 | //设置四个部分(90°一个部分)的贝塞尔曲线
115 | //关于贝塞尔曲线的事情... 感觉可以再做点记录
116 | val path = Path()
117 | path.moveTo(points[0].x , points[0].y)
118 | path.cubicTo(
119 | points[1].x , points[1].y ,
120 | points[2].x , points[2].y ,
121 | points[3].x , points[3].y)
122 |
123 | path.cubicTo(
124 | points[4].x , points[4].y ,
125 | points[5].x , points[5].y ,
126 | points[6].x , points[6].y)
127 |
128 | path.cubicTo(
129 | points[7].x , points[7].y ,
130 | points[8].x , points[8].y ,
131 | points[9].x , points[9].y)
132 |
133 | path.cubicTo(
134 | points[10].x , points[10].y ,
135 | points[11].x , points[11].y ,
136 | points[12].x , points[12].y)
137 |
138 | //绘制图形
139 | canvas.drawPath(path, paint)
140 | }
141 |
142 |
143 | //绘制水滴背景
144 | private fun drawBaseButton(canvas: Canvas , index: Float) {
145 | //计算水滴半进入区间(确定水滴背景上部变化范围)
146 | val waterRand = (baseR * 1.25 * coefficient) / ((baseR * 1.25 * coefficient) + baseR)
147 |
148 | //设置画笔
149 | val paint = Paint()
150 | paint.color = Color.parseColor("#45AAE1")
151 | paint.style = Paint.Style.FILL
152 |
153 | //绘制水滴背景下半部分的(此部分不需要变换)
154 | canvas.drawArc(RectF(-baseR, -baseR, baseR, baseR), 180F , 180F,true , paint)
155 |
156 | //设置点list 顺序存储相关路径及关键点
157 | val points : MutableList = ArrayList()
158 | points.add(Point(-baseR , 0F))
159 | points.add(Point(-baseR , baseR * C))
160 | points.add(Point(-baseR * C , baseR ))
161 |
162 | var baseButtonTop : Float
163 | //根据index判断上部的形态
164 | if (index <= waterRand){
165 | baseButtonTop = baseR - (baseR * coefficient * index) * 2
166 | }else{
167 | baseButtonTop = baseR - (baseR * coefficient) * 2 + (baseR * coefficient * index) * 2
168 | if (baseButtonTop > baseR){
169 | baseButtonTop = baseR
170 | }
171 | }
172 |
173 | points.add(Point(0F, baseButtonTop))
174 |
175 | points.add(Point(baseR * C , baseR))
176 | points.add(Point(baseR , baseR * C ))
177 | points.add(Point(baseR , 0F))
178 |
179 | val path = Path()
180 | //画笔移动到指定位置(不移动的话通过贝塞尔绘制的图形会有误差)
181 | path.moveTo(points[0].x , points[0].y)
182 | //设置贝塞尔曲线
183 | path.cubicTo(
184 | points[1].x , points[1].y ,
185 | points[2].x , points[2].y ,
186 | points[3].x , points[3].y)
187 |
188 | path.cubicTo(
189 | points[4].x , points[4].y ,
190 | points[5].x , points[5].y ,
191 | points[6].x , points[6].y)
192 | //绘制
193 | canvas.drawPath(path, paint)
194 | }
195 |
196 |
197 | //开始动画
198 | fun changeView() {
199 | val va = ValueAnimator.ofFloat(0F, 1F)
200 | va.duration = 1500
201 | va.interpolator = OvershootInterpolator()
202 | va.addUpdateListener { animation ->
203 | perIndex = animation.animatedValue as Float
204 | invalidate()
205 | }
206 | va.start()
207 | }
208 | }
--------------------------------------------------------------------------------