public void resetCurrentDir() { if (mRootDir == null) return; setCurrentDir(mRootDir); }
/** * If the root dir has previously been set, set the root dir to be the currently displayed * directory listing. */ public void resetCurrentDir() { if (mRootDir == null) return; setCurrentDir(mRootDir); }
@Override public boolean onClick() { if (mRootDir == null || mCurrentDir == null) return false; if (mRootDir.equals(mCurrentDir)) return false; File parent = mCurrentDir.getParentFile(); setCurrentDir(parent); return true; } };
@Override public boolean onClick() { if (mRootDir == null || mCurrentDir == null) return false; if (mRootDir.equals(mCurrentDir)) return false; File parent = mCurrentDir.getParentFile(); setCurrentDir(parent); return true; } };
public void newDir(String name) { File file = new File(mCurrentDir, name); if (file.exists()) { showToastMessage(R.string.alert_file_exists); return; } file.mkdir(); setCurrentDir(mCurrentDir); }
public void newDir(String name) { File file = new File(mCurrentDir, name); if (file.exists()) { showToastMessage(R.string.alert_file_exists); return; } file.mkdir(); setCurrentDir(mCurrentDir); }
/** * Create a new file within the currently displayed directory * * @param name */ public void newFile(String name) throws IOException { File file = new File(mCurrentDir, name); if (file.exists()) { showToastMessage(R.string.alert_file_exists); return; } file.createNewFile(); setCurrentDir(mCurrentDir); }
public void newFile(String name) { File file = new File(mCurrentDir, name); if (file.exists()) { showToastMessage(R.string.alert_file_exists); return; } try { file.createNewFile(); setCurrentDir(mCurrentDir); } catch (IOException e) { BasicFunctions.showException(e); } }
@Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { File file = mFilesListAdapter.getItem(position); if (file.isDirectory()) { setCurrentDir(file); return; } String mime = FsUtils.getMimeType(file); if (mime.startsWith("text")) { Intent intent = new Intent(getActivity(), ViewFileActivity.class); intent.putExtra(ViewFileActivity.TAG_FILE_NAME, file.getAbsolutePath()); intent.putExtra(Repo.TAG, mRepo); getRawActivity().startActivity(intent); return; } FsUtils.openFile(file); } });
if (currentDirPath != null) { mCurrentDir = new File(currentDirPath); setCurrentDir(mCurrentDir);
@Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { File file = mFilesListAdapter.getItem(position); if (file.isDirectory()) { setCurrentDir(file); return; } String mime = FsUtils.getMimeType(file); if (mime.startsWith("text")) { Intent intent = new Intent(getActivity(), ViewFileActivity.class); intent.putExtra(ViewFileActivity.TAG_FILE_NAME, file.getAbsolutePath()); intent.putExtra(Repo.TAG, mRepo); getRawActivity().startActivity(intent); return; } try { FsUtils.openFile(file); } catch (ActivityNotFoundException e) { Timber.e(e); ((SheimiFragmentActivity)getActivity()).showMessageDialog(R.string.dialog_error_title, getString(R.string.error_can_not_open_file)); } } });
if (currentDirPath != null) { mCurrentDir = new File(currentDirPath); setCurrentDir(mCurrentDir);