Skip to content

Conversation

@theproducer
Copy link
Contributor

@theproducer theproducer commented Jan 6, 2026

fixes: #8294

@theproducer theproducer requested a review from a team January 6, 2026 21:05
@theproducer theproducer marked this pull request as ready for review January 6, 2026 21:06
@theproducer theproducer changed the title fix(android): get correct style on handleOnConfigurationChanged fix(SystemBars): get correct style on handleOnConfigurationChanged Jan 6, 2026
riderx pushed a commit to Cap-go/capacitor-plus that referenced this pull request Jan 7, 2026
Comment on lines 273 to 279
String style = getConfig().getString("style");

if (style == null) {
style = STYLE_DEFAULT;
}

return style;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you changing the getConfig().getString("style", STYLE_DEFAULT) with all this?
This is how the getConfig().getString("style", STYLE_DEFAULT) is supposed to work internally, if getConfig().getString("style") is null it would return the STYLE_DEFAULT as it's the default value passed.

Is it not working as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, sorry, this was just debug stuff that didn't get fully removed.

Comment on lines 283 to 287
if (getConfig().getConfigJSON().has("hidden")) {
return getConfig().getBoolean("hidden", false);
}

return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, why are you replacing the getConfig().getBoolean("hidden", false) with this?

It's supposed to return false if the config doesn't include hidden, so you shouldn't need to check.
If it's not working like that it should be reported and fixed.
If it's working like that, not sure why all this extra code is being added.

@jcesarmobile
Copy link
Member

You removed the getStyleConfig() method, so the code no longer compiles, maybe make it getConfig().getString("style", STYLE_DEFAULT)

riderx pushed a commit to Cap-go/capacitor-plus that referenced this pull request Jan 8, 2026
@jcesarmobile
Copy link
Member

jcesarmobile commented Jan 8, 2026

The only concern about this approach is, what if the user change the style programmatically? i.e. called SystemBars.setStyle({ style: SystemBarsStyle.Dark }); but doesn't have it configured?
This will "reset" the value to default and change the appearance automatically.
Should setStyle plugin call save the latest style in a variable instead and use that value on the handleOnConfigurationChanged instead of reading the config value?
I think that's what status-bar plugin does.

riderx pushed a commit to Cap-go/capacitor-plus that referenced this pull request Jan 9, 2026
riderx pushed a commit to Cap-go/capacitor-plus that referenced this pull request Jan 10, 2026
riderx pushed a commit to Cap-go/capacitor-plus that referenced this pull request Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SystemBars style gets reset when orientation changes

5 participants