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

Theme preference does not work with Tabris.js 3.9 #2261

Closed
cpetrov opened this issue Jun 29, 2023 · 1 comment
Closed

Theme preference does not work with Tabris.js 3.9 #2261

cpetrov opened this issue Jun 29, 2023 · 1 comment
Labels

Comments

@cpetrov
Copy link
Member

cpetrov commented Jun 29, 2023

Problem description

When using Tabris.js 3.9 and configuring a Theme as described in the Theming an Android app documentation article, the theme is not applied:

<platform name="android">
    <resource-file src="res/android/values/myapp_theme.xml"
                   target="app/src/main/res/values/myapp_theme.xml" />
    <preference name="Theme" value="@style/Theme.MyApp" />
</platform>

As a workaround, one needs to patch AndroidManifest.xml to configure the theme on the application activity (workaround by @elshadsm):

  <edit-config file="AndroidManifest.xml" target="/manifest/application/activity" mode="merge">
    <activity android:theme="@style/Theme.MyApp" />
  </edit-config>

UPDATE: Don't use this workaround as this will break the app on API level 30, see apache/cordova-android#1497 (comment). Set AndroidPostSplashScreenTheme instead.

Expected behavior

Tabris.js should take care of configuring the theme of the activity itself when the Theme preference is specified.

Environment

  • Tabris.js version: 3.9
  • OS: Android
@cpetrov cpetrov added the bug label Jun 29, 2023
@cpetrov
Copy link
Member Author

cpetrov commented Jul 3, 2023

The initial theme needs to be a splash theme, so overriding it through the method previously suggested as a workaround causes breakage, in particular on API level 30, see apache/cordova-android#1497 (comment). Instead, use AndroidPostSplashScreenTheme to configure the theme used after the splash screen gets shown:

<preference name="AndroidPostSplashScreenTheme" value="@style/Theme.MyApp"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant