diff --git a/CHANGELOG.md b/CHANGELOG.md index 8acc98e268b..ca98a09d798 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,132 @@ +# [12.4.0](https://github.com/tidev/titanium_mobile/compare/12_3_X...12.4.0) (2024-07-17) + +## About this release + +Titanium SDK 12.4.0 is a minor release of the SDK, adding new features and platform updates. + +## Community Credits + +* Hans Knöchel + * add 12.4.0 changelog ([874e5f2](https://github.com/tidev/titanium_mobile/commit/874e5f2a86a1a58f99f4de50378c824e5b67029f)) + * add missing “Calendar.Event.remove” method ([d1bbe8a](https://github.com/tidev/titanium_mobile/commit/d1bbe8ac2d5fc8530858bcaa48b56d94b9c407e4)) + * add swipe actions support for Ti.UI.TableView ([40808cd](https://github.com/tidev/titanium_mobile/commit/40808cd5ffed82abaeb7e7523100f901f336298f)) + * add iOS 17+ symbol effects ([84ccadb](https://github.com/tidev/titanium_mobile/commit/84ccadbdcbe9b800ebc08dbac8ae5eaeac36a7f8)) + * update changelog ([9f144c1](https://github.com/tidev/titanium_mobile/commit/9f144c12c28fe6ead59237759c53c40509f3d4cc)) + * bump master to 12.4.0 ([2f1212f](https://github.com/tidev/titanium_mobile/commit/2f1212fd9e46a4a8aeae0af7a850aaa7bff34e52)) + * address all whitespace-related linting issues part 2 ([8c92dc7](https://github.com/tidev/titanium_mobile/commit/8c92dc7521219efebad8943a5305348014bd32e4)) + * address all whitespace-related linting issues ([e2bf653](https://github.com/tidev/titanium_mobile/commit/e2bf653d406b772deeafb504a0b9f68e363cf3e5)) + * fix linting issues ([bf24bf2](https://github.com/tidev/titanium_mobile/commit/bf24bf26ae07ebda2e2d70c23de198bac6b2ba8e)) + * Revert "feat(ios): support multi-scene applications (#13941)" ([82203d7](https://github.com/tidev/titanium_mobile/commit/82203d782fd499a33723bf86b41e1019e50bc99d)) + * fix some open issues related to scenes ([a0a3aea](https://github.com/tidev/titanium_mobile/commit/a0a3aeaf666b864fbcb75e57f011a142dbae715c)) + * fix debug issues with scenes ([8bcd5c3](https://github.com/tidev/titanium_mobile/commit/8bcd5c31a8dc86415c231a6086c1d83bbb183565)) + * Revert "feat(ios): support multi-scene applications (#13941)" ([4a1d20f](https://github.com/tidev/titanium_mobile/commit/4a1d20f43c82296dd21bfd760fa63b65927e98fd)) + +* Michael Gangolf + * optionBar color properties ([d5cff3c](https://github.com/tidev/titanium_mobile/commit/d5cff3c32d33b2df2469af949c54c4bab1734676)) + * fix webpack command name issue ([420ccdc](https://github.com/tidev/titanium_mobile/commit/420ccdceadff8658803e02bb6144e853c8767a20)) + * new Android Studio settings xml ([ceda65e](https://github.com/tidev/titanium_mobile/commit/ceda65eb73492c671b6dc74639dee072fa512439)) + * track color of the Ti.UI.Switch ([07df689](https://github.com/tidev/titanium_mobile/commit/07df6890e2a363f40e44757147287bf307e86808)) + * prepare SDK for Android 34 ([ada10bb](https://github.com/tidev/titanium_mobile/commit/ada10bb065851d4b8c55e1342b2a888a776ad381)) + * add iOS WebViewConfiguration link ([9f85623](https://github.com/tidev/titanium_mobile/commit/9f85623fa45dda478124a9b52794c77eb60bd5ac)) + * ioslib update ([7b82317](https://github.com/tidev/titanium_mobile/commit/7b82317907a492b57c52059d8a648ad0e07fb834)) + * new event for empty TextFields ([29964cf](https://github.com/tidev/titanium_mobile/commit/29964cf5a6830948b802810a41e42230c3b1e820)) + * textAlignment for DatePicker ([afb253e](https://github.com/tidev/titanium_mobile/commit/afb253e697442cb6bafdb430a9d8d3539235d58e)) + * add source to webView fireEvent ([960d40c](https://github.com/tidev/titanium_mobile/commit/960d40cd153fc3ee9e0cad09e5171a7a65c62253)) + * remove some dead analytics code ([6926f0d](https://github.com/tidev/titanium_mobile/commit/6926f0d9bfc177fe74e43fa1242adc8f30972cae)) + * update ti.playservice to 18.3.0 ([dc180b9](https://github.com/tidev/titanium_mobile/commit/dc180b94f05aa810aa1f302958ee3f6b36ae69c4)) + * expose contentOffset getter in TableView/ListView ([1f75084](https://github.com/tidev/titanium_mobile/commit/1f7508484839ec20626f6c189e94068fca042f08)) + * ndk update ([a852835](https://github.com/tidev/titanium_mobile/commit/a852835f7612d9c0ab034872a0439461dddde488)) + * add moveToBackground method ([229ef10](https://github.com/tidev/titanium_mobile/commit/229ef10fcfba15ad3050af9266aca8f2c2012448)) + * videoPlayer speed property ([7b9a4e9](https://github.com/tidev/titanium_mobile/commit/7b9a4e92b2e26cc6d8816c1f7fbfda06316997b6)) + * bundle webp res files ([6552a2c](https://github.com/tidev/titanium_mobile/commit/6552a2ccb0c11d01a6bcf185f228dcac709b0453)) + * adaptive icons in default template ([2e0e2e5](https://github.com/tidev/titanium_mobile/commit/2e0e2e5dfa8a726561d2f15daad65a9fec7afa3a)) + * attributedString link example ([cb69378](https://github.com/tidev/titanium_mobile/commit/cb6937849970ac8417ea87f950b03467668672cd)) + * update TabbedBar Android properties ([f5dfa92](https://github.com/tidev/titanium_mobile/commit/f5dfa923fcf649a10e861251d87a073526af2896)) + * node-appc update ([644831f](https://github.com/tidev/titanium_mobile/commit/644831f18e6f35e987992da3f72e294e0d9649be)) + * create alloy project with spaces with --alloy ([c601e7e](https://github.com/tidev/titanium_mobile/commit/c601e7e7579b7b527cc2321b63c82232b169faf4)) + * improve accessibility text ([3171e14](https://github.com/tidev/titanium_mobile/commit/3171e140fd106afb3b42f09076b1cc0a0b86f895)) + * remove some deprecated classes ([e1f2dc1](https://github.com/tidev/titanium_mobile/commit/e1f2dc1e4b246c7156e31fd68a287ca04cc4b752)) + * raise android max sdk support ([eb87849](https://github.com/tidev/titanium_mobile/commit/eb87849b67b68205567247e20e30c7d43e8ea990)) + * add overrideUserInterfaceStyle to Picker ([0c93fa7](https://github.com/tidev/titanium_mobile/commit/0c93fa77aa911e92d3dfbae312e2884706414753)) + * fixing typos ([a298387](https://github.com/tidev/titanium_mobile/commit/a2983877b5a7d6c14bdfdc5426a82e2aca590074)) + * improve the ScrollableView clipView description ([940ca9e](https://github.com/tidev/titanium_mobile/commit/940ca9e959aad1010cc42c6196d9a21a92febc0b)) + * npm packages ([48afddf](https://github.com/tidev/titanium_mobile/commit/48afddf5652602ae2f8cc376d9a37156c828d9c1)) + * hide scrollbars in WebView ([6642ed1](https://github.com/tidev/titanium_mobile/commit/6642ed16ec984331cafa62658a887b33c6a9cd2f)) + * indent log correctly ([a7b145d](https://github.com/tidev/titanium_mobile/commit/a7b145d5668b661f903fdfe53b380bd35a82265a)) + * backgroundColor for RefreshControl ([4f78a79](https://github.com/tidev/titanium_mobile/commit/4f78a79cc51b9a90fa7eb2226e98fad471a6db8d)) + * defaultLang option in tiapp.xml ([07e9a6a](https://github.com/tidev/titanium_mobile/commit/07e9a6ac58a72178c35bda6fdf298860d7786885)) + * pass platform to tiappxml ([760ca45](https://github.com/tidev/titanium_mobile/commit/760ca45c9b63c0aa06940a36010d051b7bb2cbed)) + * try/catch around unlink snapshots ([115bbb2](https://github.com/tidev/titanium_mobile/commit/115bbb24214374228d06a299ce720e72661785cb)) + * update gradle ([e41650c](https://github.com/tidev/titanium_mobile/commit/e41650cd9d088435e8e9641ceae5a2802223a3d2)) + * add info about iOS foreground notifications ([4e5ca53](https://github.com/tidev/titanium_mobile/commit/4e5ca53bf58db474d968bbe1616fcca6d18b2b90)) + * link idleTimerDisabled and keepScreenOn ([bd5c5e7](https://github.com/tidev/titanium_mobile/commit/bd5c5e71d24b04691b510f96b1567da16a5b8283)) + * fix some doc errors ([cf14a9b](https://github.com/tidev/titanium_mobile/commit/cf14a9b4ed83cef111e80d87189cc3e89a906d11)) + * update ti.map ([5eb950c](https://github.com/tidev/titanium_mobile/commit/5eb950ce1c3392f26496a6c6317b5dea24eee9e4)) + +## Bug Fixes + +### Multiple platforms + +* address all whitespace-related linting issues ([e2bf653](https://github.com/tidev/titanium_mobile/commit/e2bf653d406b772deeafb504a0b9f68e363cf3e5)) +* address all whitespace-related linting issues part 2 ([8c92dc7](https://github.com/tidev/titanium_mobile/commit/8c92dc7521219efebad8943a5305348014bd32e4)) +* create alloy project with spaces with --alloy ([c601e7e](https://github.com/tidev/titanium_mobile/commit/c601e7e7579b7b527cc2321b63c82232b169faf4)) +* fix linting issues ([bf24bf2](https://github.com/tidev/titanium_mobile/commit/bf24bf26ae07ebda2e2d70c23de198bac6b2ba8e)) + +### Android platform + +* add missing “Calendar.Event.remove” method ([d1bbe8a](https://github.com/tidev/titanium_mobile/commit/d1bbe8ac2d5fc8530858bcaa48b56d94b9c407e4)) +* bundle webp res files ([6552a2c](https://github.com/tidev/titanium_mobile/commit/6552a2ccb0c11d01a6bcf185f228dcac709b0453)) +* remove some deprecated classes ([e1f2dc1](https://github.com/tidev/titanium_mobile/commit/e1f2dc1e4b246c7156e31fd68a287ca04cc4b752)) + +### iOS platform + +* fix debug issues with scenes ([8bcd5c3](https://github.com/tidev/titanium_mobile/commit/8bcd5c31a8dc86415c231a6086c1d83bbb183565)) +* fix some open issues related to scenes ([a0a3aea](https://github.com/tidev/titanium_mobile/commit/a0a3aeaf666b864fbcb75e57f011a142dbae715c)) + +## Features + +### Multiple platforms + +* add swipe actions support for Ti.UI.TableView ([40808cd](https://github.com/tidev/titanium_mobile/commit/40808cd5ffed82abaeb7e7523100f901f336298f)) + +### Android platform + +* adaptive icons in default template ([2e0e2e5](https://github.com/tidev/titanium_mobile/commit/2e0e2e5dfa8a726561d2f15daad65a9fec7afa3a)) +* add moveToBackground method ([229ef10](https://github.com/tidev/titanium_mobile/commit/229ef10fcfba15ad3050af9266aca8f2c2012448)) +* add source to webView fireEvent ([960d40c](https://github.com/tidev/titanium_mobile/commit/960d40cd153fc3ee9e0cad09e5171a7a65c62253)) +* defaultLang option in tiapp.xml ([07e9a6a](https://github.com/tidev/titanium_mobile/commit/07e9a6ac58a72178c35bda6fdf298860d7786885)) +* expose contentOffset getter in TableView/ListView ([1f75084](https://github.com/tidev/titanium_mobile/commit/1f7508484839ec20626f6c189e94068fca042f08)) +* hide scrollbars in WebView ([6642ed1](https://github.com/tidev/titanium_mobile/commit/6642ed16ec984331cafa62658a887b33c6a9cd2f)) +* improve accessibility text ([3171e14](https://github.com/tidev/titanium_mobile/commit/3171e140fd106afb3b42f09076b1cc0a0b86f895)) +* indent log correctly ([a7b145d](https://github.com/tidev/titanium_mobile/commit/a7b145d5668b661f903fdfe53b380bd35a82265a)) +* new event for empty TextFields ([29964cf](https://github.com/tidev/titanium_mobile/commit/29964cf5a6830948b802810a41e42230c3b1e820)) +* optionBar color properties ([d5cff3c](https://github.com/tidev/titanium_mobile/commit/d5cff3c32d33b2df2469af949c54c4bab1734676)) +* textAlignment for DatePicker ([afb253e](https://github.com/tidev/titanium_mobile/commit/afb253e697442cb6bafdb430a9d8d3539235d58e)) +* track color of the Ti.UI.Switch ([07df689](https://github.com/tidev/titanium_mobile/commit/07df6890e2a363f40e44757147287bf307e86808)) +* update gradle ([e41650c](https://github.com/tidev/titanium_mobile/commit/e41650cd9d088435e8e9641ceae5a2802223a3d2)) +* update ti.playservice to 18.3.0 ([dc180b9](https://github.com/tidev/titanium_mobile/commit/dc180b94f05aa810aa1f302958ee3f6b36ae69c4)) +* videoPlayer speed property ([7b9a4e9](https://github.com/tidev/titanium_mobile/commit/7b9a4e92b2e26cc6d8816c1f7fbfda06316997b6)) + +### iOS platform + +* add iOS 17+ symbol effects ([84ccadb](https://github.com/tidev/titanium_mobile/commit/84ccadbdcbe9b800ebc08dbac8ae5eaeac36a7f8)) +* add overrideUserInterfaceStyle to Picker ([0c93fa7](https://github.com/tidev/titanium_mobile/commit/0c93fa77aa911e92d3dfbae312e2884706414753)) +* backgroundColor for RefreshControl ([4f78a79](https://github.com/tidev/titanium_mobile/commit/4f78a79cc51b9a90fa7eb2226e98fad471a6db8d)) + +## 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.3.1](https://github.com/tidev/titanium_mobile/compare/12_3_0_GA...12.3.1) (2024-06-12) ## About this release diff --git a/README.md b/README.md index 2a509f65fbb..8f761235fa5 100644 --- a/README.md +++ b/README.md @@ -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) 🚀. -Rene PotRodrigo FarfánJason KneenMatt Delmarterdlewis23Daniel EthierAvinash DalviJoe KniesekVittorio SorberaMarcus OlovssonAlessandro La RoccaReshopperGusJason David MillerMichael ZaladonisVincenzo QuacquarelliMighty GmbHFruugulKorelogic LimitedJohn Gould +Rene PotRodrigo FarfánJason KneenMatt Delmarterdlewis23Daniel EthierJoe KniesekVittorio SorberaMarcus OlovssonAlessandro La RoccaReshopperGusJason David MillerMichael ZaladonisVincenzo QuacquarelliMighty GmbHFruugulKorelogic LimitedJohn GouldJoaquin Maroto ## Features diff --git a/android/app/build.gradle b/android/app/build.gradle index 22de0c84364..f9ee6f9cdb1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -13,7 +13,7 @@ android { defaultConfig { applicationId 'com.titanium.test' minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 1 versionName '1.0' manifestPlaceholders = project.ext.tiManifestPlaceholders diff --git a/android/build.gradle b/android/build.gradle index 580edafef28..319eec9c71a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -29,7 +29,7 @@ allprojects { // Load plugin used to enforce our Java coding style guidelines. project.apply plugin: 'checkstyle' checkstyle { - toolVersion = '8.38' + toolVersion = '10.11.0' configFile file("${rootDir}/checkstyle.xml"); ignoreFailures false showViolations true diff --git a/android/modules/calendar/src/java/ti/modules/titanium/calendar/EventProxy.java b/android/modules/calendar/src/java/ti/modules/titanium/calendar/EventProxy.java index 7a8c8c9846c..9ad71100316 100644 --- a/android/modules/calendar/src/java/ti/modules/titanium/calendar/EventProxy.java +++ b/android/modules/calendar/src/java/ti/modules/titanium/calendar/EventProxy.java @@ -559,6 +559,21 @@ public void setExtendedProperty(String name, String value) contentResolver.insert(extPropsUri, values); } + @Kroll.method + public boolean remove() + { + ContentResolver contentResolver = TiApplication.getInstance().getContentResolver(); + + try { + Uri deleteUri = ContentUris.withAppendedId(CalendarContract.Events.CONTENT_URI, TiConvert.toInt(id)); + contentResolver.delete(deleteUri, null, null); + } catch (IllegalArgumentException e) { + return false; + } + + return true; + } + @Override public String getApiName() { diff --git a/android/modules/contacts/src/java/ti/modules/titanium/contacts/PersonProxy.java b/android/modules/contacts/src/java/ti/modules/titanium/contacts/PersonProxy.java index 5b21d6648f4..b681ce02485 100644 --- a/android/modules/contacts/src/java/ti/modules/titanium/contacts/PersonProxy.java +++ b/android/modules/contacts/src/java/ti/modules/titanium/contacts/PersonProxy.java @@ -7,9 +7,8 @@ package ti.modules.titanium.contacts; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; +import android.graphics.Bitmap; +import android.util.Log; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollProxy; @@ -17,8 +16,9 @@ import org.appcelerator.titanium.TiBlob; import org.appcelerator.titanium.TiC; -import android.graphics.Bitmap; -import android.util.Log; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; @Kroll.proxy(parentModule = ContactsModule.class, propertyAccessors = { @@ -44,18 +44,17 @@ TiC.PROPERTY_LASTPHONETIC, TiC.PROPERTY_JOBTITLE, TiC.PROPERTY_DEPARTMENT -}) + }) public class PersonProxy extends KrollProxy { private static final String TAG = "Person"; + // Contact Modifications + private final HashMap modified = new HashMap<>(); + protected boolean hasImage = false; private TiBlob image = null; private boolean imageFetched; // lazy load these bitmap images - protected boolean hasImage = false; private String fullName = ""; - // Contact Modifications - private final HashMap modified = new HashMap<>(); - public PersonProxy() { super(); @@ -189,15 +188,15 @@ public void onPropertyChanged(String name, Object value) || name.equals(TiC.PROPERTY_LASTNAME)) { modified.put(TiC.PROPERTY_NAME, true); } else if (name.equals(TiC.PROPERTY_BIRTHDAY) || name.equals(TiC.PROPERTY_ORGANIZATION) - || name.equals(TiC.PROPERTY_NOTE) || name.equals(TiC.PROPERTY_NICKNAME) - || name.equals(TiC.PROPERTY_PHONE) || name.equals(TiC.PROPERTY_ADDRESS) - || name.equals(TiC.PROPERTY_INSTANTMSG) || name.equals(TiC.PROPERTY_URL) - || name.equals(TiC.PROPERTY_EMAIL) || name.equals(TiC.PROPERTY_RELATED_NAMES) - || name.equals(TiC.PROPERTY_DATE) || name.equals(TiC.PROPERTY_KIND) - || name.equals(TiC.PROPERTY_PREFIX) || name.equals(TiC.PROPERTY_SUFFIX) - || name.equals(TiC.PROPERTY_FIRSTPHONETIC) || name.equals(TiC.PROPERTY_MIDDLEPHONETIC) - || name.equals(TiC.PROPERTY_LASTPHONETIC) || name.equals(TiC.PROPERTY_JOBTITLE) - || name.equals(TiC.PROPERTY_DEPARTMENT)) { + || name.equals(TiC.PROPERTY_NOTE) || name.equals(TiC.PROPERTY_NICKNAME) + || name.equals(TiC.PROPERTY_PHONE) || name.equals(TiC.PROPERTY_ADDRESS) + || name.equals(TiC.PROPERTY_INSTANTMSG) || name.equals(TiC.PROPERTY_URL) + || name.equals(TiC.PROPERTY_EMAIL) || name.equals(TiC.PROPERTY_RELATED_NAMES) + || name.equals(TiC.PROPERTY_DATE) || name.equals(TiC.PROPERTY_KIND) + || name.equals(TiC.PROPERTY_PREFIX) || name.equals(TiC.PROPERTY_SUFFIX) + || name.equals(TiC.PROPERTY_FIRSTPHONETIC) || name.equals(TiC.PROPERTY_MIDDLEPHONETIC) + || name.equals(TiC.PROPERTY_LASTPHONETIC) || name.equals(TiC.PROPERTY_JOBTITLE) + || name.equals(TiC.PROPERTY_DEPARTMENT)) { modified.put(name, true); } diff --git a/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java b/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java index f7fd67028c4..34185dcf79c 100644 --- a/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java +++ b/android/modules/media/src/java/ti/modules/titanium/media/VideoPlayerProxy.java @@ -6,7 +6,14 @@ */ package ti.modules.titanium.media; -import java.lang.ref.WeakReference; +import android.app.Activity; +import android.content.Intent; +import android.media.MediaPlayer; +import android.net.Uri; +import android.os.Handler; +import android.os.Message; +import android.os.Messenger; +import android.webkit.URLUtil; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollFunction; @@ -23,15 +30,9 @@ import org.appcelerator.titanium.view.TiCompositeLayout; import org.appcelerator.titanium.view.TiUIView; +import java.lang.ref.WeakReference; + import ti.modules.titanium.media.TiThumbnailRetriever.ThumbnailResponseHandler; -import android.app.Activity; -import android.content.Intent; -import android.media.MediaPlayer; -import android.net.Uri; -import android.os.Handler; -import android.os.Message; -import android.os.Messenger; -import android.webkit.URLUtil; @Kroll.proxy(creatableInModule = MediaModule.class, propertyAccessors = { @@ -43,14 +44,15 @@ TiC.PROPERTY_PLAYABLE_DURATION, TiC.PROPERTY_VOLUME, TiC.PROPERTY_SHOWS_CONTROLS, -}) + }) public class VideoPlayerProxy extends TiViewProxy implements TiLifecycle.OnLifecycleEvent { - private static final String TAG = "VideoPlayerProxy"; - + // The player doesn't automatically preserve its current location and seek back to + // there when being resumed. This internal property lets us track that. + public static final String PROPERTY_SEEK_TO_ON_RESUME = "__seek_to_on_resume__"; protected static final int CONTROL_MSG_ACTIVITY_AVAILABLE = 101; protected static final int CONTROL_MSG_CONFIG_CHANGED = 102; - + private static final String TAG = "VideoPlayerProxy"; private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1; private static final int MSG_PLAY = MSG_FIRST_ID + 101; private static final int MSG_STOP = MSG_FIRST_ID + 102; @@ -64,16 +66,10 @@ public class VideoPlayerProxy extends TiViewProxy implements TiLifecycle.OnLifec private static final int MSG_HIDE_MEDIA_CONTROLLER = MSG_FIRST_ID + 110; private static final int MSG_SET_VIEW_FROM_ACTIVITY = MSG_FIRST_ID + 111; private static final int MSG_REPEAT_CHANGE = MSG_FIRST_ID + 112; - // Keeping these out of TiC because I believe we'll stop supporting them // in favor of the documented property, which is "mediaControlStyle". private static final String PROPERTY_MOVIE_CONTROL_MODE = "movieControlMode"; private static final String PROPERTY_MOVIE_CONTROL_STYLE = "movieControlStyle"; - - // The player doesn't automatically preserve its current location and seek back to - // there when being resumed. This internal property lets us track that. - public static final String PROPERTY_SEEK_TO_ON_RESUME = "__seek_to_on_resume__"; - protected int mediaControlStyle = MediaModule.VIDEO_CONTROL_DEFAULT; protected int scalingMode = MediaModule.VIDEO_SCALING_RESIZE_ASPECT; private int loadState = MediaModule.VIDEO_LOAD_STATE_UNKNOWN; @@ -127,6 +123,7 @@ public void setActivity(Activity activity) * a TiUIVideoView so we have on common interface to the VideoView * and so we can handle child views in our standard way without any * extra code beyond this here. + * * @param layout The content view of the TiVideoActivity. It already contains a VideoView. */ // @@ -192,11 +189,13 @@ private void launchVideoActivity(KrollDict options) /** * Create handler used for communication from TiVideoActivity to this proxy. + * * @return Returns the handler used to send commands to the video view. */ private Handler createControlHandler() { - return new Handler(new Handler.Callback() { + return new Handler(new Handler.Callback() + { @Override public boolean handleMessage(Message msg) { @@ -613,7 +612,7 @@ public void onPlaybackReady(int duration) setProperty(TiC.PROPERTY_DURATION, duration); setProperty(TiC.PROPERTY_PLAYABLE_DURATION, duration); setProperty(TiC.PROPERTY_END_PLAYBACK_TIME, - duration); // Currently we're not doing anything else with this property in Android. + duration); // Currently we're not doing anything else with this property in Android. if (!hasProperty(TiC.PROPERTY_INITIAL_PLAYBACK_TIME)) { setProperty(TiC.PROPERTY_INITIAL_PLAYBACK_TIME, 0); } @@ -778,7 +777,7 @@ public void requestThumbnailImagesAtTimes(Object[] times, Object option, KrollFu Uri uri = Uri.parse(url); mTiThumbnailRetriever.setUri(uri); mTiThumbnailRetriever.getBitmap(TiConvert.toIntArray(times), TiConvert.toInt(option), - createThumbnailResponseHandler(callback)); + createThumbnailResponseHandler(callback)); } } @@ -795,14 +794,15 @@ public void cancelAllThumbnailImageRequests() * Convenience method for creating a response handler that is used when getting a * bitmap. * - * @param callback Javascript function that the response handler will invoke - * once the bitmap response is ready - * @return the bitmap response handler + * @param callback Javascript function that the response handler will invoke + * once the bitmap response is ready + * @return the bitmap response handler */ private ThumbnailResponseHandler createThumbnailResponseHandler(final KrollFunction callback) { final VideoPlayerProxy videoPlayerProxy = this; - return new ThumbnailResponseHandler() { + return new ThumbnailResponseHandler() + { @Override public void handleThumbnailResponse(KrollDict bitmapResponse) { diff --git a/android/modules/network/src/java/ti/modules/titanium/network/CookieProxy.java b/android/modules/network/src/java/ti/modules/titanium/network/CookieProxy.java index 1862fdc3d15..d7f8b4084b2 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/CookieProxy.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/CookieProxy.java @@ -7,10 +7,6 @@ package ti.modules.titanium.network; -import java.net.HttpCookie; -import java.text.SimpleDateFormat; -import java.util.TimeZone; - import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollProxy; import org.appcelerator.kroll.annotations.Kroll; @@ -18,6 +14,10 @@ import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.util.TiConvert; +import java.net.HttpCookie; +import java.text.SimpleDateFormat; +import java.util.TimeZone; + @Kroll.proxy(creatableInModule = NetworkModule.class, propertyAccessors = { TiC.PROPERTY_VALUE, @@ -28,14 +28,15 @@ TiC.PROPERTY_SECURE, TiC.PROPERTY_HTTP_ONLY, TiC.PROPERTY_VERSION -}) + }) public class CookieProxy extends KrollProxy { + public static final SimpleDateFormat systemExpiryDateFormatter = + new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss 'GMT'"); private static final String TAG = "CookieProxy"; private static final TimeZone timezone = TimeZone.getTimeZone("GMT"); private static final SimpleDateFormat httpExpiryDateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); - public static final SimpleDateFormat systemExpiryDateFormatter = - new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss 'GMT'"); + static { httpExpiryDateFormatter.setTimeZone(timezone); @@ -53,7 +54,7 @@ public CookieProxy(HttpCookie cookie) { super(); if (cookie instanceof HttpCookie) { - httpCookie = (HttpCookie) cookie; + httpCookie = cookie; setProperty(TiC.PROPERTY_NAME, httpCookie.getName()); setProperty(TiC.PROPERTY_VALUE, httpCookie.getValue()); setProperty(TiC.PROPERTY_DOMAIN, httpCookie.getDomain()); diff --git a/android/modules/network/src/java/ti/modules/titanium/network/HTTPClientProxy.java b/android/modules/network/src/java/ti/modules/titanium/network/HTTPClientProxy.java index cceab6df10d..397ccf9d2e6 100644 --- a/android/modules/network/src/java/ti/modules/titanium/network/HTTPClientProxy.java +++ b/android/modules/network/src/java/ti/modules/titanium/network/HTTPClientProxy.java @@ -6,7 +6,7 @@ */ package ti.modules.titanium.network; -import java.io.UnsupportedEncodingException; +import android.os.Build; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollProxy; @@ -15,8 +15,9 @@ import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.util.TiConvert; +import java.io.UnsupportedEncodingException; + import ti.modules.titanium.xml.DocumentProxy; -import android.os.Build; @Kroll.proxy(creatableInModule = NetworkModule.class, propertyAccessors = { @@ -26,7 +27,7 @@ TiC.PROPERTY_ONERROR, TiC.PROPERTY_ONREADYSTATECHANGE, TiC.PROPERTY_ONDATASTREAM -}) + }) public class HTTPClientProxy extends KrollProxy { @Kroll.constant @@ -39,9 +40,8 @@ public class HTTPClientProxy extends KrollProxy public static final int LOADING = TiHTTPClient.READY_STATE_LOADING; @Kroll.constant public static final int DONE = TiHTTPClient.READY_STATE_DONE; - - private static final String TAG = "TiHTTPClientProxy"; public static final String PROPERTY_SECURITY_MANAGER = "securityManager"; + private static final String TAG = "TiHTTPClientProxy"; private TiHTTPClient client; public HTTPClientProxy() @@ -82,7 +82,7 @@ public void handleCreationDict(KrollDict dict) } else { throw new IllegalArgumentException( "Invalid argument passed to securityManager property." - + " Does not conform to SecurityManagerProtocol"); + + " Does not conform to SecurityManagerProtocol"); } } } @@ -241,12 +241,6 @@ public void setValidatesSecureCertificate(boolean value) this.setProperty("validatesSecureCertificate", value); } - @Kroll.setProperty - public void setUsername(String value) - { - this.setProperty(TiC.PROPERTY_USERNAME, value); - } - @Kroll.getProperty public String getUsername() { @@ -257,9 +251,9 @@ public String getUsername() } @Kroll.setProperty - public void setPassword(String value) + public void setUsername(String value) { - this.setProperty(TiC.PROPERTY_PASSWORD, value); + this.setProperty(TiC.PROPERTY_USERNAME, value); } @Kroll.getProperty @@ -272,9 +266,9 @@ public String getPassword() } @Kroll.setProperty - public void setDomain(String value) + public void setPassword(String value) { - this.setProperty(TiC.PROPERTY_DOMAIN, value); + this.setProperty(TiC.PROPERTY_PASSWORD, value); } @Kroll.getProperty @@ -287,9 +281,9 @@ public String getDomain() } @Kroll.setProperty - public void setTlsVersion(int tlsVersion) + public void setDomain(String value) { - client.setTlsVersion(tlsVersion); + this.setProperty(TiC.PROPERTY_DOMAIN, value); } @Kroll.getProperty @@ -309,6 +303,12 @@ public int getTlsVersion() return tlsVersion; } + @Kroll.setProperty + public void setTlsVersion(int tlsVersion) + { + client.setTlsVersion(tlsVersion); + } + @Override public String getApiName() { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ActivityIndicatorProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ActivityIndicatorProxy.java index 44f8400ae49..379119eff3c 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ActivityIndicatorProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ActivityIndicatorProxy.java @@ -6,6 +6,9 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; +import android.os.Message; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; @@ -13,8 +16,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIActivityIndicator; -import android.app.Activity; -import android.os.Message; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -24,7 +25,7 @@ TiC.PROPERTY_FONT, TiC.PROPERTY_STYLE, TiC.PROPERTY_INDICATOR_COLOR -}) + }) @Kroll.dynamicApis(methods = { "hide", "show" }) public class ActivityIndicatorProxy extends TiViewProxy { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/AlertDialogProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/AlertDialogProxy.java index 8727e95e3b2..84c38669b9e 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/AlertDialogProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/AlertDialogProxy.java @@ -6,6 +6,8 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; @@ -14,7 +16,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIDialog; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -29,7 +30,7 @@ TiC.PROPERTY_OK, TiC.PROPERTY_OKID, TiC.PROPERTY_PERSISTENT -}) + }) public class AlertDialogProxy extends TiViewProxy { public AlertDialogProxy() @@ -63,7 +64,8 @@ protected void handleShow(KrollDict options) // dialog should occur above the "topmost" activity, so if activity // stack transitions are occurring, try to give them a chance to "settle" // before determining which Activity should be the context for the AlertDialog. - TiUIHelper.runUiDelayedIfBlock(new Runnable() { + TiUIHelper.runUiDelayedIfBlock(new Runnable() + { @Override public void run() { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/AnimationProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/AnimationProxy.java index cc80f1d48b0..73e03fe0c84 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/AnimationProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/AnimationProxy.java @@ -27,7 +27,7 @@ TiC.PROPERTY_WIDTH, TiC.PROPERTY_HEIGHT, TiC.PROPERTY_BACKGROUND_COLOR -}) + }) public class AnimationProxy extends TiAnimation { @Override diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ButtonProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ButtonProxy.java index 5b64456d758..7be131fa2c6 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ButtonProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ButtonProxy.java @@ -6,6 +6,8 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; @@ -13,7 +15,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIButton; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -30,7 +31,7 @@ TiC.PROPERTY_SHADOW_COLOR, TiC.PROPERTY_SHADOW_RADIUS, TiC.PROPERTY_TINT_COLOR -}) + }) public class ButtonProxy extends TiViewProxy { public ButtonProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/EmailDialogProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/EmailDialogProxy.java index 34e53a758af..4dab5f3abb2 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/EmailDialogProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/EmailDialogProxy.java @@ -6,17 +6,21 @@ */ package ti.modules.titanium.ui; -import java.io.File; -import java.util.ArrayList; -import java.util.List; +import android.app.Activity; +import android.content.ClipData; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.text.Html; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.kroll.common.Log; -import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.TiApplication; import org.appcelerator.titanium.TiApplication.ActivityTransitionListener; import org.appcelerator.titanium.TiBlob; +import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.io.TiBaseFile; import org.appcelerator.titanium.io.TiFile; import org.appcelerator.titanium.io.TiFileFactory; @@ -29,14 +33,11 @@ import org.appcelerator.titanium.util.TiMimeTypeHelper; import org.appcelerator.titanium.view.TiUIView; +import java.io.File; +import java.util.ArrayList; +import java.util.List; + import ti.modules.titanium.filesystem.FileProxy; -import android.app.Activity; -import android.content.ClipData; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.net.Uri; -import android.text.Html; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -46,12 +47,10 @@ "messageBody", "subject", "toRecipients" -}) + }) public class EmailDialogProxy extends TiViewProxy implements ActivityTransitionListener { - private static final String TAG = "EmailDialogProxy"; - @Kroll.constant public static final int CANCELLED = 0; @Kroll.constant @@ -60,7 +59,7 @@ public class EmailDialogProxy extends TiViewProxy implements ActivityTransitionL public static final int SENT = 2; @Kroll.constant public static final int FAILED = 3; - + private static final String TAG = "EmailDialogProxy"; private ArrayList attachments; private String privateDataDirectoryPath = null; @@ -103,9 +102,9 @@ public void addAttachment(Object attachment) } else { // silently ignore? Log.d(TAG, - "addAttachment for type " + attachment.getClass().getName() - + " ignored. Only files and blobs may be attached.", - Log.DEBUG_MODE); + "addAttachment for type " + attachment.getClass().getName() + + " ignored. Only files and blobs may be attached.", + Log.DEBUG_MODE); } } @@ -149,7 +148,8 @@ public void doOpen() TiActivitySupport activitySupport = (TiActivitySupport) activity; final int code = activitySupport.getUniqueResultCode(); - activitySupport.launchActivityForResult(choosingIntent, code, new TiActivityResultHandler() { + activitySupport.launchActivityForResult(choosingIntent, code, new TiActivityResultHandler() + { @Override public void onResult(Activity activity, int requestCode, int resultCode, Intent data) { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ImageViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ImageViewProxy.java index b1546041d2d..41419f4a825 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ImageViewProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ImageViewProxy.java @@ -7,10 +7,12 @@ package ti.modules.titanium.ui; import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiBlob; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.view.TiUIView; + import ti.modules.titanium.media.MediaModule; import ti.modules.titanium.ui.widget.TiUIImageView; @@ -27,7 +29,7 @@ TiC.PROPERTY_IMAGES, TiC.PROPERTY_REPEAT_COUNT, TiC.PROPERTY_SCALING_MODE -}) + }) public class ImageViewProxy extends ViewProxy { public ImageViewProxy() @@ -108,18 +110,18 @@ public TiBlob toBlob() return getImageView().toBlob(); } - @Kroll.setProperty(runOnUiThread = true) - public void setTintColor(String color) - { - getImageView().setTintColor(color); - } - @Kroll.getProperty public int getTintColor() { return getImageView().getTintColor(); } + @Kroll.setProperty(runOnUiThread = true) + public void setTintColor(String color) + { + getImageView().setTintColor(color); + } + @Override public String getApiName() { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/LabelProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/LabelProxy.java index 61e2ab2d739..a2cb6669b01 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/LabelProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/LabelProxy.java @@ -6,6 +6,8 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; @@ -13,7 +15,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUILabel; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -38,7 +39,7 @@ TiC.PROPERTY_MINIMUM_FONT_SIZE, TiC.PROPERTY_BREAK_STRATEGY, TiC.PROPERTY_HYPHENATION_FREQUENCY -}) + }) public class LabelProxy extends TiViewProxy { private static final String TAG = "LabelProxy"; diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/MaskedImageProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/MaskedImageProxy.java index 1194e53aef8..40600c13a93 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/MaskedImageProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/MaskedImageProxy.java @@ -7,9 +7,11 @@ package ti.modules.titanium.ui; import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.view.TiUIView; + import ti.modules.titanium.ui.widget.TiUIMaskedImage; @Kroll.proxy(creatableInModule = UIModule.class, @@ -19,7 +21,7 @@ TiC.PROPERTY_MODE, TiC.PROPERTY_TINT, TiC.PROPERTY_TINT_COLOR -}) + }) public class MaskedImageProxy extends ViewProxy { public MaskedImageProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/OptionDialogProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/OptionDialogProxy.java index 02dba5586cb..da9391fd199 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/OptionDialogProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/OptionDialogProxy.java @@ -6,13 +6,15 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIDialog; -import android.app.Activity; + @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_ANDROID_VIEW, @@ -22,7 +24,7 @@ TiC.PROPERTY_TITLE, TiC.PROPERTY_TITLEID, TiC.PROPERTY_PERSISTENT -}) + }) public class OptionDialogProxy extends TiDialogProxy { public OptionDialogProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerColumnProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerColumnProxy.java index a0333188283..df6f2bd18f0 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerColumnProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerColumnProxy.java @@ -7,22 +7,20 @@ package ti.modules.titanium.ui; import android.util.Log; -import java.util.ArrayList; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollProxy; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; +import java.util.ArrayList; + @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_WIDTH, -}) + }) public class PickerColumnProxy extends KrollProxy implements PickerRowProxy.OnChangedListener { - public interface OnChangedListener { - void onChanged(PickerColumnProxy proxy); - } - private static final String TAG = "PickerColumnProxy"; private final ArrayList rowList = new ArrayList<>(); private final ArrayList listeners = new ArrayList<>(); @@ -222,4 +220,8 @@ public String getApiName() { return "Ti.UI.PickerColumn"; } + + public interface OnChangedListener { + void onChanged(PickerColumnProxy proxy); + } } diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java index 7bbaaca3649..d2536898cfc 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/PickerProxy.java @@ -6,31 +6,6 @@ */ package ti.modules.titanium.ui; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.TimeZone; -import java.util.concurrent.atomic.AtomicInteger; - -import org.appcelerator.kroll.KrollDict; -import org.appcelerator.kroll.KrollFunction; -import org.appcelerator.kroll.annotations.Kroll; -import org.appcelerator.titanium.R; -import org.appcelerator.titanium.TiApplication; -import org.appcelerator.titanium.TiC; -import org.appcelerator.titanium.TiDimension; -import org.appcelerator.titanium.proxy.TiViewProxy; -import org.appcelerator.titanium.util.TiConvert; -import org.appcelerator.titanium.util.TiUIHelper; -import org.appcelerator.titanium.view.TiUIView; - -import ti.modules.titanium.ui.widget.picker.TiUIDatePicker; -import ti.modules.titanium.ui.widget.picker.TiUIPlainDropDownPicker; -import ti.modules.titanium.ui.widget.picker.TiUIPlainPicker; -import ti.modules.titanium.ui.widget.picker.TiUIPlainSpinnerPicker; -import ti.modules.titanium.ui.widget.picker.TiUITimePicker; - import android.annotation.SuppressLint; import android.app.Activity; import android.graphics.Color; @@ -56,6 +31,31 @@ import com.google.android.material.timepicker.MaterialTimePicker; import com.google.android.material.timepicker.TimeFormat; +import org.appcelerator.kroll.KrollDict; +import org.appcelerator.kroll.KrollFunction; +import org.appcelerator.kroll.annotations.Kroll; +import org.appcelerator.titanium.R; +import org.appcelerator.titanium.TiApplication; +import org.appcelerator.titanium.TiC; +import org.appcelerator.titanium.TiDimension; +import org.appcelerator.titanium.proxy.TiViewProxy; +import org.appcelerator.titanium.util.TiConvert; +import org.appcelerator.titanium.util.TiUIHelper; +import org.appcelerator.titanium.view.TiUIView; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.TimeZone; +import java.util.concurrent.atomic.AtomicInteger; + +import ti.modules.titanium.ui.widget.picker.TiUIDatePicker; +import ti.modules.titanium.ui.widget.picker.TiUIPlainDropDownPicker; +import ti.modules.titanium.ui.widget.picker.TiUIPlainPicker; +import ti.modules.titanium.ui.widget.picker.TiUIPlainSpinnerPicker; +import ti.modules.titanium.ui.widget.picker.TiUITimePicker; + @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_CALENDAR_VIEW_SHOWN, @@ -66,13 +66,13 @@ TiC.PROPERTY_MAX_DATE, TiC.PROPERTY_SELECTION_OPENS, TiC.PROPERTY_VALUE -}) + }) public class PickerProxy extends TiViewProxy implements PickerColumnProxy.OnChangedListener { private static final String TAG = "PickerProxy"; - private int type = UIModule.PICKER_TYPE_PLAIN; private final ArrayList columnList = new ArrayList<>(); private final ArrayList selectedRows = new ArrayList<>(); + private int type = UIModule.PICKER_TYPE_PLAIN; private boolean useSpinner = false; private boolean canFireColumnEvents = true; @@ -83,6 +83,26 @@ public PickerProxy() defaultValues.put(TiC.PROPERTY_DATE_PICKER_STYLE, UIModule.DATE_PICKER_STYLE_AUTOMATIC); } + /** + * Trim hour, minute, second and millisecond from the date + * + * @param inDate input date + * @return return the trimmed date + */ + private static Date createDateWithoutTime(Date inDate) + { + if (inDate == null) { + return null; + } + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); + cal.setTime(inDate); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + return cal.getTime(); + } + @Override public void handleCreationDict(KrollDict dict) { @@ -187,17 +207,20 @@ public TextInputLayout createTextInputLayout() editText.setSingleLine(); editText.setMaxLines(1); editText.setGravity(Gravity.CENTER_VERTICAL | Gravity.START); - editText.setKeyListener(new BaseKeyListener() { + editText.setKeyListener(new BaseKeyListener() + { @Override public int getInputType() { return InputType.TYPE_NULL; } + @Override public boolean backspace(View view, Editable content, int keyCode, KeyEvent event) { return false; } + @Override public boolean forwardDelete(View view, Editable content, int keyCode, KeyEvent event) { @@ -635,25 +658,6 @@ public void showDatePickerDialog(Object[] args) picker.show(appCompatActivity.getSupportFragmentManager(), picker.toString()); } - /** - * Trim hour, minute, second and millisecond from the date - * @param inDate input date - * @return return the trimmed date - */ - private static Date createDateWithoutTime(Date inDate) - { - if (inDate == null) { - return null; - } - Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); - cal.setTime(inDate); - cal.set(Calendar.HOUR_OF_DAY, 0); - cal.set(Calendar.MINUTE, 0); - cal.set(Calendar.SECOND, 0); - cal.set(Calendar.MILLISECOND, 0); - return cal.getTime(); - } - // This is meant to be a kind of "static" method, in the sense that // it doesn't use any state except for context. It's a quick hit way // of getting a date dialog up, in other words. diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ProgressBarProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ProgressBarProxy.java index aeaaed67488..b6b0a5f4346 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ProgressBarProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ProgressBarProxy.java @@ -6,13 +6,14 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIProgressBar; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -24,7 +25,7 @@ TiC.PROPERTY_COLOR, TiC.PROPERTY_TINT_COLOR, TiC.PROPERTY_TRACK_TINT_COLOR, -}) + }) public class ProgressBarProxy extends TiViewProxy { public ProgressBarProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/RefreshControlProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/RefreshControlProxy.java index 67a5141eb77..f4a8fd62783 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/RefreshControlProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/RefreshControlProxy.java @@ -7,23 +7,28 @@ package ti.modules.titanium.ui; import android.graphics.Color; -import java.util.HashSet; -import org.appcelerator.kroll.annotations.Kroll; -import org.appcelerator.kroll.common.Log; + 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; import org.appcelerator.titanium.util.TiColorHelper; + +import java.util.HashSet; + import ti.modules.titanium.ui.widget.TiSwipeRefreshLayout; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_TINT_COLOR, TiC.PROPERTY_TITLE, -}) + }) public class RefreshControlProxy extends KrollProxy { - /** The default Android log tag name to be used by this class. */ + /** + * The default Android log tag name to be used by this class. + */ private static final String TAG = "RefreshControlProxy"; /** @@ -39,7 +44,9 @@ public class RefreshControlProxy extends KrollProxy */ private static final HashSet assignedControls = new HashSet<>(); - /** Color integer value to be applied to the refresh layout's progress indicator. */ + /** + * Color integer value to be applied to the refresh layout's progress indicator. + */ private int tintColor = DEFAULT_TINT_COLOR; /** @@ -48,14 +55,55 @@ public class RefreshControlProxy extends KrollProxy */ private TiSwipeRefreshLayout swipeRefreshLayout; - /** Creates a new Titanium "RefreshControl" proxy binding. */ + /** + * Creates a new Titanium "RefreshControl" proxy binding. + */ public RefreshControlProxy() { super(); } + /** + * Unassigns the given view from a RefreshControlProxy instance that was once assigned to + * it via the assignTo() method. A view is expected to call this method when removed from the + * window or to disable pull-down refresh support. + * + * @param view The view to be unassigned from a refresh control, if currently assigned. Can be null. + */ + public static void unassignFrom(TiSwipeRefreshLayout view) + { + // Validate argument. + if (view == null) { + return; + } + + // Attempt to find a refresh control that is currently assigned to the given view. + RefreshControlProxy proxy = null; + for (RefreshControlProxy nextProxy : RefreshControlProxy.assignedControls) { + if ((nextProxy != null) && (nextProxy.swipeRefreshLayout == view)) { + proxy = nextProxy; + break; + } + } + if (proxy == null) { + return; + } + + // Remove the refresh event listener. + proxy.swipeRefreshLayout.setOnRefreshListener(null); + + // Disable pull-down refresh support. + proxy.endRefreshing(); + proxy.swipeRefreshLayout.setSwipeRefreshEnabled(false); + + // Unassign the view from the refresh control. + RefreshControlProxy.assignedControls.remove(proxy); + proxy.swipeRefreshLayout = null; + } + /** * Fetches the JavaScript type name of this proxy object. + * * @return Returns the unique type name of this proxy object. */ @Override @@ -69,6 +117,7 @@ public String getApiName() *

