Skip to content
Browse files

Issue 630: Card counts disappear after opening the options menu

We were doing something quite complex to disable the top bar when the
menu is opened. However, this causes a number of issues with Honeycomb+
since "onPrepareOptionsMenu" may be called before the menu is actually
opened.

Instead of splitting the logic into two different paths (pre- and post-
Honeycomb) I actually removed this logic.

I tested it on Donut and Gingerbread and it works fine without it.

This was introduced by:
681eda5
in order to force showing the notification area.

However, this causes flickering which is only partially fixed by the
existing implementation. Since it is still possible to switch to the
home screen to check the notifications, I think it is okay to remove it.

If we wanted a quick way to see the notification, I would suggest having
some way to toggle fullscreen from the options menu instead.
  • Loading branch information...
1 parent 673ceb6 commit f629d1648a7bcd893c40c4fa7e1567cd1d6f30e4 @flerda committed Jan 29, 2012
Showing with 0 additions and 38 deletions.
  1. +0 −38 src/com/ichi2/anki/Reviewer.java
View
38 src/com/ichi2/anki/Reviewer.java
@@ -1234,50 +1234,12 @@ public boolean onPrepareOptionsMenu(Menu menu) {
item.setEnabled(true);
}
}
- if (mPrefFullscreenReview) {
- // Temporarily remove top bar to avoid annoying screen flickering
- mTextBarRed.setVisibility(View.GONE);
- mTextBarBlack.setVisibility(View.GONE);
- mTextBarBlue.setVisibility(View.GONE);
- mChosenAnswer.setVisibility(View.GONE);
- if (mPrefTimer) {
- mCardTimer.setVisibility(View.GONE);
- }
- if (mShowProgressBars) {
- mProgressBars.setVisibility(View.GONE);
- }
-
- getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
menu.findItem(MENU_UNDO).setEnabled(DeckManager.getMainDeck().undoAvailable());
menu.findItem(MENU_REDO).setEnabled(DeckManager.getMainDeck().redoAvailable());
return true;
}
- @Override
- public void onOptionsMenuClosed(Menu menu) {
- if (mPrefFullscreenReview) {
- // Restore top bar
- mTextBarRed.setVisibility(View.VISIBLE);
- mTextBarBlack.setVisibility(View.VISIBLE);
- mTextBarBlue.setVisibility(View.VISIBLE);
- mChosenAnswer.setVisibility(View.VISIBLE);
- if (mPrefTimer) {
- mCardTimer.setVisibility(View.VISIBLE);
- }
- if (mShowProgressBars) {
- mProgressBars.setVisibility(View.VISIBLE);
- }
-
- // Restore fullscreen preference
- getWindow().setFlags(
- WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
- }
-
-
/** Handles item selections. */
@Override
public boolean onOptionsItemSelected(MenuItem item) {

0 comments on commit f629d16

Please sign in to comment.
Something went wrong with that request. Please try again.