0

I have a drawable that creates a gradient in the background:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:type="radial"
        android:gradientRadius="75%p"
        android:startColor="#252A32"
        android:endColor="#0C0D10"
        />
</shape>

However it looks completely off when running on an emulator:

XML preview:

enter image description here

On emulator: enter image description here

Why is it showing that ugly circle display?

Manish
  • 1,071
  • 2
  • 10
  • 27
DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
  • 2
    Run it on actual device. I think it will look better just like in preview screen :) – waqaslam Feb 14 '20 at 13:45
  • The gradient isn't displayed at all on my real device :/ – DIRTY DAVE Feb 14 '20 at 13:49
  • I believe it's just the quality and resolution on the emulator and actual device should be fine, maybe try with some colours that are more different between one another (like a red and black one), to actually see how it draws the gradient – Elvereth Feb 14 '20 at 13:55
  • I just tried red and black haha, it worked on my emulator, but my sdk 19 real device only displays black. With no red gradient. – DIRTY DAVE Feb 14 '20 at 13:56

1 Answers1

0

it may be because of different screen density. Emulator and AS showing differently best you can do is trying on an actual device.

Arty
  • 859
  • 2
  • 12
  • 31
  • The gradient is not being displayed at all on my real device, I first thought it was the blackcolor however after switching to another color theres no gradient at all. On my API 19 real device. However it works on my API 28 emulator, but the emulator has those circles on it.. – DIRTY DAVE Feb 14 '20 at 13:51
  • can you check this https://stackoverflow.com/questions/5991176/bitmap-appearance-is-not-looking-good-dithering-is-not-working-in-android – Arty Feb 14 '20 at 14:31