Scroll, up, down, left, right according to the device scroll type in the main menu access

My aim is to write a test case which should be working for different type of device

Usecase: Launch the application main, and search for an application, click and launch it instead of using the package and activity

But the challenge is it should work across all devices, because some device scroll up and down to access the next screen of app try, some device scroll right left

How can this be handled, please advice