Movies within movies by Egantx7

Question 10

One scene in this film sees Robert coming downstairs to see Ethan watching Shrek. Robert appears upset, given that Ethan and his mother, Anna, had rescued him the night before, shortly after Robert had been forced to kill his faithful companion, Sam. Despite being out of it, Robert begins, reflexively, quoting the dialogue from Shrek exactly ... perhaps because he had watched this film many times with his late daughter. Identify this apocalyptic film set in New York sometime after a fictional "Batman vs. Superman" film had come out.

I Am Legend