package com.example.fragmentdynamic;



import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class CommandVideoFragment extends Fragment 
						implements OnClickListener{
	
	// reference to activity callback
	XXXXXXXXXXXXXXXXXXXXXXXXXX

	// definition of OnCommandVideoListener
	XXXXXXXXXXXXXXXXXXXXXXXXXX
	
	@Override
	// Called when the Fragment is attached to its parent Activity
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		
		// Get reference to parent Activity and check if parent implements listener
		try {
			XXXXXXXXXXXXXXXXXXXXXXXXXX
		} catch (ClassCastException e) {
			throw new ClassCastException(activity.toString() +"must implement OnValidateEventListener");
		}
	}
	
	
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
	        // Inflate the layout for this fragment
    		View view = inflater.inflate(R.layout.command_video_fragment, container, false); 
        
        	// register buttons click listener (ie activity!) 
    		XXXXXXXXXXXXXXXXXXXXXXXXXX
     		 return view;
     		
    }
    
  


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		CommandVideo cmdVideo = null ;
		Button btn=(Button)v;
		// SET-UP COMMAND TO SEND TO Video
		switch (btn.getId()){
			case R.id.btnStartVideo: cmdVideo= CommandVideo.START; break;
			XXXXXXXXXXXXXXXXXXXXXXXXXX
		}
		
		// FIRE method
		XXXXXXXXXXXXXXXXXXXXXXXXXX	
	}

	 
}
