You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-14Lines changed: 12 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,7 @@ Create gradient animations like Instagram&Spotify.
14
14
privatelateinitvar mSpark:Spark
15
15
16
16
overridefunonCreate(savedInstanceState:Bundle?) {
17
-
super.onCreate(savedInstanceState)
18
-
setContentView(R.layout.activity_main)
17
+
// ...
19
18
20
19
mSpark =Spark.Builder()
21
20
.setView(frameLayout) // View or view group
@@ -26,14 +25,12 @@ override fun onCreate(savedInstanceState: Bundle?) {
26
25
}
27
26
28
27
overridefunonResume() {
29
-
super.onResume()
30
-
28
+
// ...
31
29
mSpark.startAnimation()
32
30
}
33
31
34
32
overridefunonPause() {
35
-
super.onPause()
36
-
33
+
// ...
37
34
mSpark.stopAnimation()
38
35
}
39
36
```
@@ -104,7 +101,7 @@ dependencies {
104
101
</shape>
105
102
```
106
103
107
-
### Create the animation list
104
+
### Create the Animation List
108
105
`custom_anim_list.xml`
109
106
110
107
```xml
@@ -123,18 +120,19 @@ dependencies {
123
120
</animation-list>
124
121
```
125
122
126
-
### Apply your custom animation list
123
+
### Apply Your Custom Animation List
127
124
```kotlin
128
125
mSpark =Spark.Builder()
129
-
.setView(frameLayout) // View or view group
130
-
.setDuration(4000)
131
-
.setAnimList(Spark.ANIM_GREEN_PURPLE) // Your custom animation list
132
-
.build()
126
+
// ...
127
+
.setAnimList(R.drawable.custom_anim_list) // Your custom animation
128
+
// ...
133
129
```
134
130
135
-
For the colors, I referred to [Alexander Zaytsev](https://dribbble.com/anwaltzzz)'s [shot](https://dribbble.com/shots/3380672-Sketch-Gradients-Freebie) on Dribbble.
131
+
## Thanks
132
+
133
+
Designed by [Alexander Zaytsev](https://dribbble.com/anwaltzzz).
136
134
137
135

138
136
139
137
## License
140
-
Charles is under the MIT license. See the [LICENSE](LICENSE) for more information.
138
+
Spark is under the MIT license. See the [LICENSE](LICENSE) for more information.
0 commit comments