Probably the most correct option is to create logo_start images with different sizes and put them in the appropriate folders:
- drawable-mdpi
- drawable-hdpi
etc.
For bitmap, you cannot specify the size, but you can make it fit on the screen (if you wanted to set the size in dp for this) as follows:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/orange"/> <item android:left="20dp" android:right="20dp"> <bitmap android:src="@drawable/logo_start"/> </item> </layer-list>
In this case, a margin will be added around the bitmap, and the logo itself will be reduced by necessity.
UPDATE: The problem is that the proportions of the logo will change, and this is bad.
Another option is to use for this purpose the Image View. The basic layout will then be:
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/frame" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/orange"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustViewBounds="true" android:scaleType="centerCrop" android:layout_margin="@dimen/activity_horizontal_margin" android:src="@drawable/logo_start"/> </FrameLayout> <!-- тут могут быть другие элементы, которые откроются после скрытия FrameLayout с id=frame --> </FrameLayout>