Android Studio – simple gradient example.

I used Android Studion 3.6.1 on Ubuntu Linux.
I start an Empty Project and I change the activity_main.xml file into this:

You can see I change the Hello Word! text into GRADIENT COLORS.
I add this source line of code:

I create this resource XML into resdrawable folder with click right and NewDrawable Resource File.
This will open an window and I add the name of the resource gradient_background.
This XML file will have this content:

The result will be a gradient color with colors from red , green and blue.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.