* Expected to be called on the runtime thread when the * JavaScript Ti.UI.createRefreshControl() function has been invoked. + * * @param properties Dictionary of property settings. */ @Override @@ -94,7 +143,8 @@ public void handleCreationDict(KrollDict properties) /** * Called when a single property setting has been changed. * Expected to be called on the JavaScript runtime thread. - * @param name The unique name of the property that was changed. + * + * @param name The unique name of the property that was changed. * @param value The property new value. Can be null. */ @Override @@ -116,9 +166,9 @@ public void onPropertyChanged(String name, Object value) /** * Stores the given tint color value to be applied to the refresh progress indicator. - * @param colorName - * The color value to be applied. Expected to be a string such as "red", "blue", "#00FF00", etc. - * Can be null, in which case, the progress indicator will revert back to its default color. + * + * @param colorName The color value to be applied. Expected to be a string such as "red", "blue", "#00FF00", etc. + * Can be null, in which case, the progress indicator will revert back to its default color. */ private void onTintColorChanged(Object colorName) { @@ -141,7 +191,9 @@ private void onTintColorChanged(Object colorName) this.swipeRefreshLayout.setColorSchemeColors(tintColor); } - /** Displays the refresh progress indicator if a SwipeRefreshLayout is currently assigned. */ + /** + * Displays the refresh progress indicator if a SwipeRefreshLayout is currently assigned. + */ @Kroll.method public void beginRefreshing() { @@ -162,7 +214,9 @@ public void beginRefreshing() fireEvent(TiC.EVENT_REFRESH_START, null); } - /** Hides the refresh progress indicator if a SwipeRefreshLayout is currently assigned. */ + /** + * Hides the refresh progress indicator if a SwipeRefreshLayout is currently assigned. + */ @Kroll.method public void endRefreshing() { @@ -195,10 +249,10 @@ public void endRefreshing() *

* If this refresh control is currently assigned to another view, then it will be automatically * unassigned from the previous view before being assigned the given view. - * @param view - * The view to be assigned to this refresh control. - *

- * Can be null, in which case, this method will do nothing. + * + * @param view The view to be assigned to this refresh control. + *

+ * Can be null, in which case, this method will do nothing. */ public void assignTo(TiSwipeRefreshLayout view) { @@ -222,7 +276,8 @@ public void assignTo(TiSwipeRefreshLayout view) // Set up the given view for pull-down refresh support. view.setColorSchemeColors(this.tintColor); view.setSwipeRefreshEnabled(true); - view.setOnRefreshListener(new TiSwipeRefreshLayout.OnRefreshListener() { + view.setOnRefreshListener(new TiSwipeRefreshLayout.OnRefreshListener() + { @Override public void onRefresh() { @@ -232,42 +287,4 @@ public void onRefresh() } }); } - - /** - * Unassigns the given view from a RefreshControlProxy instance that was once assigned to - * it via the assignTo() method. A view is expected to call this method when removed from the - * window or to disable pull-down refresh support. - * @param view - * The view to be unassigned from a refresh control, if currently assigned. Can be null. - */ - public static void unassignFrom(TiSwipeRefreshLayout view) - { - // Validate argument. - if (view == null) { - return; - } - - // Attempt to find a refresh control that is currently assigned to the given view. - RefreshControlProxy proxy = null; - for (RefreshControlProxy nextProxy : RefreshControlProxy.assignedControls) { - if ((nextProxy != null) && (nextProxy.swipeRefreshLayout == view)) { - proxy = nextProxy; - break; - } - } - if (proxy == null) { - return; - } - - // Remove the refresh event listener. - proxy.swipeRefreshLayout.setOnRefreshListener(null); - - // Disable pull-down refresh support. - proxy.endRefreshing(); - proxy.swipeRefreshLayout.setSwipeRefreshEnabled(false); - - // Unassign the view from the refresh control. - RefreshControlProxy.assignedControls.remove(proxy); - proxy.swipeRefreshLayout = null; - } } diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollViewProxy.java index d8a48cd4f0b..81ee8644f2d 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollViewProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollViewProxy.java @@ -6,17 +6,19 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiViewProxy; -import org.appcelerator.titanium.view.TiUIView; import org.appcelerator.titanium.util.TiConvert; +import org.appcelerator.titanium.view.TiUIView; -import ti.modules.titanium.ui.widget.TiUIScrollView; -import android.app.Activity; import java.util.HashMap; +import ti.modules.titanium.ui.widget.TiUIScrollView; + @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_CONTENT_HEIGHT, @@ -28,7 +30,7 @@ TiC.PROPERTY_CAN_CANCEL_EVENTS, TiC.PROPERTY_OVER_SCROLL_MODE, TiC.PROPERTY_REFRESH_CONTROL -}) + }) public class ScrollViewProxy extends TiViewProxy { private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1; @@ -65,18 +67,18 @@ public void scrollTo(int x, int y, @Kroll.argument(optional = true) HashMap args handleScrollTo(x, y, animated); } - @Kroll.setProperty - public void setScrollingEnabled(Object enabled) - { - getScrollView().setScrollingEnabled(enabled); - } - @Kroll.getProperty public boolean getScrollingEnabled() { return getScrollView().getScrollingEnabled(); } + @Kroll.setProperty + public void setScrollingEnabled(Object enabled) + { + getScrollView().setScrollingEnabled(enabled); + } + @Kroll.method public void scrollToBottom() { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollableViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollableViewProxy.java index 0f0ab6a1925..b3ab5c08940 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollableViewProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ScrollableViewProxy.java @@ -6,9 +6,8 @@ */ package ti.modules.titanium.ui; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; +import android.app.Activity; +import android.os.Message; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; @@ -17,9 +16,11 @@ import org.appcelerator.titanium.util.TiConvert; import org.appcelerator.titanium.view.TiUIView; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; + import ti.modules.titanium.ui.widget.TiUIScrollableView; -import android.app.Activity; -import android.os.Message; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -28,11 +29,11 @@ TiC.PROPERTY_PADDING, TiC.PROPERTY_SHOW_PAGING_CONTROL, TiC.PROPERTY_OVER_SCROLL_MODE -}) + }) public class ScrollableViewProxy extends TiViewProxy { + public static final int MIN_CACHE_SIZE = 3; private static final String TAG = "TiScrollableView"; - private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1; public static final int MSG_HIDE_PAGER = MSG_FIRST_ID + 101; public static final int MSG_MOVE_PREV = MSG_FIRST_ID + 102; @@ -41,12 +42,9 @@ public class ScrollableViewProxy extends TiViewProxy public static final int MSG_SET_CURRENT = MSG_FIRST_ID + 107; public static final int MSG_SET_ENABLED = MSG_FIRST_ID + 109; public static final int MSG_LAST_ID = MSG_FIRST_ID + 999; - private static final int DEFAULT_PAGING_CONTROL_TIMEOUT = 3000; - public static final int MIN_CACHE_SIZE = 3; - protected AtomicBoolean inScroll; - private List views = new ArrayList<>(); + private final List views = new ArrayList<>(); private TiUIScrollableView scrollableView; public ScrollableViewProxy() @@ -351,6 +349,13 @@ public void fireScroll(int currentPage, float currentPageAsFloat, TiViewProxy cu } } + @Kroll.getProperty + public boolean getScrollingEnabled() + { + return (scrollableView != null) ? scrollableView.getEnabled() + : getProperties().optBoolean(TiC.PROPERTY_SCROLLING_ENABLED, true); + } + @Kroll.setProperty public void setScrollingEnabled(boolean value) { @@ -358,11 +363,12 @@ public void setScrollingEnabled(boolean value) scrollableView.setEnabled(value); } } + @Kroll.getProperty - public boolean getScrollingEnabled() + public int getCurrentPage() { - return (scrollableView != null) ? scrollableView.getEnabled() - : getProperties().optBoolean(TiC.PROPERTY_SCROLLING_ENABLED, true); + return (scrollableView != null) ? scrollableView.getCurrentPage() + : getProperties().optInt(TiC.PROPERTY_CURRENT_PAGE, 0); } @Kroll.setProperty @@ -375,13 +381,6 @@ public void setCurrentPage(int currentPage) } } - @Kroll.getProperty - public int getCurrentPage() - { - return (scrollableView != null) ? scrollableView.getCurrentPage() - : getProperties().optInt(TiC.PROPERTY_CURRENT_PAGE, 0); - } - @Override public void releaseViews() { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/SearchBarProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/SearchBarProxy.java index 59b8002414c..0bfadaae48c 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/SearchBarProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/SearchBarProxy.java @@ -1,11 +1,7 @@ -/** - * Titanium SDK - * Copyright TiDev, Inc. 04/07/2022-Present. All Rights Reserved. - * Licensed under the terms of the Apache Public License - * Please see the LICENSE included with this distribution for details. - */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; @@ -14,7 +10,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.searchbar.TiUISearchBar; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -30,7 +25,7 @@ TiC.PROPERTY_PROMPT, TiC.PROPERTY_PROMPT_ID, TiC.PROPERTY_VALUE -}) + }) public class SearchBarProxy extends TiViewProxy { public SearchBarProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/SliderProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/SliderProxy.java index d6349387c34..eff016c99ed 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/SliderProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/SliderProxy.java @@ -6,13 +6,14 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUISlider; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -27,7 +28,7 @@ TiC.PROPERTY_TINT_COLOR, TiC.PROPERTY_TRACK_TINT_COLOR, TiC.PROPERTY_VALUE -}) + }) public class SliderProxy extends TiViewProxy { public SliderProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/SwitchProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/SwitchProxy.java index 3bdcac73f38..f3758a97fa9 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/SwitchProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/SwitchProxy.java @@ -6,12 +6,14 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiUIView; + import ti.modules.titanium.ui.widget.TiUISwitch; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -28,7 +30,7 @@ TiC.PROPERTY_VERTICAL_ALIGN, TiC.PROPERTY_ON_THUMB_COLOR, TiC.PROPERTY_THUMB_COLOR -}) + }) public class SwitchProxy extends TiViewProxy { public SwitchProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/TabGroupProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/TabGroupProxy.java index c1849cdc9de..0c76925eb2e 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/TabGroupProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/TabGroupProxy.java @@ -6,9 +6,15 @@ */ package ti.modules.titanium.ui; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.HashMap; +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.LayoutInflater; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; @@ -27,20 +33,15 @@ import org.appcelerator.titanium.util.TiRHelper; import org.appcelerator.titanium.util.TiUIHelper; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.HashMap; + import ti.modules.titanium.ui.android.AndroidModule; import ti.modules.titanium.ui.widget.tabgroup.TiUIAbstractTabGroup; import ti.modules.titanium.ui.widget.tabgroup.TiUIBottomNavigationTabGroup; import ti.modules.titanium.ui.widget.tabgroup.TiUITabLayoutTabGroup; -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; -import android.view.LayoutInflater; - @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_TABS_BACKGROUND_COLOR, @@ -49,27 +50,24 @@ TiC.PROPERTY_AUTO_TAB_TITLE, TiC.PROPERTY_EXIT_ON_CLOSE, TiC.PROPERTY_SMOOTH_SCROLL_ON_TAB_CLICK -}) + }) public class TabGroupProxy extends TiWindowProxy implements TiActivityWindow { private static final String TAG = "TabGroupProxy"; private static final String PROPERTY_POST_TAB_GROUP_CREATED = "postTabGroupCreated"; private static final int MSG_FIRST_ID = TiWindowProxy.MSG_LAST_ID + 1; - + protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; private static final int MSG_ADD_TAB = MSG_FIRST_ID + 100; private static final int MSG_REMOVE_TAB = MSG_FIRST_ID + 101; private static final int MSG_SET_ACTIVE_TAB = MSG_FIRST_ID + 102; private static final int MSG_GET_ACTIVE_TAB = MSG_FIRST_ID + 103; private static final int MSG_SET_TABS = MSG_FIRST_ID + 104; private static final int MSG_DISABLE_TAB_NAVIGATION = MSG_FIRST_ID + 105; - - protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; - - private ArrayList tabs = new ArrayList<>(); + private static int id_toolbar; + private final ArrayList tabs = new ArrayList<>(); private WeakReference tabGroupActivity = new WeakReference<>(null); private Object selectedTab; // NOTE: Can be TabProxy or Number private String tabGroupTitle = null; - private static int id_toolbar; private boolean autoTabTitle = false; public TabGroupProxy() @@ -167,12 +165,6 @@ public Object getActiveTab() } } - private TabProxy getActiveTabProxy() - { - Object activeTab = getActiveTab(); - return (activeTab != null) ? parseTab(activeTab) : null; - } - @Kroll.setProperty public void setActiveTab(Object tabOrIndex) { @@ -197,6 +189,12 @@ public void setActiveTab(Object tabOrIndex) } } + private TabProxy getActiveTabProxy() + { + Object activeTab = getActiveTab(); + return (activeTab != null) ? parseTab(activeTab) : null; + } + @Kroll.getProperty(name = "activity") public ActivityProxy _getActivity() { @@ -337,7 +335,7 @@ protected void handleOpen(KrollDict options) topActivity.startActivity(intent); topActivity.overridePendingTransition(0, 0); } else if (options.containsKey(TiC.PROPERTY_ACTIVITY_ENTER_ANIMATION) - || options.containsKey(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION)) { + || options.containsKey(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION)) { topActivity.startActivity(intent); int enterAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_ENTER_ANIMATION), 0); int exitAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION), 0); @@ -569,7 +567,7 @@ public void onTabSelected(TabProxy tabProxy) tabProxy.onSelectionChanged(true); tabProxy.onFocusChanged(true, focusEventData); - tabProxy.fireEvent(TiC.EVENT_SELECTED, focusEventData, false); + tabProxy.fireEvent(TiC.EVENT_SELECTED, focusEventData.clone(), false); } @Override diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/TextAreaProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/TextAreaProxy.java index 1661afb3a4d..d88956f5f91 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/TextAreaProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/TextAreaProxy.java @@ -6,6 +6,8 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollModule; import org.appcelerator.kroll.annotations.Kroll; @@ -15,7 +17,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIText; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -46,7 +47,7 @@ TiC.PROPERTY_VERTICAL_ALIGN, TiC.PROPERTY_PADDING, TiC.PROPERTY_RETURN_KEY_TYPE -}) + }) public class TextAreaProxy extends TiViewProxy { public TextAreaProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/TextFieldProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/TextFieldProxy.java index 65b1f153690..b594c7fadbb 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/TextFieldProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/TextFieldProxy.java @@ -6,6 +6,8 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollModule; import org.appcelerator.kroll.annotations.Kroll; @@ -15,7 +17,6 @@ import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUIText; -import android.app.Activity; @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { @@ -46,7 +47,7 @@ TiC.PROPERTY_VERTICAL_ALIGN, TiC.PROPERTY_RETURN_KEY_TYPE, TiC.PROPERTY_PADDING -}) + }) public class TextFieldProxy extends TiViewProxy { public TextFieldProxy() diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/TiDialogProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/TiDialogProxy.java index 0f4b3bf5f88..2fe493d11a0 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/TiDialogProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/TiDialogProxy.java @@ -6,14 +6,14 @@ */ package ti.modules.titanium.ui; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.kroll.common.CurrentActivityListener; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.util.TiUIHelper; -import android.app.Activity; - @Kroll.proxy(parentModule = UIModule.class, propertyAccessors = { "title", @@ -24,7 +24,7 @@ "options", "selectedIndex", "cancel" -}) + }) public abstract class TiDialogProxy extends TiViewProxy { protected boolean showing = false; @@ -38,7 +38,8 @@ public TiDialogProxy() public void show(final KrollDict options) { showing = true; - TiUIHelper.waitForCurrentActivity(new CurrentActivityListener() { + TiUIHelper.waitForCurrentActivity(new CurrentActivityListener() + { @Override public void onCurrentActivityReady(Activity activity) { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/ToolbarProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/ToolbarProxy.java index ec1cd8a6912..0599bdf2f09 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/ToolbarProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/ToolbarProxy.java @@ -1,13 +1,16 @@ package ti.modules.titanium.ui; import android.app.Activity; -import androidx.appcompat.widget.Toolbar; import android.view.View; + +import androidx.appcompat.widget.Toolbar; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiToolbarProxy; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiUIView; + import ti.modules.titanium.ui.widget.TiToolbar; @Kroll.proxy(creatableInModule = UIModule.class, @@ -26,7 +29,7 @@ TiC.PROPERTY_SUBTITLE_TEXT_COLOR, TiC.PROPERTY_CONTENT_INSET_END_WITH_ACTIONS, TiC.PROPERTY_CONTENT_INSET_START_WITH_NAVIGATION -}) + }) public class ToolbarProxy extends TiToolbarProxy { private static final java.lang.String TAG = "Toolbar"; @@ -53,6 +56,7 @@ public TiUIView createView(Activity activity) /** * Sets the activity this proxy's view should be attached to. + * * @param activity The activity this proxy's view should be attached to. */ @Override diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/WebViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/WebViewProxy.java index 8be6063b52b..d0506b36a19 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/WebViewProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/WebViewProxy.java @@ -56,28 +56,25 @@ TiC.PROPERTY_LIGHT_TOUCH_ENABLED, TiC.PROPERTY_ON_LINK, TiC.PROPERTY_SCROLLBARS -}) + }) + public class WebViewProxy extends ViewProxy implements Handler.Callback, OnLifecycleEvent, interceptOnBackPressedEvent { + public static final String OPTIONS_IN_SETHTML = "optionsInSetHtml"; private static final String TAG = "WebViewProxy"; private static final int MSG_FIRST_ID = ViewProxy.MSG_LAST_ID + 1; - + protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; private static final int MSG_GO_BACK = MSG_FIRST_ID + 101; private static final int MSG_GO_FORWARD = MSG_FIRST_ID + 102; private static final int MSG_RELOAD = MSG_FIRST_ID + 103; private static final int MSG_STOP_LOADING = MSG_FIRST_ID + 104; private static final int MSG_RELEASE = MSG_FIRST_ID + 110; - - protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; + private static final Map fevalJSRequests = new HashMap<>(); + private static final int frequestID = 0; private static String fusername; private static String fpassword; - private static int frequestID = 0; - private static final Map fevalJSRequests = new HashMap<>(); - - private Message postCreateMessage; PrintManager printManager; - - public static final String OPTIONS_IN_SETHTML = "optionsInSetHtml"; + private Message postCreateMessage; public WebViewProxy() { @@ -89,6 +86,15 @@ public WebViewProxy() defaultValues.put(TiC.PROPERTY_ZOOM_LEVEL, 1.0); } + private static void sendPostCreateMessage(WebView view, Message postCreateMessage) + { + WebView.WebViewTransport transport = (WebView.WebViewTransport) postCreateMessage.obj; + if (transport != null) { + transport.setWebView(view); + } + postCreateMessage.sendToTarget(); + } + @Override public TiUIView createView(Activity activity) { @@ -131,40 +137,6 @@ public Object evalJS(String code, @Kroll.argument(optional = true) KrollFunction return view.getJSValue(code); } - private static class EvalJSRunnable implements Runnable - { - private final TiUIWebView view; - private final KrollObject krollObject; - private final String code; - private final KrollFunction callback; - - public EvalJSRunnable(TiUIWebView view, KrollObject krollObject, String code, KrollFunction callback) - { - this.view = view; - this.krollObject = krollObject; - this.code = code; - this.callback = callback; - } - - public void run() - { - // Runs the "old" API we built - String result = view.getJSValue(code); - callback.callAsync(krollObject, new Object[] { result }); - } - - public void runAsync() - { - // Runs the newer API provided by Android - view.getWebView().evaluateJavascript(code, new ValueCallback() { - public void onReceiveValue(String value) - { - callback.callAsync(krollObject, new Object[] { value }); - } - }); - } - } - @Kroll.getProperty public String getHtml() { @@ -243,6 +215,16 @@ public void setBasicAuthentication(String username, String password) getWebView().setBasicAuthentication(username, password); } + @Kroll.getProperty + public String getUserAgent() + { + TiUIWebView currWebView = getWebView(); + if (currWebView != null) { + return currWebView.getUserAgentString(); + } + return ""; + } + @Kroll.setProperty public void setUserAgent(String userAgent) { @@ -253,13 +235,13 @@ public void setUserAgent(String userAgent) } @Kroll.getProperty - public String getUserAgent() + public HashMap getRequestHeaders() { TiUIWebView currWebView = getWebView(); if (currWebView != null) { - return currWebView.getUserAgentString(); + return currWebView.getRequestHeaders(); } - return ""; + return new HashMap(); } @Kroll.setProperty @@ -273,16 +255,6 @@ public void setRequestHeaders(HashMap params) } } - @Kroll.getProperty - public HashMap getRequestHeaders() - { - TiUIWebView currWebView = getWebView(); - if (currWebView != null) { - return currWebView.getRequestHeaders(); - } - return new HashMap(); - } - @Kroll.method public boolean canGoBack() { @@ -432,9 +404,17 @@ public int getPluginState() } @Kroll.setProperty - public void setDisableContextMenu(boolean disableContextMenu) + public void setPluginState(int pluginState) { - setPropertyAndFire(TiC.PROPERTY_DISABLE_CONTEXT_MENU, disableContextMenu); + switch (pluginState) { + case TiUIWebView.PLUGIN_STATE_OFF: + case TiUIWebView.PLUGIN_STATE_ON: + case TiUIWebView.PLUGIN_STATE_ON_DEMAND: + setPropertyAndFire(TiC.PROPERTY_PLUGIN_STATE, pluginState); + break; + default: + setPropertyAndFire(TiC.PROPERTY_PLUGIN_STATE, TiUIWebView.PLUGIN_STATE_OFF); + } } @Kroll.getProperty @@ -447,17 +427,9 @@ public boolean getDisableContextMenu() } @Kroll.setProperty - public void setPluginState(int pluginState) + public void setDisableContextMenu(boolean disableContextMenu) { - switch (pluginState) { - case TiUIWebView.PLUGIN_STATE_OFF: - case TiUIWebView.PLUGIN_STATE_ON: - case TiUIWebView.PLUGIN_STATE_ON_DEMAND: - setPropertyAndFire(TiC.PROPERTY_PLUGIN_STATE, pluginState); - break; - default: - setPropertyAndFire(TiC.PROPERTY_PLUGIN_STATE, TiUIWebView.PLUGIN_STATE_OFF); - } + setPropertyAndFire(TiC.PROPERTY_DISABLE_CONTEXT_MENU, disableContextMenu); } @Kroll.method @@ -476,12 +448,6 @@ public void resume() } } - @Kroll.setProperty(runOnUiThread = true) - public void setEnableZoomControls(boolean enabled) - { - setPropertyAndFire(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS, enabled); - } - @Kroll.getProperty public boolean getEnableZoomControls() { @@ -493,6 +459,12 @@ public boolean getEnableZoomControls() return enabled; } + @Kroll.setProperty(runOnUiThread = true) + public void setEnableZoomControls(boolean enabled) + { + setPropertyAndFire(TiC.PROPERTY_ENABLE_ZOOM_CONTROLS, enabled); + } + @Kroll.getProperty public float getZoomLevel() { @@ -517,12 +489,6 @@ public void setZoomLevel(float value) } } - @Kroll.setProperty - public void setAllowFileAccess(boolean enabled) - { - setPropertyAndFire(TiC.PROPERTY_ALLOW_FILE_ACCESS, enabled); - } - @Kroll.getProperty public boolean getAllowFileAccess() { @@ -534,6 +500,12 @@ public boolean getAllowFileAccess() return enabled; } + @Kroll.setProperty + public void setAllowFileAccess(boolean enabled) + { + setPropertyAndFire(TiC.PROPERTY_ALLOW_FILE_ACCESS, enabled); + } + @Kroll.getProperty public double getProgress() { @@ -570,15 +542,6 @@ public void setPostCreateMessage(Message postCreateMessage) } } - private static void sendPostCreateMessage(WebView view, Message postCreateMessage) - { - WebView.WebViewTransport transport = (WebView.WebViewTransport) postCreateMessage.obj; - if (transport != null) { - transport.setWebView(view); - } - postCreateMessage.sendToTarget(); - } - /** * Don't release the web view when it's removed. TIMOB-7808 */ @@ -656,4 +619,39 @@ public String getApiName() { return "Ti.UI.WebView"; } + + private static class EvalJSRunnable implements Runnable + { + private final TiUIWebView view; + private final KrollObject krollObject; + private final String code; + private final KrollFunction callback; + + public EvalJSRunnable(TiUIWebView view, KrollObject krollObject, String code, KrollFunction callback) + { + this.view = view; + this.krollObject = krollObject; + this.code = code; + this.callback = callback; + } + + public void run() + { + // Runs the "old" API we built + String result = view.getJSValue(code); + callback.callAsync(krollObject, new Object[] { result }); + } + + public void runAsync() + { + // Runs the newer API provided by Android + view.getWebView().evaluateJavascript(code, new ValueCallback() + { + public void onReceiveValue(String value) + { + callback.callAsync(krollObject, new Object[] { value }); + } + }); + } + } } diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/WindowProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/WindowProxy.java index 02d2eaafcaa..73dbe8f5f67 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/WindowProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/WindowProxy.java @@ -7,30 +7,6 @@ package ti.modules.titanium.ui; -import java.lang.ref.WeakReference; -import java.util.HashMap; - -import org.appcelerator.kroll.KrollDict; -import org.appcelerator.kroll.KrollPromise; -import org.appcelerator.kroll.annotations.Kroll; -import org.appcelerator.kroll.common.Log; -import org.appcelerator.titanium.TiActivity; -import org.appcelerator.titanium.TiActivityWindow; -import org.appcelerator.titanium.TiActivityWindows; -import org.appcelerator.titanium.TiApplication; -import org.appcelerator.titanium.TiBaseActivity; -import org.appcelerator.titanium.TiC; -import org.appcelerator.titanium.TiDimension; -import org.appcelerator.titanium.TiRootActivity; -import org.appcelerator.titanium.TiTranslucentActivity; -import org.appcelerator.titanium.proxy.ActivityProxy; -import org.appcelerator.titanium.proxy.TiWindowProxy; -import org.appcelerator.titanium.util.TiColorHelper; -import org.appcelerator.titanium.util.TiConvert; -import org.appcelerator.titanium.util.TiRHelper; -import org.appcelerator.titanium.view.TiUIView; -import ti.modules.titanium.ui.widget.TiView; - import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; @@ -40,12 +16,6 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Message; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; - import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; @@ -63,23 +33,53 @@ import android.view.ViewGroup.LayoutParams; import android.view.Window; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import org.appcelerator.kroll.KrollDict; +import org.appcelerator.kroll.KrollPromise; +import org.appcelerator.kroll.annotations.Kroll; +import org.appcelerator.kroll.common.Log; +import org.appcelerator.titanium.TiActivity; +import org.appcelerator.titanium.TiActivityWindow; +import org.appcelerator.titanium.TiActivityWindows; +import org.appcelerator.titanium.TiApplication; +import org.appcelerator.titanium.TiBaseActivity; +import org.appcelerator.titanium.TiC; +import org.appcelerator.titanium.TiDimension; +import org.appcelerator.titanium.TiRootActivity; +import org.appcelerator.titanium.TiTranslucentActivity; +import org.appcelerator.titanium.proxy.ActivityProxy; +import org.appcelerator.titanium.proxy.TiWindowProxy; +import org.appcelerator.titanium.util.TiColorHelper; +import org.appcelerator.titanium.util.TiConvert; +import org.appcelerator.titanium.util.TiRHelper; +import org.appcelerator.titanium.view.TiUIView; + +import java.lang.ref.WeakReference; +import java.util.HashMap; + +import ti.modules.titanium.ui.widget.TiView; + @Kroll.proxy(creatableInModule = UIModule.class, propertyAccessors = { TiC.PROPERTY_MODAL, TiC.PROPERTY_WINDOW_PIXEL_FORMAT, TiC.PROPERTY_FLAG_SECURE, TiC.PROPERTY_BAR_COLOR -}) + }) public class WindowProxy extends TiWindowProxy implements TiActivityWindow { private static final String TAG = "WindowProxy"; private static final String PROPERTY_POST_WINDOW_CREATED = "postWindowCreated"; private static final int MSG_FIRST_ID = TiWindowProxy.MSG_LAST_ID + 1; + protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; private static final int MSG_SET_PIXEL_FORMAT = MSG_FIRST_ID + 100; private static final int MSG_SET_TITLE = MSG_FIRST_ID + 101; - protected static final int MSG_LAST_ID = MSG_FIRST_ID + 999; - private static int id_toolbar; private int barColor = -1; @@ -156,7 +156,7 @@ protected void handleOpen(KrollDict options) topActivity.startActivity(intent); topActivity.overridePendingTransition(0, 0); } else if (options.containsKey(TiC.PROPERTY_ACTIVITY_ENTER_ANIMATION) - || options.containsKey(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION)) { + || options.containsKey(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION)) { topActivity.startActivity(intent); int enterAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_ENTER_ANIMATION), 0); int exitAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION), 0); @@ -211,7 +211,7 @@ protected void handleClose(@NonNull KrollDict options) if (!animated) { activity.overridePendingTransition(0, 0); } else if (options.containsKey(TiC.PROPERTY_ACTIVITY_ENTER_ANIMATION) - || options.containsKey(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION)) { + || options.containsKey(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION)) { int enterAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_ENTER_ANIMATION), 0); int exitAnimation = TiConvert.toInt(options.get(TiC.PROPERTY_ACTIVITY_EXIT_ANIMATION), 0); activity.overridePendingTransition(enterAnimation, exitAnimation); @@ -397,7 +397,7 @@ protected void fillIntent(Activity activity, Intent intent) } if (hasProperty(TiC.PROPERTY_WINDOW_PIXEL_FORMAT)) { intent.putExtra(TiC.PROPERTY_WINDOW_PIXEL_FORMAT, - TiConvert.toInt(getProperty(TiC.PROPERTY_WINDOW_PIXEL_FORMAT), PixelFormat.UNKNOWN)); + TiConvert.toInt(getProperty(TiC.PROPERTY_WINDOW_PIXEL_FORMAT), PixelFormat.UNKNOWN)); } // Set the splitActionBar property @@ -418,7 +418,7 @@ public void onPropertyChanged(String name, Object value) } else if (TiC.PROPERTY_TITLE.equals(name)) { getMainHandler().obtainMessage(MSG_SET_TITLE, value).sendToTarget(); } else if (TiC.PROPERTY_TOP.equals(name) || TiC.PROPERTY_BOTTOM.equals(name) - || TiC.PROPERTY_LEFT.equals(name) || TiC.PROPERTY_RIGHT.equals(name)) { + || TiC.PROPERTY_LEFT.equals(name) || TiC.PROPERTY_RIGHT.equals(name)) { // The "top", "bottom", "left" and "right" properties do not work for heavyweight windows. return; } else if (TiC.PROPERTY_HIDES_BACK_BUTTON.equals(name)) { @@ -465,6 +465,12 @@ public void onPropertyChanged(String name, Object value) super.onPropertyChanged(name, value); } + @Kroll.getProperty + public boolean getSustainedPerformanceMode() + { + return TiConvert.toBoolean(getProperty(TiC.PROPERTY_SUSTAINED_PERFORMANCE_MODE), false); + } + @Kroll.setProperty public void setSustainedPerformanceMode(boolean mode) { @@ -475,12 +481,6 @@ public void setSustainedPerformanceMode(boolean mode) } } - @Kroll.getProperty - public boolean getSustainedPerformanceMode() - { - return TiConvert.toBoolean(getProperty(TiC.PROPERTY_SUSTAINED_PERFORMANCE_MODE), false); - } - @Override @Kroll.setProperty(retain = false) public void setWidth(Object width) @@ -518,7 +518,7 @@ public boolean handleMessage(Message msg) if (activity != null) { Window win = activity.getWindow(); if (win != null) { - win.setFormat(TiConvert.toInt((Object) (msg.obj), PixelFormat.UNKNOWN)); + win.setFormat(TiConvert.toInt(msg.obj, PixelFormat.UNKNOWN)); win.getDecorView().invalidate(); } } @@ -527,21 +527,21 @@ public boolean handleMessage(Message msg) case MSG_SET_TITLE: { Activity activity = getWindowActivity(); if (activity != null) { - activity.setTitle(TiConvert.toString((Object) (msg.obj), "")); + activity.setTitle(TiConvert.toString(msg.obj, "")); if (windowActivity != null && windowActivity.get() != null && windowActivity.get().getSupportActionBar() != null) { ActionBar actionBar = windowActivity.get().getSupportActionBar(); if (actionBar.getTitle() instanceof SpannableStringBuilder) { SpannableStringBuilder stringBuilder = - new SpannableStringBuilder(TiConvert.toString((Object) (msg.obj), "")); + new SpannableStringBuilder(TiConvert.toString(msg.obj, "")); if (barColor != -1) { stringBuilder.setSpan(new ForegroundColorSpan(barColor), 0, stringBuilder.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE); } actionBar.setTitle(stringBuilder); } else { - actionBar.setTitle(TiConvert.toString((Object) (msg.obj), "")); + actionBar.setTitle(TiConvert.toString(msg.obj, "")); } } } @@ -581,7 +581,8 @@ private void setWindowWidthHeight(Object width, Object height) /** * Helper method to apply activity transitions. - * @param win The window holding the activity. + * + * @param win The window holding the activity. * @param props The property dictionary. */ private void applyActivityTransitions(Window win, KrollDict props) @@ -627,8 +628,9 @@ private void applyActivityTransitions(Window win, KrollDict props) /** * Creates a transition for the supplied transition type. + * * @param props The property dictionary. - * @param key The transition type + * @param key The transition type * @return A Transition or null if UIModule.TRANSITION_NONE or unknown transition is specified. */ @SuppressLint({ "InlinedApi", "RtlHardcoded" }) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/android/CardViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/android/CardViewProxy.java index caf6767d816..e1c2db91a01 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/android/CardViewProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/android/CardViewProxy.java @@ -6,13 +6,14 @@ */ package ti.modules.titanium.ui.android; +import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.TiUICardView; -import android.app.Activity; @Kroll.proxy(creatableInModule = AndroidModule.class, propertyAccessors = { @@ -26,7 +27,7 @@ TiC.PROPERTY_PADDING_LEFT, TiC.PROPERTY_PADDING_RIGHT, TiC.PROPERTY_PADDING_TOP -}) + }) public class CardViewProxy extends TiViewProxy { private static final int MSG_FIRST_ID = TiViewProxy.MSG_LAST_ID + 1; diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/android/ProgressIndicatorProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/android/ProgressIndicatorProxy.java index d5f26372070..f596f29d3c3 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/android/ProgressIndicatorProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/android/ProgressIndicatorProxy.java @@ -6,6 +6,8 @@ */ package ti.modules.titanium.ui.android; +import android.app.Activity; + import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; @@ -13,7 +15,6 @@ import ti.modules.titanium.ui.TiDialogProxy; import ti.modules.titanium.ui.widget.TiUIProgressIndicator; -import android.app.Activity; @Kroll.proxy(creatableInModule = AndroidModule.class, propertyAccessors = { @@ -26,7 +27,7 @@ TiC.PROPERTY_MAX, TiC.PROPERTY_CANCELABLE, TiC.PROPERTY_CANCELED_ON_TOUCH_OUTSIDE -}) + }) @Kroll.dynamicApis(methods = { "hide", "show" }) public class ProgressIndicatorProxy extends TiDialogProxy { diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/android/SearchViewProxy.java b/android/modules/ui/src/java/ti/modules/titanium/ui/android/SearchViewProxy.java index b8fbd13c8d6..d120d62e76d 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/android/SearchViewProxy.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/android/SearchViewProxy.java @@ -6,13 +6,14 @@ */ package ti.modules.titanium.ui.android; +import android.app.Activity; + import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.proxy.TiViewProxy; import org.appcelerator.titanium.view.TiUIView; import ti.modules.titanium.ui.widget.searchview.TiUISearchView; -import android.app.Activity; @Kroll.proxy(creatableInModule = AndroidModule.class, propertyAccessors = { @@ -22,7 +23,7 @@ TiC.PROPERTY_HINT_TEXT, TiC.PROPERTY_HINT_TEXT_COLOR, TiC.PROPERTY_VALUE -}) + }) public class SearchViewProxy extends TiViewProxy { private static final String TAG = "SearchProxy"; diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java index 729549b64ad..cc18e9b3e95 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIOptionBar.java @@ -7,6 +7,7 @@ package ti.modules.titanium.ui.widget; import android.content.Context; +import android.content.res.ColorStateList; import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; @@ -207,6 +208,58 @@ private void addButton(String title, String accessibilityLabel, Drawable imageDr MaterialButton button = new MaterialButton(context, null, attributeId); button.setEnabled(isEnabled); button.setText(title); + if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_SELECTED_BACKGROUND_COLOR)) { + ColorStateList oldColors = button.getBackgroundTintList(); + int col = TiConvert.toColor((String) proxy.getProperty(TiC.PROPERTY_SELECTED_BACKGROUND_COLOR), context); + ColorStateList trackStates = new ColorStateList( + new int[][] { + new int[] { -android.R.attr.state_checked }, + new int[] { android.R.attr.state_checked }, + }, + new int[] { + oldColors.getColorForState(new int[] { -android.R.attr.state_checked }, R.attr.colorOnSurface), + col + } + ); + button.setBackgroundTintList(trackStates); + } + if (proxy.hasPropertyAndNotNull("selectedBorderColor")) { + ColorStateList oldColors = button.getStrokeColor(); + int col = TiConvert.toColor((String) proxy.getProperty("selectedBorderColor"), context); + ColorStateList trackStates = new ColorStateList( + new int[][] { + new int[] { -android.R.attr.state_checked }, + new int[] { android.R.attr.state_checked }, + }, + new int[] { + oldColors.getColorForState(new int[] { -android.R.attr.state_checked }, R.attr.colorOnSurface), + col + } + ); + button.setStrokeColor(trackStates); + } + if (proxy.hasPropertyAndNotNull("selectedTextColor") || proxy.hasPropertyAndNotNull(TiC.PROPERTY_COLOR)) { + int textCol = button.getCurrentHintTextColor(); + int selCol = button.getCurrentTextColor(); + + if (proxy.hasPropertyAndNotNull("selectedTextColor")) { + selCol = TiConvert.toColor((String) proxy.getProperty("selectedTextColor"), context); + } + if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_COLOR)) { + textCol = TiConvert.toColor((String) proxy.getProperty(TiC.PROPERTY_COLOR), context); + } + ColorStateList trackStates = new ColorStateList( + new int[][] { + new int[] { -android.R.attr.state_checked }, + new int[] { android.R.attr.state_checked }, + }, + new int[] { + textCol, + selCol, + } + ); + button.setTextColor(trackStates); + } if ((accessibilityLabel != null) && !accessibilityLabel.isEmpty()) { button.setContentDescription(accessibilityLabel); } diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java index 0486e21cd6e..8ca71d59e4b 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUITabbedBar.java @@ -10,6 +10,7 @@ import android.content.Context; import android.content.res.Configuration; import android.graphics.Color; +import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.view.MenuItem; import androidx.annotation.ColorInt; @@ -133,9 +134,11 @@ protected void onLayout(boolean changed, int l, int t, int r, int b) // no selected color specified but a text color -> use that selectedTextColor = textColor; } - this.tabLayout.setTabTextColors(textColor, selectedTextColor); } + if (getProxy().hasPropertyAndNotNull(TiC.PROPERTY_ACTIVE_TINT_COLOR)) { + setTintColor(this.tabLayout.getTabAt(0), TiC.PROPERTY_ACTIVE_TINT_COLOR); + } setNativeView(this.tabLayout); } @@ -261,6 +264,10 @@ private void addItem(Object value) if (value instanceof Drawable) { tab.setIcon(((Drawable) value)); TiUITabLayoutTabGroup.scaleIconToFit(tab); + + if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_TINT_COLOR)) { + setTintColor(tab, TiC.PROPERTY_TINT_COLOR); + } } else { tab.setText(value.toString()); } @@ -282,6 +289,14 @@ private void addItem(Object value) } } + private void setTintColor(TabLayout.Tab tab, String color) + { + if (tab != null && tab.getIcon() != null) { + tab.getIcon().setColorFilter(TiConvert.toColor(proxy.getProperty(color), + TiApplication.getAppCurrentActivity()), PorterDuff.Mode.SRC_IN); + } + } + // Handle switching styles after creation public void setNewStyle(int newStyle) { @@ -394,6 +409,10 @@ private void onTabIndexChangedTo(int index) // First, update the proxy's "index" property. proxy.setProperty(TiC.PROPERTY_INDEX, index); + if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_ACTIVE_TINT_COLOR)) { + setTintColor(this.tabLayout.getTabAt(index), TiC.PROPERTY_ACTIVE_TINT_COLOR); + } + // Last, fire a "click" event. if (!skipClickEvent) { KrollDict data = new KrollDict(); @@ -406,7 +425,10 @@ private void onTabIndexChangedTo(int index) @Override public void onTabUnselected(TabLayout.Tab tab) { - // No override + // set old tint color again + if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_TINT_COLOR)) { + setTintColor(tab, TiC.PROPERTY_TINT_COLOR); + } } @Override diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java index f63c4790757..1ead9f66615 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java @@ -501,6 +501,7 @@ public void updateTabIcon(int index) final Drawable drawable = TiUIHelper.getResourceDrawable(tabProxy.getProperty(TiC.PROPERTY_ICON)); this.mBottomNavigationView.getMenu().getItem(index).setIcon(drawable); + updateIconTint(); } @Override diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java index 4023d321162..a4d35f234a3 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUITabLayoutTabGroup.java @@ -361,6 +361,7 @@ public void updateTabIcon(int index) TabLayout.Tab tab = this.mTabLayout.getTabAt(index); tab.setIcon(TiUIHelper.getResourceDrawable(tabProxy.getProperty(TiC.PROPERTY_ICON))); scaleIconToFit(tab); + updateIconTint(); } @Override diff --git a/android/package.json b/android/package.json index ad6f5134f67..cb890f2d580 100644 --- a/android/package.json +++ b/android/package.json @@ -20,9 +20,9 @@ "compileSDKVersion": "33", "vendorDependencies": { "android sdk": ">=23.x <=34.x", - "android build tools": ">=30.0.2 <=33.x", + "android build tools": ">=30.0.2 <=34.x", "android platform tools": "33.x", - "android tools": "<=26.x", + "android tools": "<=34.x", "android ndk": ">=r21 <=r22b", "java": ">=11.x" }, diff --git a/android/runtime/v8/src/native/CMakeLists.txt b/android/runtime/v8/src/native/CMakeLists.txt index fb6fdb9953a..4c363604f1b 100644 --- a/android/runtime/v8/src/native/CMakeLists.txt +++ b/android/runtime/v8/src/native/CMakeLists.txt @@ -5,7 +5,7 @@ # Please see the LICENSE included with this distribution for details. ################################################################################ -cmake_minimum_required(VERSION 3.10.2) +cmake_minimum_required(VERSION 3.22.1) # Set project/library name and have it use the C++ compiler. # Note: Built library will be named "lib${PROJECT_NAME}.so". diff --git a/android/templates/build/app.build.gradle b/android/templates/build/app.build.gradle index 4a1607f99fc..44f859dfa54 100644 --- a/android/templates/build/app.build.gradle +++ b/android/templates/build/app.build.gradle @@ -62,6 +62,7 @@ android { storePassword tiKeystorePassword keyAlias tiKeystoreAliasName keyPassword tiKeystoreAliasPassword + enableV3Signing true } } buildTypes { diff --git a/android/titanium/build.gradle b/android/titanium/build.gradle index 0b6596266cb..160a9417a4d 100644 --- a/android/titanium/build.gradle +++ b/android/titanium/build.gradle @@ -44,7 +44,7 @@ android { compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionName tiBuildVersionString versionCode tiBuildVersionCode buildConfigField('int', 'VERSION_CODE', tiBuildVersionCode.toString()) @@ -74,7 +74,7 @@ android { } externalNativeBuild { cmake { - version '3.10.2' + version '3.22.1' path "${projectDir}/../runtime/v8/src/native/CMakeLists.txt" } } diff --git a/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java b/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java index 988e87c6746..e49244cc65c 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java +++ b/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java @@ -7,14 +7,17 @@ package org.appcelerator.titanium.proxy; import android.graphics.drawable.Drawable; + import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; + import org.appcelerator.kroll.KrollProxy; import org.appcelerator.kroll.annotations.Kroll; import org.appcelerator.kroll.common.Log; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.util.TiConvert; import org.appcelerator.titanium.util.TiUIHelper; +import org.appcelerator.titanium.view.TiDrawableReference; @SuppressWarnings("deprecation") @Kroll.proxy(propertyAccessors = { TiC.PROPERTY_ON_HOME_ICON_ITEM_SELECTED, TiC.PROPERTY_CUSTOM_VIEW }) @@ -23,7 +26,7 @@ public class ActionBarProxy extends KrollProxy private static final String TAG = "ActionBarProxy"; private static final String ACTION_BAR_NOT_AVAILABLE_MESSAGE = "ActionBar is not enabled"; - private ActionBar actionBar; + private final ActionBar actionBar; private boolean showTitleEnabled = true; public ActionBarProxy(AppCompatActivity activity) @@ -33,7 +36,7 @@ public ActionBarProxy(AppCompatActivity activity) // Guard against calls to ActionBar made before inflating the ActionBarView if (actionBar != null) { actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_HOME - | ActionBar.DISPLAY_SHOW_TITLE); + | ActionBar.DISPLAY_SHOW_TITLE); } else { Log.w(TAG, "Trying to get a reference to ActionBar before its container was inflated."); } @@ -76,16 +79,6 @@ public void setHomeButtonEnabled(boolean homeButtonEnabled) } } - @Kroll.setProperty - public void setNavigationMode(int navigationMode) - { - if (actionBar != null) { - actionBar.setNavigationMode(navigationMode); - } else { - Log.w(TAG, ACTION_BAR_NOT_AVAILABLE_MESSAGE); - } - } - @Kroll.setProperty public void setBackgroundImage(String url) { @@ -102,27 +95,17 @@ public void setBackgroundImage(String url) actionBar.setDisplayShowTitleEnabled(showTitleEnabled); actionBar.setBackgroundDrawable(backgroundImage); - } - } - - @Kroll.setProperty - public void setTitle(String title) - { - if (actionBar != null) { - actionBar.setTitle(title); - } else { - Log.w(TAG, ACTION_BAR_NOT_AVAILABLE_MESSAGE); - } - } - - @Kroll.setProperty - public void setSubtitle(String subTitle) - { - if (actionBar != null) { - actionBar.setDisplayShowTitleEnabled(true); - actionBar.setSubtitle(subTitle); } else { - Log.w(TAG, ACTION_BAR_NOT_AVAILABLE_MESSAGE); + // fallback check with TiDrawableReference + TiDrawableReference source = TiDrawableReference.fromUrl(this, url); + if (source.getDrawable() != null) { + actionBar.setDisplayShowTitleEnabled(!showTitleEnabled); + actionBar.setDisplayShowTitleEnabled(showTitleEnabled); + actionBar.setBackgroundDrawable(source.getDrawable()); + } else { + // fail - show error + Log.e(TAG, "Image " + url + " not found"); + } } } @@ -152,6 +135,17 @@ public String getSubtitle() return (String) actionBar.getSubtitle(); } + @Kroll.setProperty + public void setSubtitle(String subTitle) + { + if (actionBar != null) { + actionBar.setDisplayShowTitleEnabled(true); + actionBar.setSubtitle(subTitle); + } else { + Log.w(TAG, ACTION_BAR_NOT_AVAILABLE_MESSAGE); + } + } + @Kroll.getProperty public String getTitle() { @@ -161,13 +155,33 @@ public String getTitle() return (String) actionBar.getTitle(); } + @Kroll.setProperty + public void setTitle(String title) + { + if (actionBar != null) { + actionBar.setTitle(title); + } else { + Log.w(TAG, ACTION_BAR_NOT_AVAILABLE_MESSAGE); + } + } + @Kroll.getProperty public int getNavigationMode() { if (actionBar == null) { return 0; } - return (int) actionBar.getNavigationMode(); + return actionBar.getNavigationMode(); + } + + @Kroll.setProperty + public void setNavigationMode(int navigationMode) + { + if (actionBar != null) { + actionBar.setNavigationMode(navigationMode); + } else { + Log.w(TAG, ACTION_BAR_NOT_AVAILABLE_MESSAGE); + } } @Kroll.method diff --git a/android/titanium/src/java/org/appcelerator/titanium/proxy/TiWindowProxy.java b/android/titanium/src/java/org/appcelerator/titanium/proxy/TiWindowProxy.java index a7546b6ab63..237924bbb95 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/proxy/TiWindowProxy.java +++ b/android/titanium/src/java/org/appcelerator/titanium/proxy/TiWindowProxy.java @@ -51,6 +51,7 @@ TiC.PROPERTY_ON_BACK, TiC.PROPERTY_TITLE, TiC.PROPERTY_TITLEID, + TiC.PROPERTY_TITLE_ATTRIBUTES, TiC.PROPERTY_WINDOW_SOFT_INPUT_MODE }) public abstract class TiWindowProxy extends TiViewProxy diff --git a/android/titanium/src/java/org/appcelerator/titanium/util/TiNinePatchHelper.java b/android/titanium/src/java/org/appcelerator/titanium/util/TiNinePatchHelper.java index 652820f4b8c..0509e6ef62c 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/util/TiNinePatchHelper.java +++ b/android/titanium/src/java/org/appcelerator/titanium/util/TiNinePatchHelper.java @@ -6,8 +6,6 @@ */ package org.appcelerator.titanium.util; -import java.util.ArrayList; - import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Rect; @@ -15,15 +13,11 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.NinePatchDrawable; +import java.util.ArrayList; + @SuppressWarnings("deprecation") public class TiNinePatchHelper { - private static class SegmentColor - { - int index; - int color; - } - public Drawable process(Drawable d) { Drawable nd = d; @@ -199,8 +193,8 @@ byte[] createChunk(Bitmap b) numColors = colors.size(); // Figure out the size / looks like padded to 32bits. - int size = 32 + // wasDeserialized, numXDivs, numYDivs, numColors, padLeft, padRight, padTop, padBottom - numXDivs * 32 + numYDivs * 32 + numColors * 32; + int size = 32 // wasDeserialized, numXDivs, numYDivs, numColors, padLeft, padRight, padTop, padBottom + + numXDivs * 32 + numYDivs * 32 + numColors * 32; chunk = new byte[size]; chunk[0] = 0; @@ -245,4 +239,10 @@ private void toBytes(byte[] a, int offset, int v) a[offset + 2] = (byte) ((0x00FF0000 & v) >> 16); a[offset + 3] = (byte) ((0xFF000000 & v) >> 24); } + + private static class SegmentColor + { + int index; + int color; + } } diff --git a/android/titanium/src/java/ti/modules/titanium/BufferProxy.java b/android/titanium/src/java/ti/modules/titanium/BufferProxy.java index a0422f7dcbb..1825b2082df 100644 --- a/android/titanium/src/java/ti/modules/titanium/BufferProxy.java +++ b/android/titanium/src/java/ti/modules/titanium/BufferProxy.java @@ -6,9 +6,6 @@ */ package ti.modules.titanium; -import java.io.UnsupportedEncodingException; -import java.util.Arrays; - import org.appcelerator.kroll.KrollDict; import org.appcelerator.kroll.KrollModule; import org.appcelerator.kroll.KrollProxy; @@ -18,6 +15,9 @@ import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.util.TiConvert; +import java.io.UnsupportedEncodingException; +import java.util.Arrays; + import ti.modules.titanium.codec.CodecModule; /** @@ -28,7 +28,7 @@ TiC.PROPERTY_BYTE_ORDER, TiC.PROPERTY_TYPE, TiC.PROPERTY_VALUE -}) + }) public class BufferProxy extends KrollProxy { private static final String TAG = "BufferProxy"; @@ -170,13 +170,14 @@ protected void validateOffsetAndLength(int offset, int length, int bufferLength) { if (length > offset + bufferLength) { throw new IllegalArgumentException("offset of " + offset + " and length of " + length - + " is larger than the buffer length: " + bufferLength); + + " is larger than the buffer length: " + bufferLength); } } /** * Writes data from sourceBuffer into this. - * @param position the offset position of this buffer. + * + * @param position the offset position of this buffer. * @param sourceBuffer the source buffer to write from. * @param sourceOffset the offset position of the sourceBuffer. * @param sourceLength the length of the sourceBuffer. @@ -372,6 +373,7 @@ public int getLength() /** * Sets the length of this buffer proxy by either growing or shrinking * the allocated buffer space + * * @param length The new length of this buffer proxy in bytes */ @Kroll.setProperty diff --git a/apidoc/Titanium/Android/ActionBar.yml b/apidoc/Titanium/Android/ActionBar.yml index 2450257cbde..db9f36e9bb5 100644 --- a/apidoc/Titanium/Android/ActionBar.yml +++ b/apidoc/Titanium/Android/ActionBar.yml @@ -55,6 +55,15 @@ examples: ``` + + `app/controllers/index.js`: + ``` + function doMenuClick() {} + function openSettings() {} + function doSearch() {} + $.index.open(); + ``` + `app/styles/index.tss`: ``` "MenuItem": { @@ -85,7 +94,7 @@ examples: win.activity.onCreate = () => { const actionBar = win.activity.actionBar; if (actionBar) { - actionBar.backgroundImage = "/bg.png"; + actionBar.backgroundImage = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'bg.png').nativePath; actionBar.title = "New Title"; actionBar.onHomeIconItemSelected = () => { Ti.API.info("Home icon clicked!"); diff --git a/apidoc/Titanium/Calendar/Event.yml b/apidoc/Titanium/Calendar/Event.yml index 51d4831c44a..da4d8cbe140 100644 --- a/apidoc/Titanium/Calendar/Event.yml +++ b/apidoc/Titanium/Calendar/Event.yml @@ -72,7 +72,7 @@ methods: - name: save summary: Saves changes to an event permanently. description: | - This method raises an exception if it is passed an event from another event store. + This method raises an exception if it is passed an event from another calendar. When an event is saved, it is updated in the Calendar database. Any fields you did not modify are updated to reflect the most recent value in the database. If the @@ -94,20 +94,21 @@ methods: since: {android: "7.1.0", iphone: "3.1.0", ipad: "3.1.0"} - name: remove - summary: Removes an event from the event store. + summary: Removes an event from the calendar. description: | - This method raises an exception if it is passed an event from another event store. + This method raises an exception on iOS if an event from another calendar is used. returns: type: Boolean parameters: - name: span summary: | - The span to use. Indicates whether to remove future instances of the event in + iOS-only: The span to use. Indicates whether to remove future instances of the event in the case of a recurring event. type: Number constants: Titanium.Calendar.SPAN_* default: - platforms: [iphone, ipad, macos] + since: {android: "12.4.0", iphone: "3.1.0", ipad: "3.1.0", macos: "9.2.0"} + platforms: [android, iphone, ipad, macos] - name: refresh summary: Updates the event's data with the current information in the Calendar database. diff --git a/apidoc/Titanium/UI/OptionBar.yml b/apidoc/Titanium/UI/OptionBar.yml index 9c6fc680bf1..f96bbe19130 100644 --- a/apidoc/Titanium/UI/OptionBar.yml +++ b/apidoc/Titanium/UI/OptionBar.yml @@ -60,6 +60,30 @@ properties: default: horizontal availability: creation + - name: selectedBackgroundColor + summary: Background color of the selected button + type: [String, Titanium.UI.Color] + platforms: [android] + since: { android: "12.4.0"} + + - name: selectedTextColor + summary: Text color of the selected button + type: [String, Titanium.UI.Color] + platforms: [android] + since: { android: "12.4.0"} + + - name: selectedBorderColor + summary: Border color of the selected button + type: [String, Titanium.UI.Color] + platforms: [android] + since: { android: "12.4.0"} + + - name: color + summary: Text color of the unselected button + type: [String, Titanium.UI.Color] + platforms: [android] + since: { android: "12.4.0"} + examples: - title: Text-Only Buttons example: | diff --git a/apidoc/Titanium/UI/TabbedBar.yml b/apidoc/Titanium/UI/TabbedBar.yml index 0e846c3b578..6857a5eda60 100644 --- a/apidoc/Titanium/UI/TabbedBar.yml +++ b/apidoc/Titanium/UI/TabbedBar.yml @@ -56,6 +56,12 @@ properties: availability: creation platforms: [iphone, ipad, android, macos] since: {iphone: "9.0.0", ipad: "9.0.0", android: "12.0.0"} + - name: activeTintColor + summary: Icon tint color of the selected tab + type: [ String, Titanium.UI.Color ] + availability: creation + platforms: [android] + since: {android: "12.5.0"} - name: style summary: Style of the tabbed bar. description: | @@ -66,7 +72,7 @@ properties: The `BAR` style specifies a more compact style and allows the bar's background color or gradient to show through. - + For Android use [Titanium.UI.TABS_STYLE_DEFAULT](Titanium.UI.TABS_STYLE_DEFAULT) or [Titanium.UI.TABS_STYLE_BOTTOM_NAVIGATION](Titanium.UI.TABS_STYLE_BOTTOM_NAVIGATION) and it is only supported in the creation dictionary of the proxy. diff --git a/build/lib/android/index.js b/build/lib/android/index.js index 5e6a731b2ba..7da8a8faa16 100644 --- a/build/lib/android/index.js +++ b/build/lib/android/index.js @@ -173,7 +173,11 @@ class Android { async function gradlew(args) { await new Promise((resolve, reject) => { - const childProcess = spawn(GRADLEW_FILE_PATH, args, { cwd: TITANIUM_ANDROID_PATH, stdio: 'inherit' }); + const childProcess = spawn(GRADLEW_FILE_PATH, args, { + cwd: TITANIUM_ANDROID_PATH, + shell: process.platform === 'win32', + stdio: 'inherit' + }); childProcess.on('error', reject); childProcess.on('exit', (exitCode) => { if (exitCode === 0) { diff --git a/build/lib/docs.js b/build/lib/docs.js index 6b10a836e11..67e054a4533 100644 --- a/build/lib/docs.js +++ b/build/lib/docs.js @@ -23,7 +23,10 @@ class Documentation { const outputFile = path.join(this.outputDir, filename); return new Promise((resolve, reject) => { - const prc = spawn(cmdPath, args, { cwd: DOC_DIR }); + const prc = spawn(cmdPath, args, { + cwd: DOC_DIR, + shell: process.platform === 'win32' + }); prc.stdout.on('data', data => console.log(data.toString().trim())); prc.stderr.on('data', data => console.error(data.toString().trim())); prc.on('close', code => { diff --git a/package-lock.json b/package-lock.json index 4b577831625..fd968703387 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "titanium-mobile", - "version": "12.4.0", + "version": "12.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "titanium-mobile", - "version": "12.4.0", + "version": "12.5.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -25,7 +25,7 @@ "ejs": "3.1.9", "fields": "0.1.24", "fs-extra": "11.2.0", - "ioslib": "1.7.36", + "ioslib": "1.7.37", "liveview": "1.5.6", "lodash.merge": "4.6.2", "markdown": "0.5.0", @@ -2285,6 +2285,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", @@ -2305,6 +2306,7 @@ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" @@ -2318,6 +2320,7 @@ "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", @@ -2337,6 +2340,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", "dependencies": { "abbrev": "1" }, @@ -2352,6 +2356,7 @@ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", "deprecated": "This package is no longer supported.", + "license": "ISC", "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", @@ -3744,7 +3749,8 @@ "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==" + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "license": "BSD-2-Clause" }, "node_modules/@yarnpkg/parsers": { "version": "3.0.0-rc.41", @@ -5192,7 +5198,8 @@ "node_modules/ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "license": "MIT" }, "node_modules/clang-format": { "version": "1.6.0", @@ -6493,6 +6500,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -7590,6 +7598,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "license": "Apache-2.0", "dependencies": { "micromatch": "^4.0.2" } @@ -8813,9 +8822,10 @@ } }, "node_modules/ioslib": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.36.tgz", - "integrity": "sha512-LxmVa7TrKPXOE2IWxlNyNASTonSLjizxfG1dO8wZwGWowng+9/YBeIbPcQxaFgT8GMGeSMkkK1Npi2XUl7iiVQ==", + "version": "1.7.37", + "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.37.tgz", + "integrity": "sha512-D4SrH3QocN2GBlzSBcv9V1WKpmcOVUk3F6rjHafWXtrAFs7ZrsPtyR0nA4t1ubqjOYwkTZLgMliEUrs5bpfqXQ==", + "license": "Apache-2.0", "dependencies": { "always-tail": "0.2.0", "async": "^3.2.4", @@ -8823,7 +8833,7 @@ "debug": "^4.3.4", "mkdirp": "0.5.1", "node-appc": "1.1.6", - "node-ios-device": "1.12.0" + "node-ios-device": "^1.12.1" }, "engines": { "node": ">=10.13" @@ -8982,6 +8992,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "license": "MIT", "dependencies": { "ci-info": "^2.0.0" }, @@ -9019,6 +9030,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", "bin": { "is-docker": "cli.js" }, @@ -9302,6 +9314,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", "dependencies": { "is-docker": "^2.0.0" }, @@ -9799,6 +9812,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.11" } @@ -11429,7 +11443,8 @@ "node_modules/nan": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", - "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==" + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==", + "license": "MIT" }, "node_modules/nanoid": { "version": "3.3.1", @@ -11694,10 +11709,11 @@ } }, "node_modules/node-ios-device": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/node-ios-device/-/node-ios-device-1.12.0.tgz", - "integrity": "sha512-ewGLYmcW1LbsTqs5UYmlLcm/52GCmGcuFTysWBqWnHPp88PfOh7uVm4zonb9r4MR/Nublt0vt0mNDIum0R71pw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/node-ios-device/-/node-ios-device-1.12.1.tgz", + "integrity": "sha512-qcCfQw5qXek1l4NDuKt19w4gCZK4Sra4AM2PXQrpW5NhhCCl0pGfDKknBNzB0UmVd+lRm5CF5Wvy8c2Nor2jEQ==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.10", "debug": "^4.3.4", @@ -11713,6 +11729,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/node-pre-gyp-init/-/node-pre-gyp-init-1.2.1.tgz", "integrity": "sha512-gbC2fERRmWbJFvj54f4yyiY/O6J1kkLrN7jkwRvzNmgMgPCufZLv76l2luzWjj+Ge0xQF6zDalZ6iIgzCHJ95Q==", + "license": "MIT", "dependencies": { "@mapbox/node-pre-gyp": "^1.0.1" } @@ -12383,6 +12400,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12476,6 +12494,7 @@ "version": "7.4.2", "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "license": "MIT", "dependencies": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" @@ -12864,6 +12883,7 @@ "version": "6.5.1", "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.5.1.tgz", "integrity": "sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==", + "license": "MIT", "dependencies": { "@yarnpkg/lockfile": "^1.1.0", "chalk": "^4.1.2", @@ -12892,6 +12912,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -12906,6 +12927,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12921,6 +12943,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -12931,12 +12954,14 @@ "node_modules/patch-package/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, "node_modules/patch-package/node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "license": "MIT", "dependencies": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -12952,6 +12977,7 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "license": "MIT", "dependencies": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", @@ -12967,6 +12993,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -12986,6 +13013,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -12994,6 +13022,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -13003,6 +13032,7 @@ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -13014,6 +13044,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", "bin": { "semver": "bin/semver" } @@ -13022,6 +13053,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "license": "MIT", "dependencies": { "shebang-regex": "^1.0.0" }, @@ -13033,6 +13065,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -13041,6 +13074,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -13052,6 +13086,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -14543,6 +14578,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "license": "MIT", "engines": { "node": ">=6" } @@ -22690,9 +22726,9 @@ } }, "ioslib": { - "version": "1.7.36", - "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.36.tgz", - "integrity": "sha512-LxmVa7TrKPXOE2IWxlNyNASTonSLjizxfG1dO8wZwGWowng+9/YBeIbPcQxaFgT8GMGeSMkkK1Npi2XUl7iiVQ==", + "version": "1.7.37", + "resolved": "https://registry.npmjs.org/ioslib/-/ioslib-1.7.37.tgz", + "integrity": "sha512-D4SrH3QocN2GBlzSBcv9V1WKpmcOVUk3F6rjHafWXtrAFs7ZrsPtyR0nA4t1ubqjOYwkTZLgMliEUrs5bpfqXQ==", "requires": { "always-tail": "0.2.0", "async": "^3.2.4", @@ -22700,7 +22736,7 @@ "debug": "^4.3.4", "mkdirp": "0.5.1", "node-appc": "1.1.6", - "node-ios-device": "1.12.0" + "node-ios-device": "^1.12.1" }, "dependencies": { "@xmldom/xmldom": { @@ -24852,9 +24888,9 @@ } }, "node-ios-device": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/node-ios-device/-/node-ios-device-1.12.0.tgz", - "integrity": "sha512-ewGLYmcW1LbsTqs5UYmlLcm/52GCmGcuFTysWBqWnHPp88PfOh7uVm4zonb9r4MR/Nublt0vt0mNDIum0R71pw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/node-ios-device/-/node-ios-device-1.12.1.tgz", + "integrity": "sha512-qcCfQw5qXek1l4NDuKt19w4gCZK4Sra4AM2PXQrpW5NhhCCl0pGfDKknBNzB0UmVd+lRm5CF5Wvy8c2Nor2jEQ==", "requires": { "@mapbox/node-pre-gyp": "^1.0.10", "debug": "^4.3.4", diff --git a/package.json b/package.json index 87fb7f8cfd5..543a66416e7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "titanium-mobile", "description": "Titanium SDK", - "version": "12.4.0", + "version": "12.5.0", "moduleApiVersion": { "iphone": "2", "android": "4" @@ -100,7 +100,7 @@ "ejs": "3.1.9", "fields": "0.1.24", "fs-extra": "11.2.0", - "ioslib": "1.7.36", + "ioslib": "1.7.37", "liveview": "1.5.6", "lodash.merge": "4.6.2", "markdown": "0.5.0",