Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): collapse toolbar menu support #14093

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f31e0b7
feat(android): add keyboard show/hide event
m1ga Jan 21, 2023
64b4ece
docs
m1ga Jan 21, 2023
a2ee315
use Android version
m1ga Jan 21, 2023
0a9c121
move to app event
m1ga Jan 23, 2023
21dab2a
move to app event
m1ga Jan 23, 2023
89fe70f
size return value
m1ga Jan 23, 2023
88d11b9
check for listener
m1ga Jan 24, 2023
c161d9f
remove extra check, simplify if statement
m1ga Jan 24, 2023
dc213e3
some more null checks for safety
m1ga Jan 24, 2023
ea52729
lint
m1ga Jan 24, 2023
fec7cc7
hasListener check
m1ga Jan 24, 2023
8e75df1
check app listener in safearea
m1ga Feb 6, 2023
0ccd1c8
kotlin 1.8.10, ios logging
Max87ZA May 9, 2023
927899a
feat: add spring animations
hansemannn Aug 1, 2023
9632aa5
Merge branch 'master' into feature/ios17-spring-animations
hansemannn Aug 4, 2023
673b2ab
Merge pull request #1 from tidev/master
Max87ZA Aug 4, 2023
9cfb8f9
(fix):network client fix
Max87ZA Aug 4, 2023
88867b7
network client fix
Max87ZA Aug 4, 2023
86099b6
Merge branch 'master' into kotlin_1810
Max87ZA Aug 9, 2023
dd1c144
Merge pull request #2 from Max87ZA/kotlin_1810
Max87ZA Aug 9, 2023
43d2dc5
feat(ios): largeTitleAttributes
Max87ZA Aug 9, 2023
2fbe62b
feat(ios): largeTitleAttributes
Max87ZA Aug 9, 2023
b012d46
feat(ios): largeTitleAttributes
Max87ZA Aug 9, 2023
ebb3917
fix(ios): removed commented code
Max87ZA Aug 10, 2023
fd3c8d6
Update android/modules/network/src/java/ti/modules/titanium/network/T…
m1ga Sep 22, 2023
9275941
Merge branch 'tidev:master' into master
Max87ZA Oct 29, 2023
ef366cb
Merge branch 'feat(ios)largeTitleAttributes'
Max87ZA Oct 29, 2023
6129990
fix(ios): removed setLargeTitleAttributes duplicity
Max87ZA Oct 29, 2023
cfa58ed
feat(ios): added logging with timestamp
Max87ZA Oct 29, 2023
c84ca1c
feat: support multi-scene applications
hansemannn Oct 31, 2023
13d4e71
feat(ios): largeTitleAttributes added
Max87ZA Nov 1, 2023
10cfeee
Merge remote-tracking branch 'upstream/feature/support-scenes'
Max87ZA Nov 1, 2023
f6e78cc
revert changes from hans
Max87ZA Nov 1, 2023
e3987fd
Merge branch 'master' into 230121_keyboard_hide_event
m1ga Dec 25, 2023
1c19345
Update apidoc/Titanium/App/App.yml
m1ga Dec 25, 2023
a816eed
Update apidoc/Titanium/App/App.yml
m1ga Dec 25, 2023
0bbe7a2
Merge pull request #3 from tidev/master
Max87ZA Apr 26, 2024
f252d02
feat(ios): add timestamp to console's log
May 22, 2024
73bd156
feat(ios): feat(ios): add overrideUserInterfaceStyle to Picker
May 22, 2024
3a344c3
Merge branch 'master' into 230121_keyboard_hide_event
m1ga Jun 10, 2024
bf5695a
Merge branch 'tidev_master'
Jun 10, 2024
3c3512c
Merge branch '230121_keyboard_hide_event'
Jun 10, 2024
48709a1
feat(android): collapse toolbar menu support
Max87ZA Aug 6, 2024
16d7740
build: merge 'tidev/master'
Max87ZA Aug 6, 2024
e5e3f33
feat: add 12.5.0 changelog
hansemannn Aug 27, 2024
b9932b2
Revert "fix(ios): fix unbalanced view controller transitions causing …
hansemannn Sep 10, 2024
91499ef
feat(android): statusBarColor for Window (#14089)
m1ga Sep 13, 2024
d75fc9e
fix(android): textfield padding (#13513)
hansemannn Sep 14, 2024
e577bce
fix(ios): pause returns false (#14114)
AbdullahFaqeir Sep 16, 2024
1d2cdd5
feat(ios): add “interactiveDismissModeEnabled” API (#14103)
hansemannn Sep 16, 2024
694766b
feat(android): more log output (#13999)
m1ga Sep 16, 2024
07f435d
chore(android): forward --sdk in module build process (#14112)
m1ga Sep 14, 2024
2689c1e
feat: add 12.5.0.GA changelog
hansemannn Sep 16, 2024
5f5c296
chore(release): bump version
hansemannn Sep 16, 2024
3012280
fix(android): fix ListView layout with header and footer only (#14117)
m1ga Sep 18, 2024
d4abe90
ListView has empty cells while scrolling up/down (#14119)
prashantsaini1 Sep 22, 2024
15b0eb6
fix: allow ignoreLog to be a single string (#14116)
m1ga Sep 23, 2024
a72b174
fix(build): update ioslib to 1.7.38 to fix incremental builds in Xcod…
hansemannn Sep 24, 2024
edc6163
Android: marker event was only triggered for first and last visible s…
prashantsaini1 Sep 27, 2024
a55e6a8
chore(ios): update compatibility for iOS 18+ and Xcode 16+
hansemannn Sep 28, 2024
a762523
chore: update ioslib to 1.7.39 to support Xcode 16 provisioning profi…
hansemannn Sep 30, 2024
7904769
feat(ios): support multi-scene applications (#13941)""
hansemannn Oct 1, 2024
eefd6a9
Revert "feat(ios): support multi-scene applications (#13941)"""
hansemannn Oct 2, 2024
bd83933
feat(ios): support multi-scene applications (#13941)
hansemannn Jan 12, 2024
8c0210d
fix: cmake fix
Max87ZA Oct 2, 2024
3da1a21
Merge branch '12_5_X_CarPlay'
Max87ZA Oct 2, 2024
98b79c9
feat(android): added uploader and downloader to webview
Max87ZA Jan 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,93 @@
# [12.5.0](https://github.com/tidev/titanium_mobile/compare/12_4_X...12.5.0) (2024-09-16)

## About this release

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

## Community Credits

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

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

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

## Bug Fixes

### Android platform

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

### iOS platform

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

### Multiple platforms

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

## Features

### Multiple platforms

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

### Android platform

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

### iOS platform

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

## BREAKING CHANGES


## SDK Module Versions

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

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

## About this release
Expand Down
4 changes: 3 additions & 1 deletion android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ AndroidModuleBuilder.prototype.migrate = async function migrate() {
const manifestModuleAPIVersion = this.manifest.apiversion;
const manifestTemplateFile = path.join(this.platformPath, 'templates', 'module', 'default', 'template', 'android', 'manifest.ejs');
let newVersion = semver.inc(this.manifest.version, 'major');
this.tiSdkVersion = cliSDKVersion;

// Determine if the "manifest" file's "apiversion" needs updating.
let isApiVersionUpdateRequired = false;
Expand Down Expand Up @@ -873,6 +874,7 @@ AndroidModuleBuilder.prototype.runModule = async function (cli) {
'-u', 'localhost',
'-d', tmpDir,
'-p', 'android',
'--sdk', this.tiSdkVersion,
'--force'
],
this.logger
Expand Down Expand Up @@ -917,7 +919,7 @@ AndroidModuleBuilder.prototype.runModule = async function (cli) {

// Run the temp app.
this.logger.debug(__('Running example project...', tmpDir.cyan));
let buildArgs = [ process.argv[1], 'build', '-p', 'android', '-d', tmpProjectDir ];
let buildArgs = [ process.argv[1], 'build', '-p', 'android', '-d', tmpProjectDir, '--sdk', this.tiSdkVersion ];
if (this.target) {
buildArgs.push('-T');
buildArgs.push(this.target);
Expand Down
6 changes: 5 additions & 1 deletion android/cli/hooks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ exports.init = function (logger, config, cli) {
}

// ignore some Android logs in info log level
if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
if (typeof ignoreLog === 'string') {
if (line.includes(ignoreLog)) {
return;
}
} else if (ignoreLog.some(ignoreItem => line.includes(ignoreItem))) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.appcelerator.kroll.common.Log;
import org.appcelerator.titanium.ITiAppInfo;
import org.appcelerator.titanium.TiApplication;
import org.appcelerator.titanium.TiBaseActivity;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.util.TiConvert;
import org.appcelerator.titanium.util.TiSensorHelper;
Expand Down Expand Up @@ -155,6 +156,16 @@ public boolean getAccessibilityEnabled()
return TiApplication.getInstance().getAccessibilityManager().isEnabled();
}

@Kroll.getProperty
public boolean getKeyboardVisible()
{
TiBaseActivity activity = (TiBaseActivity) TiApplication.getAppCurrentActivity();
if (activity == null) {
return false;
}
return TiConvert.toBoolean(activity.keyboardVisible, false);
}

@Kroll.method(name = "_restart")
public void restart()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
android:id="@+id/collapseToolbarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|snap|exitUntilCollapsed">
app:layout_scrollFlags="scroll|snap|exitUntilCollapsed"
app:titleCentered="true"
app:collapsedTitleGravity="center|center_horizontal">

<ImageView
android:id="@+id/collapseImageView"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false">

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/collapseContent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- main content -->
</org.appcelerator.titanium.view.TiCompositeLayout>

</androidx.core.widget.NestedScrollView>

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- toolbar -->

<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapseToolbarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|snap|exitUntilCollapsed"
app:titleCentered="true"
app:collapsedTitleGravity="center|center_horizontal">

<ImageView
android:id="@+id/collapseImageView"
android:layout_width="match_parent"
android:layout_height="250dp"
android:scaleType="centerCrop"
android:visibility="invisible"
app:layout_collapseMode="parallax" />

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:titleCentered="true"/>

</com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.AppBarLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
23 changes: 14 additions & 9 deletions android/modules/ui/res/layout/titanium_ui_listview_holder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:addStatesFromChildren="true"
app:layout_constraintBottom_toTopOf="@+id/titanium_ui_listview_holder_footer_title"
app:layout_constraintStart_toEndOf="@id/titanium_ui_listview_holder_left_image"
app:layout_constraintTop_toBottomOf="@+id/titanium_ui_listview_holder_header_title" />
app:layout_constraintTop_toBottomOf="@+id/barrierHeader" />

<ImageView
android:id="@+id/titanium_ui_listview_holder_left_image"
Expand All @@ -24,9 +23,9 @@
android:focusableInTouchMode="false"
android:paddingStart="6dp"
android:paddingEnd="0dp"
app:layout_constraintBottom_toTopOf="@id/titanium_ui_listview_holder_footer_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_header_title" />
app:layout_constraintTop_toTopOf="@id/titanium_ui_listview_holder_content"
app:layout_constraintBottom_toBottomOf="@id/titanium_ui_listview_holder_content" />

<ImageView
android:id="@+id/titanium_ui_listview_holder_right_image"
Expand All @@ -35,9 +34,9 @@
android:layout_marginEnd="6dp"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintBottom_toBottomOf="@id/titanium_ui_listview_holder_footer_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_header_title" />
app:layout_constraintTop_toTopOf="@id/titanium_ui_listview_holder_content"
app:layout_constraintBottom_toBottomOf="@id/titanium_ui_listview_holder_content" />

<TextView
android:id="@+id/titanium_ui_listview_holder_header_title"
Expand All @@ -63,10 +62,16 @@
android:minHeight="18dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_content" />

<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrierHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="titanium_ui_listview_holder_header,titanium_ui_listview_holder_header_title" />

<org.appcelerator.titanium.view.TiCompositeLayout
android:id="@+id/titanium_ui_listview_holder_header"
Expand All @@ -84,7 +89,7 @@
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/titanium_ui_listview_holder_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@
TiC.PROPERTY_MODAL,
TiC.PROPERTY_WINDOW_PIXEL_FORMAT,
TiC.PROPERTY_FLAG_SECURE,
TiC.PROPERTY_BAR_COLOR
TiC.PROPERTY_BAR_COLOR,
TiC.PROPERTY_STATUS_BAR_COLOR
})

public class WindowProxy extends TiWindowProxy implements TiActivityWindow
{
private static final String TAG = "WindowProxy";
Expand Down Expand Up @@ -320,6 +322,12 @@ public void windowCreated(TiBaseActivity activity, Bundle savedInstanceState)
}
}

if (hasProperty(TiC.PROPERTY_STATUS_BAR_COLOR)) {
int colorInt = TiColorHelper.parseColor(
TiConvert.toString(getProperty(TiC.PROPERTY_STATUS_BAR_COLOR)), activity);
win.setStatusBarColor(colorInt);
}

// Handle titleAttributes property.
if (hasProperty(TiC.PROPERTY_TITLE_ATTRIBUTES)) {
KrollDict innerAttributes = getProperties().getKrollDict(TiC.PROPERTY_TITLE_ATTRIBUTES);
Expand Down Expand Up @@ -446,6 +454,14 @@ public void onPropertyChanged(String name, Object value)
}
}

if (name.equals(TiC.PROPERTY_STATUS_BAR_COLOR)) {
if (windowActivity != null && windowActivity.get() != null) {
AppCompatActivity activity = windowActivity.get();
int colorInt = TiColorHelper.parseColor(TiConvert.toString(value), activity);
activity.getWindow().setStatusBarColor(colorInt);
}
}

if (name.equals(TiC.PROPERTY_TITLE_ATTRIBUTES)) {
if (windowActivity != null && windowActivity.get() != null) {
// Get a reference to the ActionBar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,29 @@ public void setNavigationIconColor(String value)
{
collapseToolbar.setNavigationIconColor(TiConvert.toColor(value, TiApplication.getAppCurrentActivity()));
}

@Kroll.method
public void addMenuItem(int itemId, String title, boolean showAsAction)
{
// int iconResId = TiDrawableReference.fromObject(this, iconPath).getBitmap(false)
collapseToolbar.addMenuItem(itemId, title, showAsAction);
}

@Kroll.method
public void removeMenuItem(int itemId)
{
collapseToolbar.removeMenuItem(itemId);
}

@Kroll.method
public void clearMenu()
{
collapseToolbar.clearMenu();
}

@Kroll.method
public void setOnMenuItemClickListener(KrollFunction function)
{
collapseToolbar.setOnMenuItemClickListener(function);
}
}
Loading