Android - Standard height of toolbar
I want to create a toolbar in my app, and I am wondering what is the standard height for the toolbar in android?
I want it to be big enough for a finger, but not huge. Is there standard size?
Solution 1:
Its best to use ?attr/actionBarSize
as @Jaison Brooks commented.
In the material guidelines, suggested height is 56dp:
Toolbar: 56dp
Solution 2:
The recommended minimum size for touchable elements is 48 dp, see this page for more detailed metrics.
Solution 3:
In addition to @vedant1811 answer, you can programmatically obtain actionBarSize
from attrs:
TypedValue tv = new TypedValue();
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
{
actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, context.getResources().getDisplayMetrics());
}