refactor swipelayout ontouch logic