0

We're using an image as a splash background. In portrait, everything works great.

I have dimens created for both portrait and landscape to fit the height and width of the image. In Landscape, it's still using the portrait dimens.

This results in the image being cut off on the left and right.

the image in the xxhdpi portrait folder is 960x1600px and the image in the land folder it's 1600x960

Here's the splash drawable (splash_background.xml):

<?xml version="1.0" encoding="utf-8"?>
<layer-list
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:height="@dimen/splash_height"
        android:width="@dimen/splash_width"
        android:gravity="center"
        android:drawable="@drawable/splash_image"/>
    <item>
        <shape android:shape="rectangle">
            <gradient
                android:centerColor="@color/transparent"
                android:endColor="@color/black_50"
                android:gradientRadius="250dp"
                android:startColor="@color/transparent"
                android:type="radial"
                />
            <size
                android:width="25dp"
                android:height="25dp"
                />
        </shape>
    </item>
</layer-list>

Here's the dimens for xxhdpi (I have one for every dpi):

<resources>
    <dimen name="splash_height">800dp</dimen>
    <dimen name="splash_width">480dp</dimen>
</resources>

Here's the dimens for land-xxhdpi (I have one for every dpi):

<resources>
    <dimen name="splash_height">480dp</dimen>
    <dimen name="splash_width">800dp</dimen>
</resources>

Here's the style that sets it:

<style name="AppTheme.SplashScreen" parent="AppTheme.Dark">
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
    <item name="android:windowBackground">@drawable/splash_background</item>
</style>

Why isn't it pulling from the land folders? How can I make it do so?

Psest328
  • 6,115
  • 9
  • 45
  • 81

0 Answers0