Unable to locate elements for which interactions are not available

I’m working on automating test cases for an Android App. In one scenario, a DialogFragment(https://developer.android.com/reference/android/app/DialogFragment) comes up on top of activity’s window.
My test cases tries to verify if a certain element is displayed or not using isDisplayed() method but every time this method return false even if the element is displayed on the DialogFragment.
Is this expected behavior?

Android Version : 7.0
Locator strategy used : Tried with id and xpath