code: public int getActionBarHeight() {
          int actionBarHeight = 0;
          TypedValue tv = new TypedValue();
          if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
          {
              actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics());
          }
          return actionBarHeight;
      }
docs: acquire action/tool bar's height