Skip to content

Commit

Permalink
theme
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Oct 2, 2024
1 parent a89b6cd commit 4978b22
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,20 @@ protected void handleOpen(KrollDict options)
if (topActivity == null || topActivity.isFinishing()) {
return;
}

// set theme for XML layout
if (((Integer) getProperty(TiC.PROPERTY_STYLE)) == AndroidModule.TABS_STYLE_BOTTOM_NAVIGATION
&& getProperty(TiC.PROPERTY_THEME) != null) {
try {
String themeName = getProperty(TiC.PROPERTY_THEME).toString();
int theme = TiRHelper.getResource("style."
+ themeName.replaceAll("[^A-Za-z0-9_]", "_"));
topActivity.setTheme(theme);
topActivity.getApplicationContext().setTheme(theme);
} catch (Exception e) {
}
}

Intent intent = new Intent(topActivity, TiActivity.class);
fillIntent(topActivity, intent);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ public class TiUIBottomNavigation extends TiUIAbstractTabGroup implements Bottom
public TiUIBottomNavigation(TabGroupProxy proxy, TiBaseActivity activity)
{
super(proxy, activity);
if (proxy.getProperty(TiC.PROPERTY_THEME) != null) {
try {
String themeName = proxy.getProperty(TiC.PROPERTY_THEME).toString();
int theme = TiRHelper.getResource("style."
+ themeName.replaceAll("[^A-Za-z0-9_]", "_"));
activity.setTheme(theme);
activity.getApplicationContext().setTheme(theme);
} catch (Exception e) {
}
}
}

// Overriding addTab method to provide a proper guard for trying to add more tabs than the limit
Expand Down

0 comments on commit 4978b22

Please sign in to comment.