ColorRow.java 文件源码

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

项目:tzPalette 作者:
public View getView(int position, View convertView, ViewGroup parent)
{
    View cellView;
    ColorCell colorView;

    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    cellView = inflater.inflate(R.layout.color_item, parent, false);

    if (animFadeInViewWhenAddNew && mNewlyAddedPosition == position)
    {
        cellView.setAlpha(0);
        cellView.setScaleX(.2f);
        cellView.setScaleY(.2f);
        cellView.animate().setInterpolator(new AnticipateOvershootInterpolator()).alpha(1).scaleX(1).scaleY(1).start();

        mNewlyAddedPosition = -1;
    }

    int cellSize = parent.getHeight();

    cellView.setMinimumHeight(cellSize);
    cellView.setMinimumWidth(cellSize);

    if (mCurSel == position)
    {
        cellView.setScaleX(1.2f);
        cellView.setScaleY(1.2f);
    }

    colorView = (ColorCell)cellView.findViewById(R.id.item_color);
    colorView.setMinimumHeight(cellSize - cellView.getPaddingTop() - cellView.getPaddingBottom());
    colorView.setMinimumWidth(cellSize - cellView.getPaddingLeft() - cellView.getPaddingRight());
    colorView.setColor(mColors.get(position));

    return cellView;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号