Repository navigation
Conversation
|
I reviewed the code and tested it on an Android 16 emulator, in Chrome and in a native 3-column RecyclerView grid, against its base commit (d3bbe47), with verbose logging. In the examples, "before" is the base and "after" is this PR. BehaviourTables without a header row
The same happens in native grids. In a photo-style grid, the first row's items become "Row 1, Column 2, Photo 2, Column heading", and every other item gets the first-row item in its column as a header: "Row 4, Column 2, Photo 11. Photo 2". Before: "Photo 10, Row 4, Column 1", "Photo 11, Column 2". Header cells lose their text Cells in a real header row ( Spanning headers With a header row of "First half" and "Second half" (each spanning two columns) above Q1–Q4, the Q1–Q4 headers are never used for data cells. Columns 2 and 4 get "First half" and "Second half", columns 3 and 5 get no header, and "Q1, column header" is itself followed by "First half". Dropping the The row and column numbers switch has no effect The switch is read with Other settings
Defaults With the defaults (headers after, numbers on), every table and grid sounds different from today for everyone. Row header names, such as "India", are only spoken when numbers are off, so by default they're replaced by "Row N". Column numbers and headers are spoken on every cell, not only when the column changes. CodeComposition changes state
Text loses its spans
A cell from another table
Header text
What counts as a table
So this changes navigation and braille output as well as speech. Smaller things
The options themselves are useful: headers before, after or off, and a numbers switch. I'd suggest building them on top of the existing |
Summary
Adds configurable table header reading (announcing column headers before or after cell data, or off) and optional row/column coordinate announcements under Backtalk Settings > Verbosity. When navigating tables (including web tables in Chrome/WebViews and native grids), cell data is contextualized with its corresponding column header separated by a natural speech pause, making tabular data (such as scorecards, timetables, and financial reports) much easier to follow.
Technical Implementation & Architecture
Verbosity Preferences (
verbosity_preferences.xml,TalkBackService.java):table_column_headerslist preference under Verbosity with options:after(default),before, andoff.table_speak_row_column_numbersswitch to toggle coordinate announcements (Row X, Column Y).TalkBackService.reloadPreferences()and propagated them toGlobalVariables. Added preferences and strings to both phone and wear XML resources.Table Role Detection & Classification (
AccessibilityNodeInfoUtils.java,CollectionState.java):isTableRootandisTableCellUnderTablepublic inAccessibilityNodeInfoUtils.isTableRootto accept containers withRole.ROLE_GRIDas well as anyCollectionInfohaving row/column counts > 1 (including dynamic tables where row/column count is-1), ensuring web tables inside WebViews/Chrome are consistently detected as tables.CollectionState.getCollectionRole()and transitions (NAVIGATE_ENTER,NAVIGATE_INTERIOR) to routeisTableRootcontainers into the table state machine.CollectionState.getTableItemState()with fallback togetTableCellUnderTable()when focus lands on inner text elements within a cell.getTableHeadingTypeso row 0 in multi-row tables is recognized as column headers (TYPE_COLUMN), even when the host application or browser does not explicitly setisHeading.Header Resolution & Cache (
CollectionState.java,CollectionStateFeedbackUtils.java):getColumnHeaders()andgetRowHeaders()onCollectionState.findCellAt(tableRoot, targetRow, targetCol)inCollectionStateFeedbackUtilsto query the accessibility tree for the corresponding cell at(0, columnIndex)if the cached header is not yet populated, dynamically caching column titles.Speech Output Composition & Pauses (
CollectionStateFeedbackUtils.java):getTableItemCellFeedback()to format speech according to verbosity preferences:[coordinates] [cell data]. [column header](e.g.Column 2, 162. Runs scored.).[coordinates] [column header]. [cell data](e.g.Runs scored, Column 2. 162.).[coordinates] [cell data]or cell data alone..) is enforced between cell text and headers to ensure the TTS engine inserts a natural speech pause rather than running them together.Column headingwhen roles are enabled).Row Boundary & Focus Tracking (
GlobalVariables.java, Feedback Rules):GlobalVariablesto detect row changes (isRowTransition), speaking the row coordinate when moving between rows and omitting redundant row coordinates when swiping across columns in the same row.EventTypeViewAccessibilityFocusedFeedbackRuleandEventTypeViewAccessibilityFocusedFeedbackRuleForTVto checkglobalVariables.isFocusedNodeInTable(node), routing table cell feedback throughgetTableItemCellFeedbackand suppressing redundant generic collection transitions.