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
Conversation
Tests:
|
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.
Likely also need to edit the Jenkinsfile
and peg to Xcode-12 node (at least temporarily to verify the test/feature)?
@@ -650,6 +650,31 @@ - (void)setPagingControlAlpha_:(id)args | |||
} | |||
} | |||
|
|||
#if IS_SDK_IOS_14 | |||
- (void)setPreferredIndicatorImage_:(id)args |
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.
Do you need to do anything to expose the getter for the property?
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.
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
|
||
@implementation UIImage (Compare) | ||
|
||
- (BOOL)compareWithImage:(UIImage *)image tolerance:(CGFloat)tolerance |
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.
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.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -339,6 +339,15 @@ - (void)append:(TiBlob *)blob | |||
RELEASE_TO_NIL(newData); | |||
} | |||
|
|||
- (BOOL)compare:(TiBlob *)blob withTolerence:(CGFloat)tolerence |
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.
It's in our test suite now
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.
Okey. I'll remove the native implementation.
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.
@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:
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)
@ssjsamir The color of system image is white. So it is invisible.
|
@vijaysingh-axway When i click left of the bar here multiple times (moving the page back): I am still able to reproduce this following error:
|
@ssjsamir It seems you are not using right sdk. |
@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. |
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.
FR Passed
The backport to
Check the run for full details # 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 |
https://jira.appcelerator.org/browse/TIMOB-28012