package com.renrenliao.im.ui.activity

import com.bumptech.glide.Glide
import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.Target
import com.renrenliao.im.R
import com.renrenliao.im.base.BaseActivity
import kotlinx.android.synthetic.main.activity_bigimage.*

/**
 **@ClassName BigImageActivity
 **@Description
 **@Author gan
 **@Date 2022/6/8 19:00
 **/
class BigImageActivity:BaseActivity() {

    var url = ""

    override fun getLayoutResId(): Int = R.layout.activity_bigimage

    override fun initView() {
        url = intent.getStringExtra("url")

        val option = RequestOptions()
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .override(Target.SIZE_ORIGINAL,Target.SIZE_ORIGINAL)
            .format(DecodeFormat.PREFER_RGB_565)

        Glide.with(this)
            .setDefaultRequestOptions(option)
            .load(url)
            .into(iv)

        tool_bar.setOnBackListener {
            onBackPressed()
        }
    }

    override fun initData() {

    }
}