Skip to content

Commit

Permalink
fix(android): improve validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Jul 1, 2019
1 parent b30e0f4 commit 800ae22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion android/modules/ui/res/layout/titanium_ui_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:layout_gravity="right"
android:contentDescription="One of the following images: checkmark, child, or disclosure"
android:focusable="false"
android:focusableInTouchMode="false"
android:maxHeight="17dp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ public void onCancel(DialogInterface dlg)
// can also be used.
ListView listView = dialog.getListView();
if (listView != null) {
listView.setContentDescription(getProxy().composeContentDescription());
int importance = ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO;
if (proxy != null) {
listView.setContentDescription(proxy.composeContentDescription());
Object propertyValue = proxy.getProperty(TiC.PROPERTY_ACCESSIBILITY_HIDDEN);
if (propertyValue != null && TiConvert.toBoolean(propertyValue)) {
importance = ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.HashMap;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.Log;
import org.appcelerator.titanium.TiC;
Expand Down Expand Up @@ -665,8 +666,10 @@ public void populateViews(KrollDict data, TiBaseListViewItem cellContent, TiList
DataItem dataItem = template.getDataItem(binding);
ViewItem viewItem = views.get(binding);
TiUIView view = viewItem.getView();
KrollProxy viewProxy = null;
//update extra event data for views
if (view != null) {
viewProxy = view.getProxy();
appendExtraEventData(view, itemIndex, sectionIndex, binding, itemId);
}
//if binding is contain in data given to us, process that data, otherwise
Expand All @@ -675,17 +678,17 @@ 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 (view.getProxy() != null) {
view.getProxy().getProperties().putAll(diffProperties);
if (viewProxy != null && viewProxy.getProperties() != null) {
viewProxy.getProperties().putAll(diffProperties);
}
view.processProperties(diffProperties);
}

} else if (dataItem != null && view != null) {
KrollDict diffProperties = viewItem.generateDiffProperties(dataItem.getDefaultProperties());
if (!diffProperties.isEmpty()) {
if (view.getProxy() != null) {
view.getProxy().getProperties().putAll(diffProperties);
if (viewProxy != null && viewProxy.getProperties() != null) {
viewProxy.getProperties().putAll(diffProperties);
}
view.processProperties(diffProperties);
}
Expand Down

0 comments on commit 800ae22

Please sign in to comment.