Newer
Older
DownApp / app / src / main / java / me / bell / downapp / util / goodsViewPager / PictureFragment.java
package me.bell.downapp.util.goodsViewPager;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import me.bell.downapp.R;
import me.bell.downapp.util.ImageUtils;


/**
 * Created by ubt on 16-9-6.
 */
@SuppressLint("ValidFragment")
public class PictureFragment extends Fragment {

    private String showUrl;
    private int local =0;  //是否本地图片

    public PictureFragment(){}

    public PictureFragment(String showUrl, int local) {
        this.showUrl = showUrl;
        this.local = local;

    }

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_max_pic, null);
        ImageView maxImg = (ImageView) view.findViewById(R.id.scale_pic_item);
//        if (local == 0){
//            ImageUtils.displayImagesFromLocal(maxImg, showUrl);
//        } else {
            ImageUtils.displayImg(getActivity(), maxImg, showUrl);
//        }
        return view;
    }
}