Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream doesn't always return #20

Open
Triden opened this issue Jan 24, 2024 · 6 comments
Open

stream doesn't always return #20

Triden opened this issue Jan 24, 2024 · 6 comments

Comments

@Triden
Copy link

Triden commented Jan 24, 2024

Hello, could you answer how to work with your package? For example, I want to get a specific element on the screen, but your stream doesn't always return all the elements. I go to the chrome page and only the text from the timer is returned. How can I return all the elements? I want to automate my work. For example, how to return not only changes, but also simply return the current elements?

Also, for example you don't have a click event as a percentage of the screen. You will have to create all this yourself

@Triden
Copy link
Author

Triden commented Jan 24, 2024

I'm ready to donate to you if you help me solve this issue.

@tanzil114
Copy link

@Triden Hi, I am doing something similar. I missed one thing, maybe its the same for you. Have you tried getting the subnodes as well?

FlutterAccessibilityService.accessStream.listen((event) {
        _sendEvent(event, socket, deviceId);
        for (var n in event.subNodes ?? []) {
          _sendEvent(n, socket, deviceId, parentPackageName: event.packageName);
        }
      });

@X-SLAYER
Copy link
Owner

The stream already returns a node with the children that represent other elements of these subnodes so basically you can try to explore it and check the example that I already tried maybe you can achieve the result that you

@tanzil114
Copy link

@X-SLAYER I am sending the events I am receiving from the stream to a socket server, so server can then decide to perform any action based on a certain event. The problem is I am not able to identify which event refers to what element in the screen, because the event which has the text doesn't have the click action available, and the element that does have click action, simply has 'null' in text. Can you please let me know how can I achieve this?

@Triden
Copy link
Author

Triden commented Feb 6, 2024

@Triden Hi, I am doing something similar. I missed one thing, maybe its the same for you. Have you tried getting the subnodes as well?

FlutterAccessibilityService.accessStream.listen((event) {
        _sendEvent(event, socket, deviceId);
        for (var n in event.subNodes ?? []) {
          _sendEvent(n, socket, deviceId, parentPackageName: event.packageName);
        }
      });

I wrote my own plugin that doesn't work through a thread. And it provides data upon request.

@Triden
Copy link
Author

Triden commented Feb 6, 2024

The stream already returns a node with the children that represent other elements of these subnodes so basically you can try to explore it and check the example that I already tried maybe you can achieve the result that you

Sorry, I also want to ask, are you by any chance going to add work with dispatchGesture?

I tried to add gestures and clicks. But they don't want to work for me.

fun clickAt(x: Int, y: Int): Boolean {
        val gestureBuilder = GestureDescription.Builder()
        val path = Path()
        path.moveTo(x.toFloat(), y.toFloat())
        gestureBuilder.addStroke(GestureDescription.StrokeDescription(path, 0, 1L))
        val gesture: GestureDescription = gestureBuilder.build()
        return dispatchGesture(gesture, object : GestureResultCallback() {
            override fun onCompleted(gestureDescription: GestureDescription) {
                Log.d("start", "+++++");
                super.onCompleted(gestureDescription)

            }

            override fun onCancelled(gestureDescription: GestureDescription) {
                Log.d("start", "-----");
                super.onCancelled(gestureDescription)

            }
        }, null)
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants