@Test public void setRightController_setHeightAndWidthWithOptions() { SideMenuOptions options = new SideMenuOptions(); options.height = new Number(100); options.width = new Number(200); uut.options.sideMenuRootOptions.left = options; SimpleComponentViewController componentViewController = new SimpleComponentViewController(activity, childRegistry, "left", new Options()); uut.setLeftController(componentViewController); int heightInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 100, Resources.getSystem().getDisplayMetrics()); int widthInDp = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 200, Resources.getSystem().getDisplayMetrics()); LayoutParams params = componentViewController.getView().getLayoutParams(); assertThat(params.width).isEqualTo(widthInDp); assertThat(params.height).isEqualTo(heightInDp); }
public void setLeftController(ViewController controller) { this.left = controller; int height = this.getHeight(options.sideMenuRootOptions.left); int width = this.getWidth(options.sideMenuRootOptions.left); getView().addView(controller.getView(), new LayoutParams(width, height, Gravity.LEFT)); }
SideMenuController extends ParentController<DrawerLayout> { public void setLeftController(ViewController controller) { this.left = controller; int height = this.getHeight(options.sideMenuRootOptions.left); int width = this.getWidth(options.sideMenuRootOptions.left); getView().addView(controller.getView(), new LayoutParams(width, height, Gravity.LEFT)); } }
SideMenuController extends ParentController<DrawerLayout> { public void setLeftController(ViewController controller) { this.left = controller; int height = this.getHeight(options.sideMenuRootOptions.left); int width = this.getWidth(options.sideMenuRootOptions.left); getView().addView(controller.getView(), new LayoutParams(width, height, Gravity.LEFT)); } SideMenuController(Activity activity, ChildControllersRegistry childRegistry, String id, Options initialOptions, SideMenuPresenter sideMenuOptionsPresenter, Presenter presenter); }
SideMenuController extends ParentController<DrawerLayout> { public void setLeftController(ViewController controller) { this.left = controller; int height = this.getHeight(options.sideMenuRootOptions.left); int width = this.getWidth(options.sideMenuRootOptions.left); getView().addView(controller.getView(), new LayoutParams(width, height, Gravity.LEFT)); } 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); }
SideMenuController extends ParentController<DrawerLayout> { public void setLeftController(ViewController controller) { this.left = controller; int height = this.getHeight(options.sideMenuRootOptions.left); int width = this.getWidth(options.sideMenuRootOptions.left); getView().addView(controller.getView(), new LayoutParams(width, height, Gravity.LEFT)); } 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);  }