Is it wrong to automatically switch between Grid and List view

At the moment, I have a Material based app where I automatically change between List view and Grid view depending on device's viewport size, should I do that?

I already read here that they are content based and if the data fits well in both modes I should show some button so the user can change between them.

The layout looks like this:

grid view vs. list view

Also, in the material way, how should be the transition between Grid and List views?