how to add virtual views to some view and how during the clicking on one view change virtual structure of other view.

7 views
Skip to first unread message

Саша Козловский

unread,
Jun 25, 2020, 10:11:23 AM6/25/20
to eyes-f...@googlegroups.com, prog...@freelists.org
Hello everybody. I want to create virtual structure using
accessibilitynodeinfo class,but method addchild of accessibilityinfo
class not add virtual view. i have several buttons on my activity,and
this is example how i do it in oncreate method of my activity.
Button button = findViewById(R.id.button);
button.setAccessibilityDelegate(new View.AccessibilityDelegate() {
    @Override
    public void onInitializeAccessibilityNodeInfo(View host,
AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfo(host, info);
View v=new View(MainActivity.this);
v.setContentDescription("test");
v.setLayoutParams(new
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
v.setVisibility(View.VISIBLE);
info.addChild(v,1);
}
});
Why virtual view not adds to the my button,at least talkback not detect
this. Whether it issue of android 10 or talkback,which i must
immediately send to google? If this really an issue,how i can send it to
google? Also help me please,how during the clicking on one view i can
change/restore virtual structure of other view. It very important for
me,for example,when i will click on some item of listview and during the
clicking on item text of textview will change,and to my textview must
add a virtual views,where each virtual view will contain text of link
and during the clicking on this view it will execute my method for this
link. Yes,maybe it's really do something without virtual views,but this
app will use probably sighted people and i dont want do some tricks with
real views,because android api give us a feature use virtual views for
this,using accessibilitynodeinfo class. Thanks everybody for any help.

Reply all
Reply to author
Forward
0 new messages