Time for action - applying a gradient to an oval shape
The previous screenshot shows that while the oval looks okay, it's not going to be very visually appealing when surrounded by the gradient painted widgets which make up the default Android toolkit. In order to get the little oval to fit in nicely, it needs to look more like a ball, which requires a simple radial gradient to be applied.
- Create a new shape resource XML file in the
ball.xmland open this file in an editor or IDE.
- Declare the root element of the file as an
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
- Instead of declaring a
solidcolor as the fill, declare a
gradientfill starting with a light grey and ...