StageText.color is automatically inverted (Android dark theme, forceDarkAllowed style flag)
Hi!
Seems Android try to set dark theme inside AIR app and change StageText.color StageText.color is inverted. 0x000000 -> 0xFFFFFF 0x404040 -> 0xBFBFBF 0xFFFFFF -> 0x000000
But it happens time to time (not always on same device). Seems depend of actions order (change theme, run app)
I use AIR+Starling+Feather. Concretely Feather's TextInput. It uses StageText inside. So seems the problem relates to AIR.
For example I see this on Redme Note 7:

instead of:

There is a video demonstrating the problem after entering 2 symbols - https://user-images.githubusercontent.com/9267850/113772215-15343e80-972d-11eb-9934-bc2e0fcd0997.mp4
Starling forum topic: https://forum.starling-framework.org/d/22992-stagetext-color-changes-with-theme-changing-on-android
Can you try adding <item name="android:forceDarkAllowed">false</item> to the styles.xml in your AIR SDK
AIRSDK/lib/android/lib/resources/app_entry/res/values/styles.xml
<resources>
<style name="Theme.NoShadow" parent="android:style/Theme.NoTitleBar">
<item name="android:windowContentOverlay">@null</item>
<item name="android:forceDarkAllowed">false</item>
</style>
</resources>
Thx to @marchbold ! It works!
Probably should leave this open to get harman to address it :)
@ajwfrost Can you give a solution for this? Can we configure this behavior without modification IRSDK/lib/android/lib/resources/app_entry/res/values/styles.xml after each AIR update? Thx!
Sorry @Mintonist we had missed this one! So was this just a request to have that setting in the AIR default styles.xml, or would you prefer this to be configurable via the application descriptor?
No idea) If only I have this request, may be it does not matter. You can discuss this inside your team.
Now with AIR51.2 we can add own res/values/styles.xml
In my case this is:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.NoShadow" parent="android:style/Theme.NoTitleBar">
<item name="android:windowContentOverlay">@null</item>
<item name="android:forceDarkAllowed">false</item>
</style>
</resources>
@ajwfrost It works for .aab build but failed with .apk build:
Unable to run java: com.adobe.air.ADTException: gradle tool failed: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction > Android resource linking failed ERROR: ...\AppData\Local\Temp\fc746b90-86ce-4db7-97e0-0f7bf5fb336d\app\src\main\AndroidManifest.xml:376:1-382:12: AAPT: error: resource style/Theme.PlayCore.Transparent (aka air.mycompany.com:style/Theme.PlayCore.Transparent) not found.
@ajwfrost can you give advice about my problem with .apk build?
@Mintonist Not sure this will work via the res folder as the original resource will still be in the AIR SDK, though the error seems to indicate something different than I would have expected. To do it that way you might have to change the name of the style and then apply a different style to the application activity, though I haven't tried this.
@marchbold It works with res folder for .aab build. But fail for .apk build
Interesting, can you double check that you are using the new build process (i.e. have set build legacy in your manifest and have set an android sdk in your config via air sdk manager or other)?
about adding own res/values/styles.xml @ajwfrost tell me somewhere in other ticket early
I use new build process via gradle and Android SDK