-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffba166
commit 5a12223
Showing
8 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.wanglu.lib | ||
|
||
import android.animation.AnimatorSet | ||
import android.animation.ObjectAnimator | ||
import android.view.View | ||
|
||
class WCommonAnim(private val view: View) { | ||
|
||
private val animSet: AnimatorSet = AnimatorSet() | ||
private var scaleXAnim: ObjectAnimator? = null | ||
private var scaleYAnim: ObjectAnimator? = null | ||
|
||
|
||
|
||
init { | ||
animSet.duration = 200 | ||
} | ||
|
||
fun start() { | ||
if (animSet.isRunning) | ||
animSet.cancel() | ||
|
||
if (scaleXAnim == null) { | ||
scaleXAnim = ObjectAnimator.ofFloat(view, View.SCALE_X, 1.2f, 1f) | ||
scaleYAnim = ObjectAnimator.ofFloat(view, View.SCALE_Y, 1.2f, 1f) | ||
animSet.playTogether(scaleXAnim, scaleYAnim) | ||
} | ||
animSet.start() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters