I have a splash screen with a vector image of size 480dp and radial gradient:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<!-- <solid android:color="#FF07862c"/> -->
<gradient
android:type="radial"
android:startColor="#086824"
android:endColor="#098a2f"
android:gradientRadius="480dp"
android:centerX="0.5"
android:centerY="0.5"/>
</shape>
</item>
<!-- <item android:drawable="@drawable/background0" android:gravity="center"/> -->
<item android:drawable="@drawable/logo"
android:width="480dp"
android:height="480dp"
android:gravity="center"/>
</layer-list>
how to make the the image size
min(screen_width, screen_height) / 2
(in pseudo-code)?
apptheme.xml
:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item>
</style>
</resources>
AndroidManifest.xml
:
<activity android:name="com.myapp.MainActivity"
android:theme="@style/AppTheme"