@Override public void onTreeSelected( int position, AdapterView<?> adapterView, Content content, List<Content> contents, String ref) { if ("dir".equals(content.getType())) { backPressed = false; mAdapter.mContent = content; mSelectedRef = ref; mPath = content.getPath(); mContentList.add(contents); mAdapter.notifyDataSetChanged(); } else { if (mGitModuleMap != null) { if (!StringUtils.isBlank(mGitModuleMap.get(content.getPath()))) { String[] userRepo = mGitModuleMap.get(content.getPath()).split("/"); getApplicationContext().openRepositoryInfoActivity(this, userRepo[0], userRepo[1], 0); } else { openFileViewer(content, ref); } } else { openFileViewer(content, ref); } } }
@Override public void onBackPressed() { if (mPager != null) { if (mPager.getCurrentItem() == 1) { backPressed = true; if (mPath != null && mPath.lastIndexOf("/") != -1) { mPath = mPath.substring(0, mPath.lastIndexOf("/")); } else { mPath = null; } if (fileStacks.size() > 1) { mAdapter.notifyDataSetChanged(); return; } else { super.onBackPressed(); } } else { super.onBackPressed(); } } }