I am working on an Android project and I chose vector drawables, it runs fine for all versions. However, on some devices (Wiko Ridge 1280*720, ~ 294 dpi running on KitKat (4.4) in my case ), the image is stretched to fullscreen. What I'm doing is creating an xml drawable:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<color android:color="#FFFFFF"></color>
</item>
<item
android:gravity="center"
android:width="210dp"
android:height="90dp"
android:bottom="80dp"
android:drawable="@drawable/logo_app" />
</layer-list>
*@drawable/logo_app is the vector.
That I'm setting as window background of the SplashActivity:
<style name="AppTheme.Splash" parent="AppTheme.NoActionBar">
<item name="android:windowBackground">@drawable/splash_bg</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
I tried many solutions, such as:
- using png instead of vector
- creating a specific drawable background for devices under api 21
But nothing seems to solve the problem.