---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by xujingyu.
--- DateTime: 2019-10-17 19:56
---
local _class = {
    _name = 'IdeaWaterfallCell',
    _version = '1.0'
}

---@public
function _class:new()
    local o = {}
    setmetatable(o, { __index = self })
    return o
end

---@public
function _class:cellView(width)

    self.cellLayout = LinearLayout(LinearType.VERTICAL):width(MeasurementType.MATCH_PARENT):height(MeasurementType.MATCH_PARENT)
    self.image = ImageView():width(width):height(130)
            :lazyLoad(false)
                            --:addCornerMask(6, ColorConstants.White, RectCorner.ALL_CORNERS)
    self.image:contentMode(ContentMode.SCALE_TO_FILL)
    self.cellLayout:addView(self.image)
    self.desc = Label():width(MeasurementType.MATCH_PARENT):height(20):textColor(ColorConstants.Black):fontSize(12):marginTop(8):lines(1)
    self.cellLayout:addView(self.desc)

    self.countLinear = View():width(MeasurementType.MATCH_PARENT):height(25):marginTop(8)
    self.cellLayout:addView(self.countLinear)

    self.authorhead = ImageView():width(25):height(25)
            :lazyLoad(false)
            --:bgColor(ColorConstants.Gray)
            :addCornerMask(25/2, ColorConstants.White, RectCorner.ALL_CORNERS)
    self.countLinear:addView(self.authorhead)
    self.authorName = Label():height(20):width(MeasurementType.WRAP_CONTENT):setMaxWidth(80):textColor(ColorConstants.DeepGray):fontSize(12):marginLeft(28):setGravity(Gravity.CENTER_VERTICAL)
    self.countLinear:addView(self.authorName)

    self.likeImg = ImageView():width(25):height(25):marginRight(28):setGravity(MBit:bor(Gravity.CENTER_VERTICAL, Gravity.RIGHT)):image("https://s.momocdn.com/w/u/others/2019/10/22/1571734558042-mls_love.png")
            :lazyLoad(false)
    self.countLinear:addView(self.likeImg)
    self.likeCount = Label():height(20):width(MeasurementType.WRAP_CONTENT):textColor(ColorConstants.DeepGray):fontSize(12):setGravity(MBit:bor(Gravity.CENTER_VERTICAL, Gravity.RIGHT))--:marginLeft(3)
    self.countLinear:addView(self.likeCount)
    return self.cellLayout
end

return _class