FastAdapterUIUtils.java 文件源码

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

项目:GitHub 作者:
/**
 * helper to create an StateListDrawable for the given normal and pressed color
 *
 * @param normalColor  the normal color
 * @param pressedColor the pressed color
 * @return the StateListDrawable
 */
private static StateListDrawable getStateListDrawable(
        int normalColor, int pressedColor) {
    StateListDrawable states = new StateListDrawable();
    states.addState(new int[]{android.R.attr.state_pressed},
            new ColorDrawable(pressedColor));
    states.addState(new int[]{android.R.attr.state_focused},
            new ColorDrawable(pressedColor));
    states.addState(new int[]{android.R.attr.state_activated},
            new ColorDrawable(pressedColor));
    states.addState(new int[]{},
            new ColorDrawable(normalColor));
    return states;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号