package com.gensee.fragement;

import android.annotation.SuppressLint;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.gensee.common.GenseeConfig;
import com.gensee.pdu.GSDocView;
import com.gensee.player.Player;
import com.gensee.playerdemo.R;
import com.gensee.view.GSDocViewGx;
import com.gensee.view.GSPduView;

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

	private Player mPlayer;
	private View mView;
	private GSDocViewGx mGlDocView;

	public DocFragment(Player player) {

		this.mPlayer = player;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		mView = inflater.inflate(R.layout.imdoc, null);
		mGlDocView = (GSDocViewGx) mView.findViewById(R.id.imGlDocView);
		mPlayer.setGSDocViewGx(mGlDocView);


//		AnnoFreepenEx.setFreepenExDrawable(new BitmapDrawable(getResources(), BitmapFactory.decodeResource(getResources(), R.drawable.freepen_ex)));
//		AnnoPointerEx.setPointerCircleDrawable(new BitmapDrawable(getResources(), BitmapFactory.decodeResource(getResources(), R.drawable.anno_pointer)));
//		AnnoPointerEx.setPointerCrossDrawable(new BitmapDrawable(getResources(), BitmapFactory.decodeResource(getResources(), R.drawable.anno_arrow)));
		return mView;

	}

	public void showView(boolean show) {
		if (mGlDocView != null) {
			mGlDocView.setVisibility(show ? View.VISIBLE : View.GONE);
		}
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		if (mGlDocView != null) {
			mGlDocView.destroy();
		}




	}
}
