package com.gensee.multi_instance.demo.player;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;

import com.gensee.multi_instance.R;
import com.gensee.player.Player;
import com.gensee.view.GSImplQaView;

public class QaFragment extends Fragment {

//	private Player mPlayer;
	private View mView;
	private GSImplQaView mGSQaView;

//	public void setPlayer(Player player) {
//		this.mPlayer = player;
//	}

	public QaFragment() {
	}
	public Player getPlayer() {
		return ((PlayerFragment)getParentFragment()).getPlayer();
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		mView = inflater.inflate(R.layout.imqa, null);
		mGSQaView = (GSImplQaView) mView.findViewById(R.id.impqaview);
		mGSQaView.post(new Runnable() {
			@Override
			public void run() {
				getPlayer().setGSQaView(mGSQaView);
			}
		});

		return mView;
	}

}