How to control accessibility focus for swipe down navigation for layout that has popup Window?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 05:50:08

问题


I have a layout that looks like this.

The view on the upper right (black background with white text) is a PopupWindow that is displayed on this view as follows:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    btnShow = (Button) findViewById(R.id.btn_show);
    showToolTip();
}


private void showToolTip() {
    final PopupWindow popupWindow = new PopupWindow(this);
    popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
    popupWindow.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
    popupWindow.setContentView(getLayoutInflater().inflate(R.layout.popcontent, null));
    btnShow.post(new Runnable() {
        @Override
        public void run() {
            popupWindow.showAsDropDown(btnShow);
        }
    });
}

Now when talk back is on I can navigate this screen by using the swipe down gestures which results in the following focus points

First -> last focus

TooltipTest (title) -> Dismiss button -> S button -> Hello World Text View - > Bottom button -> tooltip

Question How can I change this sequence so that the tool tip is read/receives accessibility focus after the S button?

来源:https://stackoverflow.com/questions/33489549/how-to-control-accessibility-focus-for-swipe-down-navigation-for-layout-that-has

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!