‫Welcome back.
‫In this video we'll learn about gradient shapes in Android.
‫Here in the drawable folder I'll create a drawable resource file and I'll name it as gradient underscore
‫main.
‫I'll remove this selector.
‫Use the shape.
‫This is an XML declaration that specifies the XML version and character encoding used in the document.
‫The shape.
‫This is the root element of the drawable resource.
‫It defines the shape of the drawable, which in this case a rectangle.
‫Define shape attribute and define it as rectangle.
‫And inside this shape I'll use gradient and the gradient.
‫This is a drawable element that defines a gradient background.
‫For the rectangular shape, I'll use Android Start color, and here I need to specify the color 00C9FF.
‫This is the blue start color attribute.
‫Specifies the starting color of the gradient, and in this case it's a light blue color with a hexadecimal
‫color code 00C9F.
‫Then I need to specify the end color.
‫The end color 92FE9D.
‫This will specify the ending color of the gradient.
‫The angle 270 specifies the angle at which the gradient is applied.
‫In this case, the gradient is applied vertically from top to bottom.
‫Because the angle is set to seven zero degrees, a value of zero degrees would be horizontal.
‫From left to right, you can see zero from left to right.
‫If I specify 270, it will be from top to bottom.
‫Then I need to use the type which is linear.
‫This attribute specifies that the gradient is a linear gradient, meaning its transition from one color
‫to another is a straight line.
‫Then we need to close this gradient and let's go to the main activity dot XML.
‫And here I need to use the background attribute at drawable.
‫And here I need to specify gradient underscore main.
‫And you can see our gradient background is applied to the activity underscore main layout.
‫This drawable shape can be used as a background for various UI elements in your Android app, such as
‫buttons, backgrounds, or other view components to provide a visually appealing gradient effect from
‫light blue to light green.
‫Now I'll create another gradient file.
‫So new gradient underscore add journal.
‫This is for the add journal activity that we'll create later on in the next videos shape I'll copy this.
‫Of course I need to use rectangle.
‫And inside it I'll change these colors 3A47D5.
‫It's good.