I spent all day finding the way to change the theme.
The reason why I did this thing is to change the style of “AlertDialog” I used in the game.
These are what I tried to do.
A. styles.xml in ‘values’ folder
In order to get rid of the basic theme style,
I changed it …
<style name=“UE4BaseTheme” parent = “@android:style/Theme.Black.NoTitleBar.Fullscreen” />
…
to …
<style name=“UE4BaseTheme”>
<item name=“android:windowNoTitle”>true</item>
<item name=“android:windowFullscreen”>true</item>
</style>
…
B. styles.xml files in values-land and values-port folders
I removed this line below. <style name=“UE4BaseTheme” parent = “@android:style/Theme.Black.NoTitleBar.Fullscreen” />
For anyone looking for a solution, here’s what I’ve found so far:
When building Android apk, Unreal generates AndroidManifest.xml under Intermediate/Android/arm64. Inside that file, you can check the Android activity declarations. Both SplashActivity and GameActivity is using android:theme="@style/UnrealSplashTheme".
There are two options to modify that:
Update AndroidManifest via UPL
Got inspired from this post. I added this to the UPL.xml file.
Override styles.xml file
During the build process, Unreal will actually copy anything under Build/Android/ to Intermediate/Android/arm64 and override template files. For example, if you set custom App icons, you’ll see it added to Build/Android/res/drawable and then copied over to Intermediate.
So similarly, you can create Build/Android/res/values/styles.xml and Build/Android/res/values-land/styles.xml to override the styles.xml file. Editing the files in Intermediate folder doesn’t work as they always gets regenerated in the build process! I would just copy files from Intermediate and modify them. This gives you more flexibility to control the style.
That being said, I did encounter another issue after changing theme from @style/Theme.Black.AppCompat.NoActionBar.FullScreen to @style/Theme.AppCompat.NoActionBar. The touch positions are off. They don’t account for the action bar or navigation bar. If anyone has ideas how to fix this, that would be great!