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
fix(android)(8_1_X): set ListItem properties into proxy properties #10979
Conversation
|
88f59d4
to
800ae22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but could use some very minor refactors/cleanup.
@@ -285,7 +285,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP | |||
} | |||
ViewCompat.setImportantForAccessibility(listView, importance); | |||
} else { | |||
listView.setContentDescription(composeContentDescription()); | |||
listView.setContentDescription(getProxy().composeContentDescription()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can getProxy() return null?
@@ -675,12 +678,18 @@ public void populateViews(KrollDict data, TiBaseListViewItem cellContent, TiList | |||
KrollDict properties = new KrollDict((HashMap) data.get(binding)); | |||
KrollDict diffProperties = viewItem.generateDiffProperties(properties); | |||
if (!diffProperties.isEmpty()) { | |||
if (viewProxy != null && viewProxy.getProperties() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract temp var to assign viewProxy.getProperties() value to?
view.processProperties(diffProperties); | ||
} | ||
|
||
} else if (dataItem != null && view != null) { | ||
KrollDict diffProperties = viewItem.generateDiffProperties(dataItem.getDefaultProperties()); | ||
if (!diffProperties.isEmpty()) { | ||
if (viewProxy != null && viewProxy.getProperties() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
return null; | ||
} | ||
|
||
final String punctuationPattern = "^.*\\p{Punct}\\s*$"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract to a constant so it's compiled once?
String hint = TiConvert.toString(properties.get(TiC.PROPERTY_ACCESSIBILITY_HINT)); | ||
String value = TiConvert.toString(properties.get(TiC.PROPERTY_ACCESSIBILITY_VALUE)); | ||
|
||
if (!TextUtils.isEmpty(label)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three small blocks are identical, extract to a method? Only wrinkle is the extra space prefix/suffix added if previous value was not empty...
buffer.append(composeContentSegment(TiC.PROPERTY_ACCESSIBILITY_LABEL));
buffer.append(composeContentSegment(TiC.PROPERTY_ACCESSIBILITY_HINT));
buffer.append(composeContentSegment(TiC.PROPERTY_ACCESSIBILITY_VALUE));
FR Passed. Accessibility label in the ListItem components. Enabling text to speech speaks out the accessibility label & value as expected. Studio Ver: 5.1.3.201906102126 |
JIRA Ticket