diff --git a/screenshots/gplay/debug/com.owncloud.android.ui.dialog.DialogFragmentIT_testNewFolderDialog.png b/screenshots/gplay/debug/com.owncloud.android.ui.dialog.DialogFragmentIT_testNewFolderDialog.png index 926e540105..7ba93c0229 100644 Binary files a/screenshots/gplay/debug/com.owncloud.android.ui.dialog.DialogFragmentIT_testNewFolderDialog.png and b/screenshots/gplay/debug/com.owncloud.android.ui.dialog.DialogFragmentIT_testNewFolderDialog.png differ diff --git a/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java b/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java index 8ad0ff3761..a4ce36a1e5 100644 --- a/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java +++ b/src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java @@ -27,6 +27,9 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.content.Intent; import android.os.Looper; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; import com.nextcloud.client.account.RegisteredUser; import com.nextcloud.client.account.Server; @@ -161,6 +164,23 @@ public class DialogFragmentIT extends AbstractIT { getInstrumentation().waitForIdleSync(); shortSleep(); + ViewGroup viewGroup = dialog.requireDialog().getWindow().findViewById(android.R.id.content); + hideCursors(viewGroup); + screenshot(Objects.requireNonNull(dialog.requireDialog().getWindow()).getDecorView()); } + + private void hideCursors(ViewGroup viewGroup) { + for (int i = 0; i < viewGroup.getChildCount(); i++) { + View child = viewGroup.getChildAt(i); + + if (child instanceof ViewGroup) { + hideCursors((ViewGroup) child); + } + + if (child instanceof TextView) { + ((TextView) child).setCursorVisible(false); + } + } + } }