Open vovkab opened 2 years ago
Looks like library is not loading animation correctly which leads to loading a wrong resource, i.e. it can try to load "dimen" as animation. As a result it crashes since it can't load other resource as animation.
Steps to reproduce:
<style name="ToolTipAnimation"> <item name="android:windowExitAnimation">@anim/ttlm_tooltip_anim_exit</item> </style>
As I can see the issue is that we are using incorrect indexes when loading resources:
val typedArray = context.theme.obtainStyledAttributes(mAnimationStyleResId, intArrayOf(android.R.attr.windowEnterAnimation, android.R.attr.windowExitAnimation)) mEnterAnimation = typedArray.getResourceId(typedArray.getIndex(0), 0) mExitAnimation = typedArray.getResourceId(typedArray.getIndex(1), 0) typedArray.recycle()
According to documentation:
The indices used to retrieve values from this structure correspond to the positions of the attributes given to obtainStyledAttributes. https://developer.android.com/reference/android/content/res/TypedArray
We should be passing index from the array, for example:
val typedArray = context.theme.obtainStyledAttributes(mAnimationStyleResId, intArrayOf(android.R.attr.windowEnterAnimation, android.R.attr.windowExitAnimation)) mEnterAnimation = typedArray.getResourceId(0, 0) mExitAnimation = typedArray.getResourceId(1, 0) typedArray.recycle()
Looks like library is not loading animation correctly which leads to loading a wrong resource, i.e. it can try to load "dimen" as animation. As a result it crashes since it can't load other resource as animation.
Steps to reproduce:
As I can see the issue is that we are using incorrect indexes when loading resources:
According to documentation:
We should be passing index from the array, for example: