Wait for an element then return true or false

I have this method which waits for an element

    public void waitForElement(MobileElement element) {
    WebDriverWait wait = new WebDriverWait(driver, 30);

This is work. But I need a method to combine with isDisplayed() for an element if it doesn’t appear to return false or true if it appears.

Do this:
public boolean waitForElement(MobileElement element){
WebElement elementToWaitFor=new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(element));
return elementToWaitFor.isDisplayed();