0

I'm trying to create splitActionBar (I think I got the name right) using a regular old Toolbar placed on the bottom. If you take a look at this post (How to center action menu on toolbar), I am trying to do what the "Answer" says using the Github link, but I don't know how to go about adding a view and using the needed ViewGroup.LayoutParams.

Could someone help me out please?

Here is my relevant code: toolbarBottom = activateBottomToolbar();

    ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT );
    toolbarBottom.addView(findViewById(R.id.picture), params);
    toolbarBottom.addView(findViewById(R.id.video), params);

    toolbarBottom.setEnabled(false);

    if (toolbarBottom != null) {
        EnhancedMenuInflater.inflate(getMenuInflater(), toolbarBottom.getMenu(), true);
        toolbarBottom.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                return onOptionsItemSelected(item);
            }
        });
    }

The second answer on this post (Evenly spaced menu items on Toolbar) also deals with the exact same code that I am dealing with...but again I don't really know how to pass a ViewGroup.LayoutParam.

Community
  • 1
  • 1
Takeshi
  • 101
  • 1
  • 6

0 Answers0