Doing something dreamily means acting as though you're half-awake or somewhat removed from reality. If you're thinking about your crush, you may respond to your math teacher's question by smiling dreamily.
If you're walking dreamily down the street, you're not fully aware of where you are and what you're doing, because your mind is elsewhere. When someone acts dreamily, they seen ti be thinking happy thoughts or having a lovely daydream. It may drive you crazy when you're waiting for your brother's pizza order as he stares dreamily out the window. Dreamily is from dream and its Germanic root, which means "deception or illusion."