diff --git a/README.md b/README.md index 1aeaff191fa..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 EthierJoe KniesekVittorio SorberaMarcus OlovssonAlessandro La RoccaReshopperGusJason David MillerMichael ZaladonisVincenzo QuacquarelliMighty GmbHFruugulKorelogic LimitedJohn GouldWillie Kwok +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/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/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java b/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java index 988e87c6746..3d29ce309e2 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java +++ b/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java @@ -15,6 +15,7 @@ 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 }) @@ -102,6 +103,17 @@ public void setBackgroundImage(String url) actionBar.setDisplayShowTitleEnabled(showTitleEnabled); actionBar.setBackgroundDrawable(backgroundImage); + } else { + // 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"); + } } } 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/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/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 => {