package net.ddns.mahaljsp.ch14_03_listfragment;

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.TextView;

/**
 * Created by Thomas Wu(mahaljsp@gmail.com) on 2016/12/10.
 */

public class DetailArea extends Fragment {
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.detail_area, container, false);
        int position=((MainActivity)getActivity()).position;
        TextView txtMovie=(TextView)view.findViewById(R.id.txtMovie);
        TextView txtDetail=((TextView)view.findViewById(R.id.txtDetail));
        txtMovie.setText(((MainActivity)getActivity()).movies[position]);
        txtDetail.setText(((MainActivity)getActivity()).details[position]);
        return view;
    }
}
