‫Welcome back in Android Studio.
‫The drawable folder is a standard resource directory used to store drawable resources for your Android
‫application.
‫Drawables are graphic resources such as images or Xaml based drawable shapes, that can be used in various
‫UI elements within your Android application like image view, image button, and other view components.
‫So I can place inside this drawable folder bitmap images such as PNGs, Jpeg, GIF, and others.
‫I'll copy these two images from my desktop to the drawable folder.
‫Paste, okay?
‫And make sure that every drawable, every image should start with letters and small letters.
‫I placed these two pictures in my drawable folder.
‫I can use them in my layout, so I drag and drop an image view from here to the layout and I can select
‫from here.
‫Pick a resource.
‫There are a lot of different resources, icons and ready made and included images in every project you
‫create in Android Studio, these are ready made images.
‫Okay, I'll use this picture.
‫You can infer the constraints to place it here.
‫Also you can create your own drawable shapes.
‫Go to the drawable folder new select image asset or Vector asset.
‫I'll select Vector Asset.
‫And here there is a new window.
‫Then it asks that you can customize this vector.
‫I'll click on this clip art and you can choose from various icons included in Android Studio packages.
‫And in every Android project that you create a lot of various icons and assets.
‫Okay, let me select this Wi-Fi password, click okay and you can customize it.
‫I'll name it as Wi-Fi pass the size.
‫You can change the size, you can change the color.
‫For example, I'll use this color red opacity.
‫You can control the opacity.
‫Click next, click finish.
‫And here I created this vector asset file.
‫In the drawable folder you can see the vector tag contains a vector asset.
‫In this way we create vector assets and vector drawables in drawable folder.
‫Moreover, you can create another type of Drawables called shape Drawables.
‫Click on the Drawables folder new drawable resource file and here I'll name it as gradient background
‫root element selector main and the drawable is as the directory name.
‫Click okay.
‫And here in the gradient pack open it.
‫And here I need to change the selector to shape tag.
‫This is the namespace of the XML files.
‫And this is the preview of my resource gradient background XML file.
‫I'll start with the gradient tag, and inside this gradient tag I'll create some attributes.
‫I start with type linear.
‫Don't worry, I'll explain everything.
‫Angle when 35 degrees.
‫Android start color black.
‫The gradient tag is used to define a gradient drawable.
‫A gradient is a smooth transition between two or more colors.
‫Gradient can be applied as backgrounds to various UI elements like views, buttons, or layouts.
‫The gradient tag is is typically used within an HTML file to define the appearance of a gradient drawable,
‫and in this case the type of this file is shape.
‫This attribute defines the type of the gradient, either linear or radial, but I prefer using linear
‫the angle.
‫This defines the angle of the gradient.
‫You can set it to 45.
‫You can see it's changing the gradient and make sure that it is set it to an angle that it is of multiple
‫of 45 degrees 45, 91, 35, one, 80, and so on.
‫This is the start color of the gradient.
‫This is the end color of the gradient and this is the middle transition color of the gradient.
‫Also you can search online for gradient colors generators.
‫There are a lot of websites that gives you a lot of gradients and color combinations.
‫For example, if I want to transition from this color to this color, I'll copy this hex and place it
‫here.
‫Then I'll copy this color, place it in the middle, and I'll copy this.
‫Place it here and change the angle to 135.
‫And you can see it's a beautiful gradient color.
‫I can apply it to my activity to any view in the layout files.
‫So for example let me use the background attribute and I'll use drawable slash gradient background.
‫You can see it's applied to this layout.
‫This is how we create gradient and customized drawable shapes in Android Studio.
‫This is in general the usage of drawable folder in Android projects.