Querying textual content from custom Android view that does not derive from TextView

25 views
Skip to first unread message

Phil Gref

unread,
Aug 12, 2016, 12:40:13 PM8/12/16
to calabash-android
Hi,

I have a custom view that displays textual content, but does not derive from android.widget.textview. While using Xamarin.UITest and the REPL, I noticed that the textual content would not be picked up, and could not be manipulated. I thought that I would solve the problem by making this textual content explicitly available to the Android accessibility API, but this did not solve my problem (as, from what I understand, only the "contentDescription" field is affected by accessibility). 

I then turned to the underlying Calabash framework to get more insight as to what was going on behind the scenes. I finally stumbled upon this code in Calabash.Android, which made me realize that achieving what I wanted would not be as easy as I thought, as I cannot directly make the control in question implement TextView and seemingly have have no way to indicate to Calabash that my custom view actually contains text or give a way to obtain this text.

Considering this, is there any way that I could achieve my goal of having Calabash detect the textual content of such a custom view?. I do have performance and compatibility limitations to consider, so adding nested TextView control to my custom view is something I`d rather avoid, but I`m open to any suggestion. 
Reply all
Reply to author
Forward
0 new messages