0

I have a drawable that i want to put in my intro Screen using Image View:

<ImageView
        android:id="@+id/intro_applogo"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@mipmap/ic_intro_logo"
        android:elevation="15dp"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"/>

As you can see im using layout_width and layout_height as match_parent, until that its all ok, the problem is the image appears with blur (see screenshot), how can i do this without getting my image with blur?

Here is the screenshot:

enter image description here

tahsinRupam
  • 6,325
  • 1
  • 18
  • 34
Bruno Estevao
  • 21
  • 1
  • 7
  • what is the size of your image, I think you image has low resolution. Use a more resolution image, inshort use a bigger image – Ranjan Mar 08 '17 at 16:46
  • It is showing blur cause your image is stretched. Try with proper Image resolution. See this - http://stackoverflow.com/questions/13024272/android-background-image-size-in-pixel-which-support-all-devices – tahsinRupam Mar 08 '17 at 16:48
  • @RanjanDas i think is not the resolution, cause me graphic has a high resolution, 600 pixels per inch, and the original image is big enough, but i inserted the graphic using image asset and Android Studio created drawables for all screen sizes, maybe that caused the issue. – Bruno Estevao Mar 10 '17 at 12:34
  • Try this image, http://www.hdiphonewallpapers.us/phone-wallpapers/freewallpaper/129604314MG40-29254.jpg – Ranjan Mar 10 '17 at 12:38
  • If not then post your code and xml – Ranjan Mar 10 '17 at 12:39
  • @RanjanDas, it works, was the resolution of the image, I learned a lot, thanks. – Bruno Estevao Mar 13 '17 at 05:40

1 Answers1

0

Just create separate drawables for different densities

Read https://developer.android.com/guide/practices/screens_support.html

For example you can choose drawable which will fit 200x200dp. So, you should create files

res/drawable-mdpi/ic_intro_logo.png (200x200)

res/drawable-xxdpi/ic_intro_logo.png (600x600px)

res/drawable-xxxdpi/ic_intro_logo.png (800x800px)

Actually, you do not need other drawable folders https://www.youtube.com/watch?v=u5xP4tFQlkA

And finally, use minmap folder only for launcher icons mipmap vs drawable folders

Deni Erdyneev
  • 1,779
  • 18
  • 26
  • Thanks @DeniErdyneev, i inserted the image using image asset in Android Studio, the IDE automatically generated drawables for all screen densities, is that right? – Bruno Estevao Mar 10 '17 at 12:49
  • @BrunoEstevao Yes, Is it ok now? – Deni Erdyneev Mar 12 '17 at 09:59
  • Yes, now is ok, i created a new image tha as a more high resolution and i created myself images and resolution for all screen sizes, i didint use create image asset, i inserted the graphics through the android folders. – Bruno Estevao Mar 13 '17 at 06:43
  • @BrunoEstevao good, I will appreciate you, if you vote up my answer and mark it as correct – Deni Erdyneev Mar 13 '17 at 07:34