public static void adaptLayoutForActionBarHelper(final AppCompatActivity activity, @Nullable final Boolean actionBarShowing, @Nullable final View compassRose) {
        if (compassRose == null) {
            return;
        }

        int minHeight = 0;

        Boolean abs = actionBarShowing;
        if (actionBarShowing == null) {
            final ActionBar actionBar = activity.getSupportActionBar();
            abs = actionBar != null && actionBar.isShowing();
        }
        if (abs) {
            minHeight = activity.findViewById(R.id.actionBarSpacer).getHeight();
        }

        final View filterbar = activity.findViewById(R.id.filter_bar);
        if (filterbar != null) {
            minHeight += filterbar.getHeight();
        }

        View v = activity.findViewById(R.id.distanceinfo);
        if (v.getVisibility() != View.VISIBLE) {
            v = activity.findViewById(R.id.target);
        }
        if (v.getVisibility() == View.VISIBLE) {
            minHeight += v.getHeight();
        }

        final int finalMinHeight = minHeight;
        activity.runOnUiThread(() -> compassRose.animate().translationY(finalMinHeight).start());
    }
use this instead of AbstractBottomNavigationActivity.setContentView for being able to use a action bar toogle
main/src/main/java/cgeo/geocaching/utils/HideActionBarUtils.java