different Splash Screen theme for LandScape and Portrait

Viewed 86

I have different splash screen logo design for landscape and portrait mode. I created folders for drawable-land, drawable-port, res/values-port and res/values-land. I gave same name both files and used splashScreen theme but just the drawable for portrait works on both modes. How can I create different splashScreen theme for LandScape mode and portrait mode.

This is what I have currently

<style name="SplashTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/splash_screen</item>
        <item name="android:statusBarColor">@color/app_bg</item>
    </style>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:drawable="@color/app_bg"/>
    <item android:drawable="@drawable/ic_logo" android:gravity="center"/>
</layer-list>
1 Answers

Seems everything I tried worked. I was just testing on the wrong device. To create a different splashScreen theme for landscape and portrait, I created a drawable-land and drawable-port folder and added their respective drawables, giving them the same name. Then I created a res/values-land folder and added a theme for landscape.

Related