Skip to content

Commit

Permalink
Merge branch 'master' into applicationLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullahFaqeir authored Sep 16, 2024
2 parents dd3a407 + d084485 commit 596c031
Show file tree
Hide file tree
Showing 13 changed files with 206 additions and 16 deletions.
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,93 @@
# [12.5.0](https://github.com/tidev/titanium_mobile/compare/12_4_X...12.5.0) (2024-09-16)

## About this release

Titanium SDK 12.5.0 is a minor release of the SDK, adding new features and platform updates. It also adds stable support for
iOS 18 and Xcode 16, the latest software in the Apple ecosystem.

## Community Credits

* Michael Gangolf
* forward --sdk in module build process ([07f435d](https://github.com/tidev/titanium_mobile/commit/07f435d836f644ec469f9f7485682b74d25e0699))
* more log output ([694766b](https://github.com/tidev/titanium_mobile/commit/694766b63323e3fee70e64abee07841b267fdce7))
* statusBarColor for Window ([91499ef](https://github.com/tidev/titanium_mobile/commit/91499efadc6cc1c9a8fd2c82cdddf4ddd340f213))
* flatten ListView layout ([b9fd683](https://github.com/tidev/titanium_mobile/commit/b9fd68326f1dca7f7dc4eeb20e9fffa881dbce6d))
* add maxImages and pathOnly to openPhotoGallery ([3eda594](https://github.com/tidev/titanium_mobile/commit/3eda594e2721651a412a9557f6a05830c19efb29))
* fire `selected` event again when clicking the same Tab again ([dfb1b5c](https://github.com/tidev/titanium_mobile/commit/dfb1b5c312cbfac159fbae4d7277330dad71d6e0))
* enable Signature Scheme v3 ([c719bcd](https://github.com/tidev/titanium_mobile/commit/c719bcd5cd061cccaefe888b8edaf7f25143f412))
* update cmake, checkstyle ([8846f07](https://github.com/tidev/titanium_mobile/commit/8846f07955e0157ff134c122bd544f66c2fdb501))
* fix tintColor and activeTintColor in a TabbedBar ([2e92f1d](https://github.com/tidev/titanium_mobile/commit/2e92f1ddd00b9610ff9a6fc14775545b7cdf089e))
* set targetSDK to Android 34 ([5fc81f0](https://github.com/tidev/titanium_mobile/commit/5fc81f08bdb3f9ba64d9cb4972848c8523f2d190))
* fix Actionbar backgroundImage doc and improve setter ([803bd04](https://github.com/tidev/titanium_mobile/commit/803bd04350df89f2197842d110ad3c0384a97c7f))
* keep Tab tintColor when changing icons ([51be366](https://github.com/tidev/titanium_mobile/commit/51be36662445ad4755438a7f1b511a837196df69))
* fix titleAttribute when it's not a creation parameter ([017c052](https://github.com/tidev/titanium_mobile/commit/017c0524dc1a76527a8ba342964ea881633492d5))

* Hans Knöchel
* add “interactiveDismissModeEnabled” API ([1d2cdd5](https://github.com/tidev/titanium_mobile/commit/1d2cdd5ff802fcc628ab67cd1a882117b1e74c00))
* textfield padding ([d75fc9e](https://github.com/tidev/titanium_mobile/commit/d75fc9efb225aa798101388d6ba50d9751a2847a))
* Revert "fix(ios): fix unbalanced view controller transitions causing issues on iOS 16+ (#13586)" ([b9932b2](https://github.com/tidev/titanium_mobile/commit/b9932b2f3929a19523a29a453710afecb84ea7f7))
* bump master to 12.5.0 ([52cab42](https://github.com/tidev/titanium_mobile/commit/52cab4293d6c9a0472428f4ed0d0fb7566ebb530))
* add 12.5.0 changelog ([e5e3f33](https://github.com/tidev/titanium_mobile/commit/e5e3f33323e65593f69eda2fc56f750e7611ec7a))

* Abdullah Al-Faqeir
* pause returns false ([e577bce](https://github.com/tidev/titanium_mobile/commit/e577bce9b640974ce92a9ad209846fa2f5b7915b))

## Bug Fixes

### Android platform

* fix Actionbar backgroundImage doc and improve setter ([803bd04](https://github.com/tidev/titanium_mobile/commit/803bd04350df89f2197842d110ad3c0384a97c7f))
* fix tintColor and activeTintColor in a TabbedBar ([2e92f1d](https://github.com/tidev/titanium_mobile/commit/2e92f1ddd00b9610ff9a6fc14775545b7cdf089e))
* fix titleAttribute when it's not a creation parameter ([017c052](https://github.com/tidev/titanium_mobile/commit/017c0524dc1a76527a8ba342964ea881633492d5))
* keep Tab tintColor when changing icons ([51be366](https://github.com/tidev/titanium_mobile/commit/51be36662445ad4755438a7f1b511a837196df69))
* textfield padding ([d75fc9e](https://github.com/tidev/titanium_mobile/commit/d75fc9efb225aa798101388d6ba50d9751a2847a))

### iOS platform

* pause returns false ([e577bce](https://github.com/tidev/titanium_mobile/commit/e577bce9b640974ce92a9ad209846fa2f5b7915b))

### Multiple platforms

* sdk build on windows needs shell: true to run batch files ([f3e5a0b](https://github.com/tidev/titanium_mobile/commit/f3e5a0bd90eb75dfa7ec0c5e6a4b4cc39ac4b95a))

## Features

### Multiple platforms

* add 12.4.0.GA changelog ([9388600](https://github.com/tidev/titanium_mobile/commit/9388600a951db750e188eaca6c14b6e1683ffd7c))
* add 12.5.0 changelog ([e5e3f33](https://github.com/tidev/titanium_mobile/commit/e5e3f33323e65593f69eda2fc56f750e7611ec7a))

### Android platform

* add maxImages and pathOnly to openPhotoGallery ([3eda594](https://github.com/tidev/titanium_mobile/commit/3eda594e2721651a412a9557f6a05830c19efb29))
* enable Signature Scheme v3 ([c719bcd](https://github.com/tidev/titanium_mobile/commit/c719bcd5cd061cccaefe888b8edaf7f25143f412))
* fire `selected` event again when clicking the same Tab again ([dfb1b5c](https://github.com/tidev/titanium_mobile/commit/dfb1b5c312cbfac159fbae4d7277330dad71d6e0))
* flatten ListView layout ([b9fd683](https://github.com/tidev/titanium_mobile/commit/b9fd68326f1dca7f7dc4eeb20e9fffa881dbce6d))
* more log output ([694766b](https://github.com/tidev/titanium_mobile/commit/694766b63323e3fee70e64abee07841b267fdce7))
* set targetSDK to Android 34 ([5fc81f0](https://github.com/tidev/titanium_mobile/commit/5fc81f08bdb3f9ba64d9cb4972848c8523f2d190))
* statusBarColor for Window ([91499ef](https://github.com/tidev/titanium_mobile/commit/91499efadc6cc1c9a8fd2c82cdddf4ddd340f213))

### iOS platform

* add “interactiveDismissModeEnabled” API ([1d2cdd5](https://github.com/tidev/titanium_mobile/commit/1d2cdd5ff802fcc628ab67cd1a882117b1e74c00))

## BREAKING CHANGES


## SDK Module Versions

| Module | Android version | iOS Version |
| ----------- | --------------- | ----------- |
| facebook | 12.1.0 | 14.0.0 |
| ti.map | 5.6.1 | 7.3.1 |
| ti.webdialog | 2.3.0 | 3.0.2 |
| ti.playservices | 18.3.0 | n/a |
| ti.identity | 3.1.0 | 5.0.0 |
| urlSession | n/a | 4.0.1 |
| ti.coremotion | n/a | 4.0.1 |
| ti.applesignin | n/a | 3.1.2 |
| hyperloop | 7.0.6 | 7.0.6 |

# [12.4.0](https://github.com/tidev/titanium_mobile/compare/12_3_X...12.4.0) (2024-07-17)

## About this release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ today and benefit from 1:1 sessions with the core team, exclusive modules, merch

Learn more about sponsoring TiDev, the organization behind the Titanium SDK, [here](https://github.com/sponsors/tidev) 🚀.

<!-- sponsors --><a href="https://github.com/Topener"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1898949?u&#x3D;2a4679d6ddcec38e0e8855796b6df883b05ca295&amp;v&#x3D;4" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5816606?u&#x3D;129b37486ffa01feb669bf7ad8adc3c81a305f0b&amp;v&#x3D;4" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/de1mat"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;901045?u&#x3D;7c5bd52413a071a9d5f6c9f8c0dab6c299e62f15&amp;v&#x3D;4" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8171849?u&#x3D;990e64ef4c1909a0b0e8924c4e6c5b3f730b260b&amp;v&#x3D;4" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;6359232?u&#x3D;7a635b5d99fde2573103a7d94464ac3166fadad8&amp;v&#x3D;4" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2934870?u&#x3D;0258c5d071fe0d398155ab92b5bb45c5d44fb9ef&amp;v&#x3D;4" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;104650443?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2573811?u&#x3D;90b858430c052de19099b336344bfd6f44eb9e8a&amp;v&#x3D;4" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;81745?v&#x3D;4" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;94473234?u&#x3D;c0cfd7677bb6864e3814261f035307c834d074c1&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8946160?u&#x3D;90bd7d922f63690651f0a077ec9e862c0778e872&amp;v&#x3D;4" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;77621597?v&#x3D;4" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5295258?u&#x3D;741e21b15806caa959e3a5fe6a580303794e047b&amp;v&#x3D;4" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;874832?u&#x3D;51f1e316e60d21f9d8dce3ccf69056a6209b1a71&amp;v&#x3D;4" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1700582?u&#x3D;3ff22598878dc903595a6b6b541de33ad45bd918&amp;v&#x3D;4" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;7572148?u&#x3D;ff1828727f6afc13559f79dcb7bf505629e17e1f&amp;v&#x3D;4" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;11294684?v&#x3D;4" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;71382335?u&#x3D;d488db216612dbff622368a3ab7016bb083badee&amp;v&#x3D;4" width="60px" alt="Fruugul" /></a><a href="https://github.com/korelogic"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;306669?v&#x3D;4" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8219203?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/gouldjw"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1489502?u&#x3D;81e9e9df9a35acf9b602126480cc5e70ead1f7a7&amp;v&#x3D;4" width="60px" alt="John Gould" /></a><a href="https://github.com/Yackens"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;58727874?v&#x3D;4" width="60px" alt="Joaquin Maroto" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Topener"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1898949?u&#x3D;2a4679d6ddcec38e0e8855796b6df883b05ca295&amp;v&#x3D;4" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5816606?u&#x3D;129b37486ffa01feb669bf7ad8adc3c81a305f0b&amp;v&#x3D;4" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/de1mat"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;901045?u&#x3D;7c5bd52413a071a9d5f6c9f8c0dab6c299e62f15&amp;v&#x3D;4" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8171849?u&#x3D;990e64ef4c1909a0b0e8924c4e6c5b3f730b260b&amp;v&#x3D;4" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;6359232?u&#x3D;7a635b5d99fde2573103a7d94464ac3166fadad8&amp;v&#x3D;4" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2934870?u&#x3D;0258c5d071fe0d398155ab92b5bb45c5d44fb9ef&amp;v&#x3D;4" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;104650443?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;2573811?u&#x3D;90b858430c052de19099b336344bfd6f44eb9e8a&amp;v&#x3D;4" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;81745?v&#x3D;4" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;94473234?u&#x3D;c0cfd7677bb6864e3814261f035307c834d074c1&amp;v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8946160?u&#x3D;90bd7d922f63690651f0a077ec9e862c0778e872&amp;v&#x3D;4" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;77621597?v&#x3D;4" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;5295258?u&#x3D;741e21b15806caa959e3a5fe6a580303794e047b&amp;v&#x3D;4" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;874832?u&#x3D;51f1e316e60d21f9d8dce3ccf69056a6209b1a71&amp;v&#x3D;4" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1700582?u&#x3D;3ff22598878dc903595a6b6b541de33ad45bd918&amp;v&#x3D;4" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;7572148?u&#x3D;ff1828727f6afc13559f79dcb7bf505629e17e1f&amp;v&#x3D;4" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;11294684?v&#x3D;4" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;71382335?u&#x3D;d488db216612dbff622368a3ab7016bb083badee&amp;v&#x3D;4" width="60px" alt="Fruugul" /></a><a href="https://github.com/korelogic"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;306669?v&#x3D;4" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;8219203?v&#x3D;4" width="60px" alt="" /></a><a href="https://github.com/gouldjw"><img src="https:&#x2F;&#x2F;avatars.githubusercontent.com&#x2F;u&#x2F;1489502?u&#x3D;81e9e9df9a35acf9b602126480cc5e70ead1f7a7&amp;v&#x3D;4" width="60px" alt="John Gould" /></a><!-- sponsors -->

## Features

Expand Down
8 changes: 7 additions & 1 deletion android/runtime/v8/src/native/modules/APIModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ void APIModule::logInfo(const FunctionCallbackInfo<Value>& args)
Isolate* isolate = args.GetIsolate();
HandleScope scope(isolate);
v8::String::Utf8Value message(isolate, APIModule::combineLogMessages(args));
APIModule::logInternal(LOG_LEVEL_INFO, LCAT, *message);

std::string cppStr(*message);

int maxChunk = 4050;
for (size_t i = 0, len = cppStr.length(); i < len; i+=maxChunk) {
APIModule::logInternal(LOG_LEVEL_INFO, LCAT, cppStr.substr(i , maxChunk).c_str());
}
}

void APIModule::logWarn(const FunctionCallbackInfo<Value>& args)
Expand Down
2 changes: 1 addition & 1 deletion apidoc/Titanium/Android/NotificationChannel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ examples:
icon: Ti.Android.R.drawable.ic_dialog_info,
contentTitle: 'TITLE',
contentText : 'This is a test',
channelId: channel.getId()
channelId: channel.id
});
Ti.Android.NotificationManager.notify(100, notification);
Expand Down
10 changes: 10 additions & 0 deletions apidoc/Titanium/UI/NavigationWindow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ properties:
availability: creation
optional: false

- name: interactiveDismissModeEnabled
summary: |
A boolean indicating whether or not child windows of this navigation window
should have the ability to be swipe-to-closed over the full width of it's window or not.
type: Boolean
default: false
platforms: [iphone, ipad, macos]
since: "12.5.0"
availability: creation

methods:
- name: closeWindow
summary: Closes a window and removes it from the navigation window.
Expand Down
10 changes: 10 additions & 0 deletions apidoc/Titanium/UI/TabGroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,16 @@ properties:
platforms: [android, iphone, ipad, macos]
since: "12.1.0"

- name: interactiveDismissModeEnabled
summary: |
A boolean indicating whether or not child windows of this tab group
should have the ability to be swipe-to-closed over the full width of it's window or not.
type: Boolean
default: false
platforms: [iphone, ipad, macos]
since: "12.5.0"
availability: creation

examples:
- title: Alloy XML Markup
example: |
Expand Down
6 changes: 1 addition & 5 deletions iphone/Classes/TiMediaAudioPlayerProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,7 @@ - (void)handleTimeControlStatusNotification:(NSNotification *)note
if (_player.timeControlStatus == AVPlayerTimeControlStatusPlaying) {
_state = TiAudioPlayerStatePlaying;
} else if (_player.timeControlStatus == AVPlayerTimeControlStatusPaused) {
if (_player.currentItem.currentTime.value == 0.0 || oldState == TiAudioPlayerStateStopping) {
_state = TiAudioPlayerStateStopped;
} else {
_state = TiAudioPlayerStatePaused;
}
_state = TiAudioPlayerStatePaused;
} else if (_player.timeControlStatus == AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate) {
_state = TiAudioPlayerStateWaitingForQueueToStart;
}
Expand Down
2 changes: 2 additions & 0 deletions iphone/Classes/TiUINavigationWindowProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
TiWindowProxy *current;
BOOL transitionIsAnimating;
BOOL transitionWithGesture;

UIPanGestureRecognizer *fullWidthBackGestureRecognizer;
}

// Private API
Expand Down
38 changes: 38 additions & 0 deletions iphone/Classes/TiUINavigationWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ @implementation TiUINavigationWindowProxy

- (void)_destroy
{
if (fullWidthBackGestureRecognizer != nil) {
[fullWidthBackGestureRecognizer setDelegate:nil];
[navController.view removeGestureRecognizer:fullWidthBackGestureRecognizer];
}

RELEASE_TO_NIL(rootWindow);
RELEASE_TO_NIL(navController);
RELEASE_TO_NIL(current);
RELEASE_TO_NIL(fullWidthBackGestureRecognizer);

[super _destroy];
}

Expand Down Expand Up @@ -88,14 +95,45 @@ - (UINavigationController *)controller
[TiUtils configureController:navController withObject:self];
[navController.interactivePopGestureRecognizer addTarget:self action:@selector(popGestureStateHandler:)];
[[navController interactivePopGestureRecognizer] setDelegate:self];

BOOL interactiveDismissModeEnabled = [TiUtils boolValue:[self valueForKey:@"interactiveDismissModeEnabled"] def:NO];
if (interactiveDismissModeEnabled) {
[self configureFullWidthSwipeToClose];
}
}
return navController;
}

- (void)configureFullWidthSwipeToClose
{
fullWidthBackGestureRecognizer = [[UIPanGestureRecognizer alloc] init];

if (navController.interactivePopGestureRecognizer == nil) {
return;
}

id targets = [navController.interactivePopGestureRecognizer valueForKey:@"targets"];
if (targets == nil) {
return;
}

[fullWidthBackGestureRecognizer setValue:targets forKey:@"targets"];
[fullWidthBackGestureRecognizer setDelegate:self];
[navController.view addGestureRecognizer:fullWidthBackGestureRecognizer];
}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
BOOL isRootWindow = (current == rootWindow);

BOOL interactiveDismissModeEnabled = [TiUtils boolValue:[self valueForKey:@"interactiveDismissModeEnabled"] def:NO];
if (interactiveDismissModeEnabled && [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
BOOL isSystemSwipeToCloseEnabled = navController.interactivePopGestureRecognizer.isEnabled == YES;
BOOL areThereStackedViewControllers = navController.viewControllers.count > 1;

return isSystemSwipeToCloseEnabled || areThereStackedViewControllers;
}

if (current != nil && !isRootWindow) {
return [TiUtils boolValue:[current valueForKey:@"swipeToClose"] def:YES];
}
Expand Down
Loading

0 comments on commit 596c031

Please sign in to comment.