ServerListAdapter.java 文件源码

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

项目:revolution-irc 作者:
public void bind(ServerListAdapter adapter, ServerConnectionInfo connectionInfo) {
    mConnectionInfo = connectionInfo;

    Drawable d = DrawableCompat.wrap(mIconBg.getBackground());
    if (connectionInfo.isConnected()) {
        DrawableCompat.setTint(d, adapter.mColorConnected);
        mIcon.setImageResource(R.drawable.ic_server_connected);
        int channels = connectionInfo.getChannels().size();
        mDesc.setText(mDesc.getResources().getQuantityString(R.plurals.server_list_connected, channels, channels));
    } else if (connectionInfo.isConnecting()) {
        DrawableCompat.setTint(d, adapter.mColorConnecting);
        mIcon.setImageResource(R.drawable.ic_refresh);
        mDesc.setText(R.string.server_list_connecting);
    } else {
        DrawableCompat.setTint(d, adapter.mColorDisconnected);
        mIcon.setImageResource(R.drawable.ic_close);
        mDesc.setText(R.string.server_list_disconnected);
    }
    mIconBg.setBackgroundDrawable(d);
    mName.setText(connectionInfo.getName());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号