Can I file CA Form 540 alongside Federal Form 1040NR if I lived in California?

I'm a F1 student. I file 1040NR because it's my first year in the US. However, I have stayed in the CA the entire 2019. Should I file 540 or 540NR? My friend told me that CA consider resident or nonresident is different with federal. So since I stay in CA the entire 2019, I should file 540, instead of 540NR even I file 1040NR. Does anyone can help me regarding this matter? Thanks in advance!