private int mOrientation;
+ private boolean mNeedsEasyMode = false;
+
/**
* @hide
*/
if (mDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
+
+ if (mNeedsEasyMode) {
+ if (item.getItemId() == android.R.id.home) {
+ if (mHistory.size() == 0 && !isEasyModeVisible()) {
+ performShowEasyMode();
+ } else {
+ back();
+ }
+ }
+ }
return super.onOptionsItemSelected(item);
}
private void performShowEasyMode() {
mEasyModeListView.setVisibility(View.VISIBLE);
getCurrentNavigationView().setVisibility(View.GONE);
+ performShowBackArrow(false);
}
/**
getCurrentNavigationView().setVisibility(View.VISIBLE);
}
+ private void performShowBackArrow(boolean showBackArrow) {
+ if (mNeedsEasyMode) {
+ mDrawerToggle.setDrawerIndicatorEnabled(!showBackArrow);
+ }
+ }
+
+ private boolean isEasyModeVisible() {
+ return mEasyModeListView.getVisibility() != View.GONE;
+ }
+
/**
* Method takes a bookmark as argument and adds it to the bookmark list in
* the drawer
} else {
performHideEasyMode();
}
+ performShowBackArrow(!mDrawerToggle.isDrawerIndicatorEnabled());
getCurrentNavigationView().open(fso);
mDrawerLayout.closeDrawer(Gravity.START);
}
intent.putExtra(SearchManager.QUERY, "*"); // Use wild-card '*'
if (position == 0) {
+ // the user has selected all items, they want to see their folders so let's do that.
performHideEasyMode();
+ performShowBackArrow(true);
return;
} else {
}
}
- needsEasyMode = needsEasyMode
- && getResources().getBoolean(R.bool.cmcc_show_easy_mode);
+ mNeedsEasyMode = getResources().getBoolean(R.bool.cmcc_show_easy_mode);
+
+ needsEasyMode = needsEasyMode && mNeedsEasyMode;
if (needsEasyMode) {
performShowEasyMode();
} else {
if (checkBackAction()) {
performHideEasyMode();
return;
+ } else {
+ if (mNeedsEasyMode && !isEasyModeVisible()) {
+ performShowEasyMode();
+ return;
+ }
}
// An exit event has occurred, force the destroy the consoles
//Communicate the user that the next time the application will be closed
this.mExitBackTimeout = System.currentTimeMillis();
DialogHelper.showToast(this, R.string.msgs_push_again_to_exit, Toast.LENGTH_SHORT);
- return true;
+ if (mNeedsEasyMode) {
+ return isEasyModeVisible();
+ } else {
+ return true;
+ }
}
//Back action not applied