‫Welcome back.
‫In this video, we'll learn about the values folder in Android Studio Values folder contains XML files
‫that define various types of resources that your app uses to provide different aspects of its user interface
‫and behavior.
‫These resources are organized into the values folder to centralize configuration settings, localization
‫and styling information.
‫Let's break down of what you can find in the values folder and how it's used.
‫First of all, let's start with the colors dot XML.
‫This file contains color values that are used throughout your app.
‫Defining colors in a centralized location ensures consistent color schemes and easy theme customization.
‫For example, to define a new color.
‫Here we start with the color tag.
‫I'll specify the name of Blue Underscore Sky, and here I'll close with a closing tag of the color.
‫And here I need to specify the value of this color.
‫And the value of this color should be in the hex code.
‫There are a lot of websites that can provide you with color pickers and give you the code for the hex.
‫For example, if I need to get the blue color like this, I can copy this hex code and paste it here.
‫Its value.
‫You can see it's applied and you can see its thumbnail.
‫Also, you can double click on this thumbnail and you can edit it from the Android studio color picker.
‫Okay, You can see that the hex code is changed.
‫Let's go to the layout and I'll define a new text view.
‫And here I need to specify the color attribute color equal.
‫I'll start with the color add color slash, and I need to specify this color.
‫The blue underscore sky its name.
‫I need to specify it here.
‫Blue underscore sky.
‫And you can see that the color is applied to this text.
‫Further constraints and move it to here and you can see that this text view is applying the blue sky
‫color to this text view as an attribute.
‫The strings Strings.xml file stores strings used in your app's user interface.
‫It's a common practice to store all text content visible to the user in this file, allowing for easy
‫localization and consistent management of strings.
‫To define a new string, we start with the string tag.
‫I'll specify it as text number one, and here I'll give it its value by closing tag.
‫And this.
‫Hello my friends.
‫If I move back to the main activity layout, I can hover here at the text, attribute this message telling
‫us that hardcoded string Welcome to our app should use add string resource so I don't need to use like
‫this.
‫I don't need to specify the text value here in the text attribute directly with the hardcoded string.
‫I need to use string resources.
‫So I'll use add string slash text one click enter and you can see that it is fetching the data, fetching
‫the string from the strings.xml file.
‫So it's specifying this name here and you can see it's fetching its value from the resources strings.
‫Let's move to the themes folder.
‫You can see the theme folder contains two files themes, dot XML and themes dot XML for the night mode.
‫This file is used to define themes for your app themes.
‫Define the overall visual style of your app, including colors, typography and more.
‫For example, to define a new item for this, for this theme.
‫And the theme in Android studio involves defining a set of visual attributes that determine the overall
‫look and feel of your app's user interface.
‫For example, if I need to define the text colors in this application, you can use text color attribute,
‫you can use height, radius color and all of these attributes.
‫You can define them here in this item.
‫For example, if I need to use the primary color color, primary color, which is for the main color
‫for this app, I can use like this and add color underscore black blue sky that we defined in the colors
‫dot XML file, run the application and you can see that the new theme is applied to this application.
‫This is the status bar is a part of the application applying primary color to it.