Dual state residency in 2016
In 2016, I was a California resident from January 1 to May 30 and became resident of Florida from May 31 till the end of the year. How should I file my state tax returns? Do I need to file for both California and Florida? Does tax calculation for a given state rely on the duration of the residency in that state or income earned while lived in that state (or is it both)?