Defining dimension resources

Typically in a layout file, we can have numerous elements that specify the same constraint values to attributes. Such values should be added to a dimensions resource file. Let's go ahead and create a dimensions resource file now. In your application project view, navigate to res | values and create a new value resource file in the directory with the name dimens:

Leave all other file attributes at their default values:

Open the file upon its creation. Its content should be similar to the following code:

<?xml version="1.0" ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.