package com.espritmobile.sim.restocheck.fragments;

import com.espritmobile.sim.restocheck.R;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class FirstUsePageFragment extends Fragment {
    
    public static final String ARG_PAGE = "page";

   
    private int mPageNumber;
    
    TextView mTextView;
    ImageView mImageView;
    LinearLayout mContainer;
    
    
    public static FirstUsePageFragment create(int pageNumber) {
        FirstUsePageFragment fragment = new FirstUsePageFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_PAGE, pageNumber);
        fragment.setArguments(args);
        return fragment;
    }

    public FirstUsePageFragment() {
    }
    
   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPageNumber = getArguments().getInt(ARG_PAGE);
        
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // Inflate the layout containing a title and body text.
        ViewGroup rootView = (ViewGroup) inflater
                .inflate(R.layout.fragment_first_use_page, container, false);

        // Set the title view to show the page number.
        mContainer = (LinearLayout) rootView.findViewById(R.id.contaier);
        mTextView = (TextView) rootView.findViewById(R.id.FirstUseText);
        //mImageView = (ImageView) rootView.findViewById(R.id.imgFirstUse);
        
        
        switch (mPageNumber) {
		case 0:
			mTextView.setText("page num " + (mPageNumber + 1));
			mContainer.setBackgroundResource(R.drawable.first_use1);
			//mImageView.setBackgroundResource(R.drawable.img1);
			break;
		case 1:
			mTextView.setText("page num " + (mPageNumber + 1));
			mContainer.setBackgroundResource(R.drawable.first_use2);
			//mImageView.setBackgroundResource(R.drawable.img2);
			break;
		case 2:
			mTextView.setText("page num " + (mPageNumber + 1));
			mContainer.setBackgroundResource(R.drawable.first_use3);
			//mImageView.setBackgroundResource(R.drawable.img3);
			break;
		}
        
        
        return rootView;
    }

    /**
     * Returns the page number represented by this fragment object.
     */
    public int getPageNumber() {
        return mPageNumber;
    }
}
