I have integrated splash screen into my app from android manifest I gave it a newly made SplashTheme
and whenever the onActivityCreated
called I change it to the one that is needed. Now , in splash.xml
file which you can see below:
<item>
<color android:color="@color/colorPrimary" />
</item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/ic_launcher" />
</item>
I put my launcher ic_launcher
in the center but when the device in which the app is installed uses round icons the splash screen still shows the "original" icon. I know because I put here ic_launcher
instead of ic_launcher_round
but I would like to make this part dynamic, to recognize if the devices uses round icons put ic_launcher_round
and the opposite.
Here is the part of my AndroidManifest.xml
:
Afaik, you cannot achieve the behavior you expect, simply because there does not exist an API, that would provide you whether current launcher uses round icon or a default icon.
Instead, you should construct your splash screen in a way, that is not dependent on the default launcher implementation of the device. Normally, you should have the same image regardless launcher uses round or normal icons.
Leave launcher icons aside and create a resource specifically for splash screen.