Android can only be called from within the same library group prefix (referenced groupId=androidx

Android can only be called from within the same library group prefix (referenced groupId=androidx,第1张

告警提示

ArgbEvaluator.getInstance can only be called from within the same library group prefix (referenced groupId=androidx.vectordrawable with prefix androidx from groupId=SchoolFacePay)
Inspection info:This API has been flagged with a restriction that has not been met. Examples of API restrictions: * Method can only be invoked by a subclass * Method can only be accessed from within the same library (defined by the Gradle library group id) * Method can only be accessed from tests. You can add your own API restrictions with the @RestrictTo annotation.

告警代码
private void initGradualAnim() {

        @SuppressLint("Recycle") ValueAnimator colorAnim
                = ObjectAnimator.ofInt(lcPayBack, "backgroundColor", BLUE, GREEN);
        colorAnim.setDuration(8000);
        colorAnim.setEvaluator(ArgbEvaluator.getInstance());
        colorAnim.setRepeatCount(ValueAnimator.INFINITE);
        colorAnim.setRepeatMode(ValueAnimator.REVERSE);

    }
告警位置

解决办法 一

在方法前面添加

@SuppressLint("RestrictedApi")

具体

@SuppressLint("RestrictedApi")
    private void initGradualAnim() {

        @SuppressLint("Recycle") ValueAnimator colorAnim
                = ObjectAnimator.ofInt(lcPayBack, "backgroundColor", BLUE, GREEN);
        colorAnim.setDuration(8000);
        colorAnim.setEvaluator(ArgbEvaluator.getInstance());
        colorAnim.setRepeatCount(ValueAnimator.INFINITE);
        colorAnim.setRepeatMode(ValueAnimator.REVERSE);

    }

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/992109.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存