How to swiftly hide on-screen keyboard with a gesture?
Install Xposed edge module (see the help and support section on basics of how to use this module) 
In preferences gesture on soft keyboard is enabled by default. Disable that (optional) 
Choose an edge and the desired trigger (single tap, double tap etc from the 6 options) and action as soft keyboard &rarr; hide soft keyboard