/* * 选中某分类文件 */ public void onCategorySelected(FileCategoryType f) { if (mFileCagetoryHelper.getCurCategoryType() != f) { mFileCagetoryHelper.setCurCategoryType(f); ; mFileInteractionHub.setCurrentPath( mFileInteractionHub.getRootPath() + getString(mFileCagetoryHelper.getCurCategoryNameResId())); mFileInteractionHub.refreshFileList(); } if (f == FileCategoryType.Favorite) { showPage(ViewPage.Favorite); } else { showPage(ViewPage.Category); } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub mActivity = (MainActivity) getActivity(); mActivity.setFileCategoryFragment(this); setHasOptionsMenu(true); mRootView = inflater.inflate(R.layout.file_explorer_category, container, false); mFilePathListView = (ListView) mRootView.findViewById(R.id.file_path_list); mEmptyView = (LinearLayout) mRootView.findViewById(R.id.empty_view); mFileInteractionHub = new FileInteractionHub(this); mFileInteractionHub.setMode(Mode.View); mFileInteractionHub.setRootPath("/"); mMenuUtils = new MenuUtils(mActivity, mFileInteractionHub); mFileCagetoryHelper = new FileCategoryHelper(mActivity); mFileIconHelper = new FileIconHelper(mActivity); mFavoriteList = new FavoriteList( mActivity, (ListView) mRootView.findViewById(R.id.favorite_list), this, mFileInteractionHub, mFileIconHelper); mFavoriteList.initList(); mAdapter = new FileListCursorAdapter(mActivity, null, mFileInteractionHub, mFileIconHelper); mFilePathListView.setAdapter(mAdapter); registerScannerReceiver(); return mRootView; }
@Override public void sortCurrentList(FileSortHelper sort) { // TODO Auto-generated method stub mFileInteractionHub.refreshFileList(); }
private void updateUI() { mFileInteractionHub.refreshFileList(); }