you can use while loop contains swipe function and set in your condition to check if element appear
Ex :
While (driver.findElements(By.id(“your_id”)).size()==0){
size = driver.manage().window().getSize();
int starty = (int) (size.height * 0.80);
int endy = (int) (size.height * 0.20);
int startx = size.width / 2;
System.out.println("starty = " + starty + " ,endy = " + endy + " , startx = " + startx);
driver.swipe(startx, starty, startx, endy, 3000);
Thread.sleep(2000);
driver.swipe(startx, endy, startx, starty, 3000);
Thread.sleep(2000);
}
once your element appear while will be stop and you can execute your action on it
i hope this help you