/** Prepares manager to work */ public void prepare(ActivityMain fragmentActivity, int editorContainer) { parentActivity = fragmentActivity; this.editorContainer = (ViewGroup) ((parentActivity == null) ? null : parentActivity.findViewById(editorContainer)); if (isReady()) { initEditors(); parentActivity .getSupportFragmentManager() .beginTransaction() .add(editorContainer, new Fragment()) .commit(); this.editorContainer.setVisibility(View.GONE); } }
private void initEditors() { editors = new UnitEditor[] {new PlankEditor(), new BindingEditor(), new ForceEditor()}; for (UnitEditor editor : editors) { editor.createView(parentActivity.getLayoutInflater(), editorContainer); } }