I want to use this simple layout for items of list:
Note the right gray area (which I draw red rectangle on its border in below) must be a square:
So I have to approximate the height of layout. It must be simple, but the problem is that the text size of TextView
s is set by using sp
unit and height of layout must be set by dp
unit and I did not found a way for converting dp
and sp
in .xml
file. Also I do not want to create a CustomView
or change properties of layout at runtime. All things must be done in .xml
file. How I can approximate height of layout?