forked from JakeWharton/NineOldAndroids
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Animators defined in XMLs should work with Build Tools 22
Problem: Build Tools 22 removes attributes targeted to higher versions of Android from xml file, copying the original file to an appropriate bucket. On lower versions of Android (f.e. 9) NineOldAndroids can't access such attributes (as they are now in animator-vXX bucket) and crashes. Solution: let's use our own custom attributes instead of Android attributes. All XMLs defining animators should be changed - project namespace should be used instead of Android one. Fixes JakeWharton#80
- Loading branch information
Showing
6 changed files
with
85 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- | ||
Attributes similar to attributes from Android animator framework. Copied to be used on any | ||
version of Android without having build problems described here https://github.com/JakeWharton/NineOldAndroids/issues/80 | ||
--> | ||
<declare-styleable name="PropertyAnimator"> | ||
<attr name="propertyName" format="string" /> | ||
</declare-styleable> | ||
<declare-styleable name="AnimatorSet"> | ||
<attr name="ordering" format="enum"> | ||
<enum name="together" value="0" /> | ||
<enum name="sequentially" value="1" /> | ||
</attr> | ||
</declare-styleable> | ||
<declare-styleable name="Animator"> | ||
<attr name="interpolator" format="reference" /> | ||
<attr name="duration" format="integer" /> | ||
<attr name="startOffset" format="integer" /> | ||
<attr name="repeatCount" format="integer" /> | ||
<attr name="repeatMode" format="enum"> | ||
<enum name="restart" value="1" /> | ||
<enum name="reverse" value="2" /> | ||
</attr> | ||
<attr name="valueFrom" format="float|integer|color" /> | ||
<attr name="valueTo" format="float|integer|color" /> | ||
<attr name="valueType" format="enum"> | ||
<enum name="floatType" value="0" /> | ||
<enum name="intType" value="1" /> | ||
</attr> | ||
</declare-styleable> | ||
</resources> |
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
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