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

feat(ios): expose new APIs to customize paging control #11825

Merged
merged 19 commits into from Aug 27, 2020

Conversation

vijaysingh-axway
Copy link
Contributor

@build
Copy link
Contributor

build commented Jul 17, 2020

Fails
🚫 Tests have failed, see below for more information.
Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 2 tests have failed There are 2 tests failing and 711 skipped out of 8101 total tests.

Tests:

ClassnameNameTimeError
ios.ipad.Titanium.UI.iOS.CollisionBehavior.exampleworks (14.0)10.001
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/083EB293-6DD6-4119-A4D5-72351034E69F/data/Containers/Bundle/Application/DBB3577E-F193-49DF-BB23-BF09D51F9B67/mocha.app/ti-mocha.js:4326:27
ios.iphone.Titanium.UI.iOS.CollisionBehavior.exampleworks (14.0)10.002
Error: timeout of 10000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/0BA89FD6-590B-4E1C-A92C-C7071914B3F8/data/Containers/Bundle/Application/5907A292-FDE0-4016-98F5-E24A65934834/mocha.app/ti-mocha.js:4326:27

Generated by 🚫 dangerJS against 6bd643c

@build build requested a review from a team July 17, 2020 21:41
@build build added the docs label Jul 17, 2020
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.

Likely also need to edit the Jenkinsfile and peg to Xcode-12 node (at least temporarily to verify the test/feature)?

apidoc/Titanium/UI/ScrollableView.yml Show resolved Hide resolved
apidoc/Titanium/UI/ScrollableView.yml Show resolved Hide resolved
@@ -650,6 +650,31 @@ - (void)setPagingControlAlpha_:(id)args
}
}

#if IS_SDK_IOS_14
- (void)setPreferredIndicatorImage_:(id)args
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to do anything to expose the getter for the property?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getter will get its value from [proxy valueForKey:@"property_name"];
Ideally we calculate get it's value from native API and return it. It should be like -
- (TiBlob)preferredIndicatorImage { return ([[[TiBlob alloc] initWithImage:[[self pagecontrol] preferredIndicatorImage]] autorelease]); }

But problem is, we can pass Ti.Blob or String in setter, but in getter we can only get Ti.Blob. So it will be confusing. That's why no getter implementation

tests/Resources/ti.ui.scrollableview.addontest.js Outdated Show resolved Hide resolved
tests/Resources/ti.ui.scrollableview.addontest.js Outdated Show resolved Hide resolved
tests/Resources/ti.ui.scrollableview.addontest.js Outdated Show resolved Hide resolved
tests/Resources/ti.ui.scrollableview.addontest.js Outdated Show resolved Hide resolved
tests/Resources/ti.ui.scrollableview.addontest.js Outdated Show resolved Hide resolved
tests/Resources/ti.ui.scrollableview.addontest.js Outdated Show resolved Hide resolved

@implementation UIImage (Compare)

- (BOOL)compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer we didn't add this as API. It's a fine workaround because of the perf issue for comparing images in #11810 - but I'd prefer we consider including that fix for 9.2.0 and just use it rather than implement an undocumented one-off API for comparing two images natively. cc @mukherjee2

But who knows, maybe developers want this?

@@ -75,6 +75,10 @@ JSExportAs(imageWithRoundedCorner,
: (NSNumber *)optionalBorderSize);
- (TiBlob *)imageWithTransparentBorder:(NSUInteger)size;
- (NSString *)toString; // FIXME This doesn't seem to override the JS impl. I think we need to find a way to modify the property post-init to override it!
JSExportAs(compare,

This comment was marked as resolved.

@@ -339,6 +339,15 @@ - (void)append:(TiBlob *)blob
RELEASE_TO_NIL(newData);
}

- (BOOL)compare:(TiBlob *)blob withTolerence:(CGFloat)tolerence
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in our test suite now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okey. I'll remove the native implementation.

@ssjsamir ssjsamir self-requested a review August 20, 2020 13:46
Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vijaysingh-axway When testing the following test case:

var win = Ti.UI.createWindow({
extendSafeArea: false,
});
 
var view1 = Ti.UI.createView({ backgroundColor:'#123' });
var view2 = Ti.UI.createView({ backgroundColor:'#246' });
var view3 = Ti.UI.createView({ backgroundColor:'#48b' });
 
var image = Ti.UI.iOS.systemImage('backward');
var scrollableView = Ti.UI.createScrollableView({
views:[view1,view2,view3],
showPagingControl:true,
preferredIndicatorImage: image
});
 
win.add(scrollableView);
win.open();
 
view1.addEventListener('click', function(e){
image = Ti.UI.iOS.systemImage('forward');
scrollableView.preferredIndicatorImage = image;
});
 
view2.addEventListener('click', function(e){
image = Ti.UI.iOS.systemImage('folder.fill');
scrollableView.setIndicatorImageForPage(image, 1);
});
 
view3.addEventListener('click', function(e){
image = 'image0.png';
scrollableView.setIndicatorImageForPage(image, 2);
});

Firstly I don't see any forward or backwards images I just see the pages changing by colour when pressing the Bottom right of the bar:
Screenshot 2020-08-20 at 15 29 56
Screenshot 2020-08-20 at 15 30 03
Screenshot 2020-08-20 at 15 30 10

I then get the following error after I press on the left hand side of the bar a few times.

[ERROR] �� �Script Error {

[ERROR] �� � column = 40;

[ERROR] �� � line = 31;

[ERROR] �� � message = "invalid method '(null)'";

[ERROR] �� � nativeStack = "3 TitaniumKit0x0000000104d09c4c __KrollCallAsFunction_block_invoke + 36\n4 TitaniumKit0x0000000104d09a60 KrollCallAsFunction + 416\n5 JavaScriptCore 0x00000001b0b6d338 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2564920\n6 JavaScriptCore 0x00000001b120c784 51A437CB-263D-37FD-A723-2B0895FA6B21 + 9508740\n7 JavaScriptCore 0x00000001b0b10b98 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2186136\n8 JavaScriptCore 0x00000001b0aec5f4 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2037236\n9 JavaScriptCore 0x00000001b1118628 51A437CB-263D-37FD-A723-2B0895FA6B21 + 8508968\n10 JavaScriptCore 0x00000001b133e2d8 _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueERKNS_8CallDataES3_RKNS_7ArgListE + 164\n11 JavaScriptCore 0x00000001b0b7ab5c JSObjectCallAsFunction + 656\n12 TitaniumKit0x0000000104ce7e8c TiBindingEventProcess + 672\n13 TitaniumKit0x0000000104d07ce4 -[KrollContext invoke:] + 116\n14 TitaniumKit0x0000000104d07d54 -[KrollContext enqueue:] + 92\n15 TitaniumKit0x0000000104d0f168 TiBindingRunLoopEnqueue + 84\n16 TitaniumKit0x0000000104d0db10 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 168\n17 TitaniumKit0x0000000104cef4dc -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 240\n18 TitaniumKit0x0000000104ce0eac -[TiUIView touchesEnded:withEvent:] + 116\n19 UIKitCore 0x00000001a3df321c EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12313116\n20 UIKitCore 0x00000001a3df4b84 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12319620\n21 UIKitCore 0x00000001a3dce690 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12162704\n22 UIKitCore 0x00000001a3e55690 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12715664";

[ERROR] �� � sourceURL = "file:///private/var/containers/Bundle/Application/D8F43C38-3BC5-4A43-98B2-6FEAEE6DA369/anewappp.app/app.js";

[ERROR] �� � stack = "[native code]\nfile:///private/var/containers/Bundle/Application/D8F43C38-3BC5-4A43-98B2-6FEAEE6DA369/anewappp.app/app.js:31:40";

[ERROR] �� � type = Error;

[ERROR] �� �}

Test EnvironmentMacOS Big Sur: 11.0 Beta 4

Xcode: 12.0 Beta 5
Java Version: 1.8.0_242
Android NDK: 21.3.6528147
Node.js: 12.18.1
""NPM":"5.0.0","CLI":"8.1.0-master.11""
iphone 8 Sim (14.0 Beta)

