Bool values

A bool is a simple resource that is referenced using the value provided in the name attribute (not the name of the XML file). As such, you can combine bool resources with other simple resources in the one XML file, under one <resources> element.

<?xml version="1.0" encoding="utf-8"?>
        >[true | false]</bool>
// load value in activity (kotlin code)
val screenIsSmall: Boolean = resources.getBoolean(R.bool.screen_small)

You can use bool values to detect some properties of device. Let we want to know, is device has a small screen.

1. Define screen_small value in the res/values/values.xml file.

<!-- Default boolean values -->
    <bool name="screen_small">false</bool>
    <!-- ... -->

2. Define screen_small value in the res/values-small/values.xml file.

<!-- small screen boolean values -->
    <bool name="screen_small">true</bool>