mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 21:25:35 +03:00
Merge pull request #6595 from nextcloud/hidCursor
Hide cursor to make UI test more stable
This commit is contained in:
commit
607ed3115e
2 changed files with 20 additions and 0 deletions
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.6 KiB |
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue