Skip to content

Commit

Permalink
Merge branch 'master' into accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Feb 10, 2021
2 parents 1fbbf94 + 2069693 commit 42f1403
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def testOnAndroidDevices = false // testOnDevices // FIXME: Our android device i
def testOnIOSDevices = testOnDevices

// Variables we can change
def nodeVersion = '10.17.0' // NOTE that changing this requires we set up the desired version on jenkins master first!
def nodeVersion = '12.18.0' // NOTE that changing this requires we set up the desired version on jenkins master first!
def npmVersion = 'latest' // We can change this without any changes to Jenkins. 5.7.1 is minimum to use 'npm ci'

// Variables which we assign and share between nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ListItemProxy extends TiViewProxy

private final HashMap<String, TiViewProxy> binds = new HashMap<>();
private final HashMap<String, Object> childProperties = new HashMap<>();
private final List<String> ignoredTemplateKeys = new ArrayList<>();
private final List<String> ignoredTemplateKeys = new ArrayList<>();

public int index;

Expand Down Expand Up @@ -125,7 +125,7 @@ public TiUIView createView(Activity activity)
* @param data Data payload of fired event.
* @return Object of event payload.
*/
public Object handleEvent(String eventName, Object data)
public Object handleEvent(String eventName, Object data, boolean fireItemClick)
{
// Inject row data into events.
final ListViewProxy listViewProxy = getListViewProxy();
Expand Down Expand Up @@ -174,7 +174,7 @@ public Object handleEvent(String eventName, Object data)
data = payload;

// Fire `itemclick` event on ListView.
if (eventName.equals(TiC.EVENT_CLICK)) {
if (fireItemClick && eventName.equals(TiC.EVENT_CLICK)) {
listViewProxy.fireSyncEvent(TiC.EVENT_ITEM_CLICK, data);
}
}
Expand All @@ -193,13 +193,13 @@ public Object handleEvent(String eventName, Object data)
@Override
public boolean fireEvent(String eventName, Object data, boolean bubbles)
{
data = handleEvent(eventName, data);
data = handleEvent(eventName, data, true);
return super.fireEvent(eventName, data, bubbles);
}
@Override
public boolean fireSyncEvent(String eventName, Object data, boolean bubbles)
{
data = handleEvent(eventName, data);
data = handleEvent(eventName, data, true);
return super.fireSyncEvent(eventName, data, bubbles);
}

Expand Down Expand Up @@ -274,42 +274,8 @@ protected TiViewProxy generateViewFromTemplate(TiViewProxy parent, KrollDict tem
@Override
public void call(Object data)
{
if (data instanceof KrollDict) {
final KrollDict payload = new KrollDict((KrollDict) data);

// Inject row data into events.
final ListViewProxy listViewProxy = getListViewProxy();
if (listViewProxy != null) {

final Object parent = getParent();
if (parent instanceof ListSectionProxy) {
final ListSectionProxy section = (ListSectionProxy) parent;

// Include section specific properties.
payload.put(TiC.PROPERTY_SECTION, section);
payload.put(TiC.PROPERTY_SECTION_INDEX, listViewProxy.getIndexOfSection(section));
payload.put(TiC.PROPERTY_ITEM_INDEX, getIndexInSection());
}

final String itemId = getProperties().optString(TiC.PROPERTY_ITEM_ID, null);
if (itemId != null) {

// Include `itemId` if specified.
payload.put(TiC.PROPERTY_ITEM_ID, itemId);
}

if (template.containsKey(TiC.PROPERTY_BIND_ID)) {

// Include `bindId` of template if specified.
payload.put(TiC.PROPERTY_BIND_ID, template.getString(TiC.PROPERTY_BIND_ID));
}
}

data = payload;
}

// Call callback defined in template.
callback.call(krollObject, new Object[] { data });
callback.call(krollObject, new Object[] { handleEvent(eventName, data, false) });
}
});
krollObject.setHasListenersForEventType(eventName, true);
Expand Down
7 changes: 5 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations
If we are in a navigation controller, let us match so it doesn't get freaked
out in when pushing/popping. We are going to force orientation anyways.
*/
if ([self navigationController] != nil) {
return [[self navigationController] supportedInterfaceOrientations];
/*
TIMOB-28282. Shouldn't UINavigationController.topViewController decide the supported orientation?
*/
if ([self navigationController] != nil && [[self navigationController] topViewController] != self) {
return [[[self navigationController] topViewController] supportedInterfaceOrientations];
}
//This would be for modal.
return (UIInterfaceOrientationMask)_supportedOrientations;
Expand Down
7 changes: 4 additions & 3 deletions iphone/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ exports.init = function (logger, config, cli) {
return finished();
}

const i18n = require('node-appc').i18n(__dirname);
const __ = i18n.__;
const __n = i18n.__n;

if (cli.argv['build-only']) {
logger.info(__('Performed build only, skipping running of the application'));
return finished();
}

const ioslib = require('ioslib');
const i18n = require('node-appc').i18n(__dirname);
const __ = i18n.__;
const __n = i18n.__n;
const path = require('path');
const fs = require('fs-extra');
// eslint-disable-next-line security/detect-child-process
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@
"url": "git://github.com/appcelerator/titanium_mobile.git"
},
"vendorDependencies": {
"node": "10.x || 12.x"
"node": "12.x || 14.x"
},
"engines": {
"node": ">=10.13"
"node": ">=12.13.0"
},
"nyc": {
"exclude": [
Expand Down

0 comments on commit 42f1403

Please sign in to comment.