package com.sample.sample.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;

import com.sample.sample.R;
import com.sample.sample.SampleApplication;
import com.sample.sample.fragments.DashboardFragment;

public class MainActivity extends AppCompatActivity
{
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		((SampleApplication) getApplication()).getAppComponent().inject(this);

		setUpDashboardFragment();
	}

	private void setUpDashboardFragment()
	{
		DashboardFragment dashboardFragment = new DashboardFragment();

		FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
		fragmentTransaction.add(android.R.id.content, dashboardFragment, "TAG").commit();
	}
}
