package com.zhan_dui.fragments;

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

import com.squareup.picasso.Picasso;
import com.zhan_dui.animetaste.R;
import com.zhan_dui.listener.VideoListItemListener;
import com.zhan_dui.modal.VideoDataFormat;

@SuppressLint("ValidFragment")
public class ShowFragment extends Fragment {

	private final VideoDataFormat mVideoInfo;
	private ImageView mShowImageView;

	public ShowFragment() {
		mVideoInfo = null;
	}

	public ShowFragment(VideoDataFormat VideoInfo) {
		mVideoInfo = VideoInfo;
	}

	public static ShowFragment newInstance(VideoDataFormat VideoInfo) {
		return new ShowFragment(VideoInfo);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View layout = inflater
				.inflate(R.layout.fragment_show, container, false);
		mShowImageView = (ImageView) layout.findViewById(R.id.show_image);
		mShowImageView.setImageResource(R.drawable.big_bg);
		Picasso.with(getActivity().getApplicationContext())
				.load(mVideoInfo.DetailPic).placeholder(R.drawable.big_bg)
				.error(R.drawable.big_bg).into(mShowImageView);
		mShowImageView.setTag(mVideoInfo);
		mShowImageView.setOnClickListener(new VideoListItemListener(
				getActivity(), mVideoInfo));
		return layout;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}
}

@@ -507,51 +507,8 @@
  %7B%0A%0A
-%09private final VideoDataFormat mVideoInfo;%0A
 %09pri
@@ -568,29 +568,8 @@
 ) %7B%0A
-%09%09mVideoInfo = null;%0A
 %09%7D%0A%0A
@@ -568,32 +568,39 @@
 ) %7B%0A%09%7D%0A%0A%09public 
+static 
 ShowFragment(Vid
@@ -591,24 +591,36 @@
 ShowFragment
+ newInstance
 (VideoDataFo
@@ -643,91 +643,111 @@
 %7B%0A%09%09
-mVideoInfo = VideoInfo;%0A%09%7D%0A%0A%09public static ShowFragment newInstance(VideoDataFormat
+ShowFragment f = new ShowFragment();%0A%09%09Bundle args = new Bundle();%0A%09%09args.putSerializable(%22video_info%22,
  Vid
@@ -757,47 +757,44 @@
 nfo)
- %7B%0A%09%09return new ShowFragment(VideoInfo)
+;%0A%09%09f.setArguments(args);%0A%09%09return f
 ;%0A%09%7D
@@ -1114,16 +1114,116 @@
 ig_bg);%0A
+%09%09VideoDataFormat mVideoInfo = (VideoDataFormat) getArguments()%0A%09%09%09%09.getSerializable(%22video_info%22);%0A
 %09%09Picass

解决issue#1