Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
TiC.PROPERTY_FLAG_SECURE,
TiC.PROPERTY_BAR_COLOR,
TiC.PROPERTY_STATUS_BAR_COLOR,
TiC.PROPERTY_UI_FLAGS
TiC.PROPERTY_UI_FLAGS,
TiC.PROPERTY_NAV_BAR_COLOR
})

public class WindowProxy extends TiWindowProxy implements TiActivityWindow
Expand Down Expand Up @@ -332,6 +333,12 @@ public void windowCreated(TiBaseActivity activity, Bundle savedInstanceState)
win.setStatusBarColor(colorInt);
}

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

if (hasProperty(TiC.PROPERTY_UI_FLAGS)) {
win.getDecorView().setSystemUiVisibility(TiConvert.toInt(getProperty(TiC.PROPERTY_UI_FLAGS)));
}
Expand Down Expand Up @@ -477,6 +484,14 @@ public void onPropertyChanged(String name, Object value)
}
}

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

if (name.equals(TiC.PROPERTY_UI_FLAGS)) {
if (windowActivity != null && windowActivity.get() != null) {
AppCompatActivity activity = windowActivity.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ public class TiC
public static final String PROPERTY_MULTIPLY = "multiply";
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_NATIVE_SPINNER = "nativeSpinner";
public static final String PROPERTY_NAV_BAR_COLOR = "navBarColor";
public static final String PROPERTY_NAVIGATION_ICON = "navigationIcon";
public static final String PROPERTY_NAVIGATION_ICON_COLOR = "navigationIconColor";
public static final String PROPERTY_NICKNAME = "nickname";
Expand Down
6 changes: 6 additions & 0 deletions apidoc/Titanium/UI/Window.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,12 @@ properties:
platforms: [android]
since: {android: "12.5.0"}

- name: navBarColor
summary: The color of the navigation bar (bottom bar) for this window.
type: [Number]
platforms: [android]
since: {android: "13.1.0"}

- name: sustainedPerformanceMode
summary: Maintain a sustainable level of performance.
description: |
Expand Down
Loading