package net.pokeranalytics.android.ui.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.fragment_bankroll.*
import kotlinx.android.synthetic.main.fragment_stats.recyclerView
import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.activity.components.PokerAnalyticsActivity
import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment

class BankrollFragment : PokerAnalyticsFragment() {

    companion object {

        /**
         * Create new instance
         */
        fun newInstance(): BankrollFragment {
            val fragment = BankrollFragment()
            val bundle = Bundle()
            fragment.arguments = bundle
            return fragment
        }
    }

	private lateinit var parentActivity: PokerAnalyticsActivity

	// Life Cycle

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_bankroll, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initData()
	    initUI()
    }


    // Business

    /**
     * Init data
     */
    private fun initData() {

    }

	/**
	 * Init UI
	 */
	private fun initUI() {

		parentActivity = activity as PokerAnalyticsActivity

		parentActivity.setSupportActionBar(toolbar)
		parentActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true)
		setHasOptionsMenu(true)

		val viewManager = LinearLayoutManager(requireContext())

		recyclerView.apply {
			setHasFixedSize(true)
			layoutManager = viewManager
			//adapter = statsAdapter
		}
	}

}