package es.verdnatura.presentation.view.feature.articulo.fragment

import es.verdnatura.R
import es.verdnatura.databinding.ActivityImageviewBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.loadUrl

class ImageViewActivity : BaseActivity<ActivityImageviewBinding>(){

    override fun getLayoutId(): Int = R.layout.activity_imageview


    override fun init() {
        binding.mainToolbar.toolbarTitle.text = intent.getStringExtra(getString(R.string.title))
        try {
            binding.imgView.loadUrl(intent.getStringExtra(getString(R.string.url))!!)
        }catch(ex:Exception){
            getString(R.string.errorImage).toast(this)
            finish()
        }


        binding.mainToolbar.backButton.setOnClickListener {
            finish()
        }
    }



}
