package com.bokecc.livemodule.view.gift;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.ImageView;

import com.bokecc.gift.pojo.Gift;
import com.bokecc.dwlivedemo.R;
import com.bokecc.livemodule.utils.ImageLoader;
import com.bumptech.glide.Glide;

public class GiftAnimBottomCenterView extends GiftAnimView {
    private ImageView bigImageView;

    public GiftAnimBottomCenterView(Context context) {
        super(context);
    }

    public GiftAnimBottomCenterView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public GiftAnimBottomCenterView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public GiftAnimBottomCenterView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public int getLayout() {
        return R.layout.layout_gift_anim_bottom_center_view;
    }

    @Override
    protected void init(Context context) {
        super.init(context);
        bigImageView = findViewById(R.id.iv_big_gift);

    }

    @Override
    public void startAnim(Gift gift) {
        super.startAnim(gift);
        if (!TextUtils.isEmpty(gift.getGiftImg())){
            ImageLoader.loadIntoImageView(getContext().getApplicationContext(),gift.getGiftImg(),bigImageView);
        }
    }

    @Override
    public long getAnimWholeOutDuring() {
        return 3000;
    }
}