@vijaysingh-axway
Copy link
Contributor Author

@ssjsamir The color of system image is white. So it is invisible.

  1. Add backgroundColor: 'black' in createWindow. It should be visible. (Updated test case in ticket). Sorry for inconvenience.
  2. I am not getting any error log on clicking in bottom left/right of screen.

@ssjsamir
Copy link
Contributor

@vijaysingh-axway When i click left of the bar here multiple times (moving the page back):

Screenshot 2020-08-21 at 16 04 42

I am still able to reproduce this following error:

[ERROR] �� �Script Error {

[ERROR] �� � column = 40;

[ERROR] �� � line = 28;

[ERROR] �� � message = "invalid method '(null)'";

[ERROR] �� � nativeStack = "3 TitaniumKit0x0000000105189c84 __KrollCallAsFunction_block_invoke + 36\n4 TitaniumKit0x0000000105189a98 KrollCallAsFunction + 416\n5 JavaScriptCore 0x00000001b0b6d338 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2564920\n6 JavaScriptCore 0x00000001b120c784 51A437CB-263D-37FD-A723-2B0895FA6B21 + 9508740\n7 JavaScriptCore 0x00000001b0b10b98 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2186136\n8 JavaScriptCore 0x00000001b0aec5f4 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2037236\n9 JavaScriptCore 0x00000001b1118628 51A437CB-263D-37FD-A723-2B0895FA6B21 + 8508968\n10 JavaScriptCore 0x00000001b133e2d8 _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueERKNS_8CallDataES3_RKNS_7ArgListE + 164\n11 JavaScriptCore 0x00000001b0b7ab5c JSObjectCallAsFunction + 656\n12 TitaniumKit0x0000000105167f28 TiBindingEventProcess + 672\n13 TitaniumKit0x0000000105187d1c -[KrollContext invoke:] + 116\n14 TitaniumKit0x0000000105187d8c -[KrollContext enqueue:] + 92\n15 TitaniumKit0x000000010518f1a0 TiBindingRunLoopEnqueue + 84\n16 TitaniumKit0x000000010518db48 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 168\n17 TitaniumKit0x000000010516f578 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 240\n18 TitaniumKit0x0000000105160f48 -[TiUIView touchesEnded:withEvent:] + 116\n19 UIKitCore 0x00000001a3df321c EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12313116\n20 UIKitCore 0x00000001a3df4b84 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12319620\n21 UIKitCore 0x00000001a3dce690 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12162704\n22 UIKitCore 0x00000001a3e55690 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12715664";

[ERROR] �� � sourceURL = "file:///private/var/containers/Bundle/Application/927E203D-AA52-479C-901B-CB056CD0D42B/anewappp.app/app.js";

[ERROR] �� � stack = "[native code]\nfile:///private/var/containers/Bundle/Application/927E203D-AA52-479C-901B-CB056CD0D42B/anewappp.app/app.js:28:40";

[ERROR] �� � type = Error;

[ERROR] �� �}

@vijaysingh-axway
Copy link
Contributor Author

@vijaysingh-axway When i click left of the bar here multiple times (moving the page back):

Screenshot 2020-08-21 at 16 04 42

I am still able to reproduce this following error:

