package com.gensee.multi_instance.demo.player;


import android.annotation.SuppressLint;
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.GSImplVoteView;

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

	public VoteFragment() {

	}


//	private Player mPlayer;
	private View mView;
	private GSImplVoteView mGSImplVoteView;

//	public void setPlayer(Player player) {
//		this.mPlayer = player;
//	}
	public Player getPlayer() {
		return ((PlayerFragment)getParentFragment()).getPlayer();
	}

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

		mView = inflater.inflate(R.layout.imvote, null);
		mGSImplVoteView = (GSImplVoteView) mView.findViewById(R.id.impvoteview);
		mGSImplVoteView.post(new Runnable() {
			@Override
			public void run() {
				getPlayer().setGSVoteView(mGSImplVoteView);
			}
		});
		return mView;
	}

}