package com.wd.workoffice.ui.activity.mes;

import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.obs.services.ObsClient;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.util.GlideUtils;

import java.net.MalformedURLException;
import java.net.URL;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * 图片展示
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class ImageActivity extends WorkToolBarActivity {


    @BindView(R.id.iv_img)
    ImageView ivImg;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }


    @Override
    protected void initData() {
        try {

            GlideUtils.getRequest().load(  new URL(getIntent().getStringExtra("url"))).fitCenter().into(ivImg);
//
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
//        GlideUtils.getRequest().
//                load("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1593372030211&di=42cbef92719301915297debd7e1c6dd2&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F14%2F75%2F01300000164186121366756803686.jpg").override(400) .centerCrop().into(ivImg);


    }


    @Override
    protected void initEvent() {
    }


    @Override
    protected int layoutId() {
        return R.layout.activity_img;
    }


}
