package net.pokeranalytics.android.ui.activity

import android.os.Bundle
import net.pokeranalytics.android.R
import net.pokeranalytics.android.ui.activity.components.ReportActivity
import net.pokeranalytics.android.ui.fragment.report.TableReportFragment

class TableReportActivity : ReportActivity() {

	override fun onCreate(savedInstanceState: Bundle?) {
		super.onCreate(savedInstanceState)
		setContentView(R.layout.activity_table_report)
		initUI()
	}

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

		parameters?.let {

			val report = it.report
			val title = it.title

			val fragmentTransaction = supportFragmentManager.beginTransaction()
			val fragment = TableReportFragment.newInstance(report, title)
			fragmentTransaction.add(R.id.reportDetailsContainer, fragment)
			fragmentTransaction.commit()
		}
		parameters = null

	}

}