[ERROR] �� �Script Error {

[ERROR] �� � column = 40;

[ERROR] �� � line = 28;

[ERROR] �� � message = "invalid method '(null)'";

[ERROR] �� � nativeStack = "3 TitaniumKit0x0000000105189c84 __KrollCallAsFunction_block_invoke + 36\n4 TitaniumKit0x0000000105189a98 KrollCallAsFunction + 416\n5 JavaScriptCore 0x00000001b0b6d338 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2564920\n6 JavaScriptCore 0x00000001b120c784 51A437CB-263D-37FD-A723-2B0895FA6B21 + 9508740\n7 JavaScriptCore 0x00000001b0b10b98 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2186136\n8 JavaScriptCore 0x00000001b0aec5f4 51A437CB-263D-37FD-A723-2B0895FA6B21 + 2037236\n9 JavaScriptCore 0x00000001b1118628 51A437CB-263D-37FD-A723-2B0895FA6B21 + 8508968\n10 JavaScriptCore 0x00000001b133e2d8 _ZN3JSC12profiledCallEPNS_14JSGlobalObjectENS_15ProfilingReasonENS_7JSValueERKNS_8CallDataES3_RKNS_7ArgListE + 164\n11 JavaScriptCore 0x00000001b0b7ab5c JSObjectCallAsFunction + 656\n12 TitaniumKit0x0000000105167f28 TiBindingEventProcess + 672\n13 TitaniumKit0x0000000105187d1c -[KrollContext invoke:] + 116\n14 TitaniumKit0x0000000105187d8c -[KrollContext enqueue:] + 92\n15 TitaniumKit0x000000010518f1a0 TiBindingRunLoopEnqueue + 84\n16 TitaniumKit0x000000010518db48 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 168\n17 TitaniumKit0x000000010516f578 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 240\n18 TitaniumKit0x0000000105160f48 -[TiUIView touchesEnded:withEvent:] + 116\n19 UIKitCore 0x00000001a3df321c EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12313116\n20 UIKitCore 0x00000001a3df4b84 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12319620\n21 UIKitCore 0x00000001a3dce690 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12162704\n22 UIKitCore 0x00000001a3e55690 EFF94CE9-EE86-34C6-A228-4F9B8DE18016 + 12715664";

[ERROR] �� � sourceURL = "file:///private/var/containers/Bundle/Application/927E203D-AA52-479C-901B-CB056CD0D42B/anewappp.app/app.js";

[ERROR] �� � stack = "[native code]\nfile:///private/var/containers/Bundle/Application/927E203D-AA52-479C-901B-CB056CD0D42B/anewappp.app/app.js:28:40";

[ERROR] �� � type = Error;

[ERROR] �� �}

@ssjsamir It seems you are not using right sdk.

@ssjsamir
Copy link
Contributor

@vijaysingh-axway Alright it looks like when I was building to device it was using Xcode 11.5 command line tools but when I switched to Xcode 12 command line tools everything worked as intended and no crashes were seen.

@ssjsamir ssjsamir self-requested a review August 26, 2020 13:42
Copy link
Contributor

@ssjsamir ssjsamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR Passed

@sgtcoolguy sgtcoolguy merged commit 6acad54 into tidev:master Aug 27, 2020
@build
Copy link
Contributor

build commented Aug 27, 2020

The backport to 9_3_X failed:

The process 'git' failed with exit code 128

Check the run for full details
To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Check out the target branch
git checkout 9_3_X
# Make sure it's up to date
git pull
# Check out your branch
git checkout -b backport-11825-to-9_3_X
# Apply the commits from the PR
curl -s https://github.com/appcelerator/titanium_mobile/commit/7b97de03f102b395ebf943731b497a8044102b3c.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/dca0bffb296d38b4fe4e9e8925b3f3e431b6d145.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/b60927b2b26e244f407327c29b9554028b9f4978.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/77572fc301ce26a4f3b896f480955f959072d3b0.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/ae25f540f4f6cec66dc2c6eca30bbe60ffd5c3e0.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/01a22b7e18308f99d32d33109ea50595a1b64d5d.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/dd67dc362116ca7a92daf16f51f2c06a6f8babc1.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/5768fd66f7085f88b37f773fe5699dc54d94f0fe.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/aee830fe6b4e62f2d4e5554d76bacba2b21ebf17.patch | git am -3 --ignore-whitespace
curl -s https://github.com/appcelerator/titanium_mobile/commit/c2564b5c540e456d8cf007fadbc1b430d901d0c5.patch | git am -3 --ignore-whitespace
# Push it to GitHub
git push --set-upstream origin backport-11825-to-9_3_X

Then, create a pull request where the base branch is 9_3_X and the compare/head branch is backport-11825-to-9_3_X.

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

5 participants