DrawableUtils.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:boohee_v5.6 作者:
private static boolean setContainerConstantStateV9(DrawableContainer drawable, ConstantState constantState) {
    if (!sSetConstantStateMethodFetched) {
        try {
            sSetConstantStateMethod = DrawableContainer.class.getDeclaredMethod("setConstantState", new Class[]{DrawableContainerState.class});
            sSetConstantStateMethod.setAccessible(true);
        } catch (NoSuchMethodException e) {
            Log.e(LOG_TAG, "Could not fetch setConstantState(). Oh well.");
        }
        sSetConstantStateMethodFetched = true;
    }
    if (sSetConstantStateMethod != null) {
        try {
            sSetConstantStateMethod.invoke(drawable, new Object[]{constantState});
            return true;
        } catch (Exception e2) {
            Log.e(LOG_TAG, "Could not invoke setConstantState(). Oh well.");
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号