SideMenuController extends ParentController<DrawerLayout> { public void setRightController(ViewController controller) { this.right = controller; int height = this.getHeight(options.sideMenuRootOptions.right); int width = this.getWidth(options.sideMenuRootOptions.right); getView().addView(controller.getView(), new LayoutParams(width, height, Gravity.RIGHT)); } SideMenuController(Activity activity, ChildControllersRegistry childRegistry, String id, Options initialOptions, SideMenuPresenter sideMenuOptionsPresenter, Presenter presenter); @Override void sendOnNavigationButtonPressed(String buttonId); @NonNull @Override Collection<ViewController> getChildControllers(); @Override void applyChildOptions(Options options, Component child); @Override void mergeChildOptions(Options options, ViewController childController, Component child); @Override void mergeOptions(Options options); @Override boolean handleBack(CommandListener listener); void setCenterController(ViewController centerController); void setLeftController(ViewController controller); void setRightController(ViewController controller);  }
@Test public void setRightController_matchesParentByDefault() { SideMenuOptions options = new SideMenuOptions(); assertThat(options.width.hasValue()).isFalse(); assertThat(options.height.hasValue()).isFalse(); uut.options.sideMenuRootOptions.left = options; SimpleComponentViewController componentViewController = new SimpleComponentViewController(activity, childRegistry, "right", new Options()); uut.setRightController(componentViewController); LayoutParams params = componentViewController.getView().getLayoutParams(); assertThat(params.width).isEqualTo(MATCH_PARENT); assertThat(params.height).isEqualTo(MATCH_PARENT); }