Skip to content

Commit

Permalink
Merge branch 'master' into androidTintTabbar
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga authored Aug 20, 2024
2 parents a84fa85 + 803bd04 commit 93688aa
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ today and benefit from 1:1 sessions with the core team, exclusive modules, merch

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

<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https://github.com/eddyinet.png" width="60px" alt="" /></a><a href="https://github.com/gouldjw"><img src="https://github.com/gouldjw.png" width="60px" alt="John Gould" /></a><a href="https://github.com/williekwok"><img src="https://github.com/williekwok.png" width="60px" alt="Willie Kwok" /></a><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/Topener"><img src="https://github.com/Topener.png" width="60px" alt="Rene Pot" /></a><a href="https://github.com/phobeous"><img src="https://github.com/phobeous.png" width="60px" alt="Rodrigo Farfán" /></a><a href="https://github.com/jasonkneen"><img src="https://github.com/jasonkneen.png" width="60px" alt="Jason Kneen" /></a><a href="https://github.com/de1mat"><img src="https://github.com/de1mat.png" width="60px" alt="Matt Delmarter" /></a><a href="https://github.com/dlewis23"><img src="https://github.com/dlewis23.png" width="60px" alt="dlewis23" /></a><a href="https://github.com/dethier1958"><img src="https://github.com/dethier1958.png" width="60px" alt="Daniel Ethier" /></a><a href="https://github.com/zenjoe"><img src="https://github.com/zenjoe.png" width="60px" alt="Joe Kniesek" /></a><a href="https://github.com/desarrollogotit"><img src="https://github.com/desarrollogotit.png" width="60px" alt="" /></a><a href="https://github.com/Astrovic"><img src="https://github.com/Astrovic.png" width="60px" alt="Vittorio Sorbera" /></a><a href="https://github.com/Arood"><img src="https://github.com/Arood.png" width="60px" alt="Marcus Olovsson" /></a><a href="https://github.com/Rearmachine"><img src="https://github.com/Rearmachine.png" width="60px" alt="" /></a><a href="https://github.com/alexlarocca"><img src="https://github.com/alexlarocca.png" width="60px" alt="Alessandro La Rocca" /></a><a href="https://github.com/reshopper"><img src="https://github.com/reshopper.png" width="60px" alt="Reshopper" /></a><a href="https://github.com/safadig"><img src="https://github.com/safadig.png" width="60px" alt="Gus" /></a><a href="https://github.com/designbymind"><img src="https://github.com/designbymind.png" width="60px" alt="Jason David Miller" /></a><a href="https://github.com/greatschism"><img src="https://github.com/greatschism.png" width="60px" alt="Michael Zaladonis" /></a><a href="https://github.com/enzoq"><img src="https://github.com/enzoq.png" width="60px" alt="Vincenzo Quacquarelli" /></a><a href="https://github.com/mighty-office"><img src="https://github.com/mighty-office.png" width="60px" alt="Mighty GmbH" /></a><a href="https://github.com/Fruugul"><img src="https://github.com/Fruugul.png" width="60px" alt="Fruugul" /></a><a href="https://github.com/korelogic"><img src="https://github.com/korelogic.png" width="60px" alt="Korelogic Limited" /></a><a href="https://github.com/eddyinet"><img src="https://github.com/eddyinet.png" width="60px" alt="" /></a><a href="https://github.com/gouldjw"><img src="https://github.com/gouldjw.png" width="60px" alt="John Gould" /></a><a href="https://github.com/Yackens"><img src="https://github.com/Yackens.png" width="60px" alt="Joaquin Maroto" /></a><!-- sponsors -->

## Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down Expand Up @@ -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");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion apidoc/Titanium/Android/ActionBar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ examples:
</Alloy>
```
`app/controllers/index.js`:
```
function doMenuClick() {}
function openSettings() {}
function doSearch() {}
$.index.open();
```
`app/styles/index.tss`:
```
"MenuItem": {
Expand Down Expand Up @@ -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!");
Expand Down
6 changes: 5 additions & 1 deletion build/lib/android/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion build/lib/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 93688aa

Please sign in to comment.