public void goToPage(int type, boolean record) { Fragment dst; String mViewName = null; dst = null; if (type == FRAGMENT_DETAIL_MAIN_VIEW) { dst = detailMainFragment; } else if (type == FRAGMENT_TAG_VIEW) { dst = tagFragment; } else if (type == FRAGMENT_POS_VIEW) { dst = posFragment; } else if (type == FRAGMENT_SOUND_VIEW) { dst = soundFragment; } else if (type == FRAGMENT_MAIN_VIEW) { dst = mainFragment; } else if (type == FRAGMENT_CROP_VIEW) { if (thumbView.isShown()) { onClick(thumbView); } dst = montageFragment; } else if (type == FRAGMENT_SOUNDTRACK_VIEW) { dst = soundtrackFragment; if (thumbView.isShown()) { onClick(thumbView); } } else if (type == FRAGMENT_TEXT_INPUT) { dst = textFragment; } else { return; } fragmentType = type; FragmentTransaction ft = fm.beginTransaction(); if (fm.findFragmentById(R.id.fl_edit_voice_detail_fragment) != null) { ft.replace(R.id.fl_edit_voice_detail_fragment, dst, mViewName); } else { ft.add(R.id.fl_edit_voice_detail_fragment, dst, mViewName); } if (record) { ft.addToBackStack(null); } ft.commit(); if (type == FRAGMENT_DETAIL_MAIN_VIEW || type == FRAGMENT_MAIN_VIEW) { ivDone.setVisibility(View.VISIBLE); ivBack.setVisibility(View.VISIBLE); } else { ivDone.setVisibility(View.GONE); ivBack.setVisibility(View.GONE); } }
public void destroy() { for (int x = 0; x < xGrids; x++) for (int y = 0; y < yGrids; y++) if (menuItems[y * xGrids + x] != null) { if (menuItems[y * xGrids + x].isShown()) mWindowManager.removeView(menuItems[y * xGrids + x]); } if (navigator.isShown()) mWindowManager.removeView(navigator); }