Skip to content
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

Merged
merged 4 commits into from Jul 8, 2019

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews added this to the 8.1.0 milestone Jun 18, 2019
@garymathews garymathews requested a review from ypbnv June 18, 2019 23:32
@build build requested a review from a team June 19, 2019 00:03
@build
Copy link
Contributor

build commented Jun 19, 2019

Messages
📖 👍 Hey!, You deleted more code than you added. That's awesome!
📖

💾 Here's the generated SDK zipfile.

📖

✅ All tests are passing
Nice one! All 3619 tests are passing.
(There are 464 tests skipped)

Generated by 🚫 dangerJS against dd15493

Copy link
Contributor

@sgtcoolguy sgtcoolguy left a 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());
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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*$";
Copy link
Contributor

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)) {
Copy link
Contributor

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));

@lokeshchdhry
Copy link
Contributor

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
SDK Ver: 8.1.0 local build
OS Ver: 10.14.5
Xcode Ver: Xcode 10.2.1
Appc NPM: 4.2.14-3
Appc CLI: 7.1.0-master.24
Daemon Ver: 1.1.3
Ti CLI Ver: 5.2.1
Alloy Ver: 1.14.0
Node Ver: 8.15.1
NPM Ver: 6.4.1
Java Ver: 10.0.2
Devices: ⇨ google Pixel (Android 9)

@lokeshchdhry lokeshchdhry merged commit 1f3e5b4 into tidev:8_1_X Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants