diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2015-03-29 03:44:57 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-03-31 20:04:12 +0000 |
commit | 225fb227d23031da36bcf8e973f4324701ddaf17 (patch) | |
tree | 2aa8b8ca071c00fcca4ad79bedd92f080a31dcb6 | |
parent | 4238eba27fddf2d67f34dfc395ecd30e8a508000 (diff) | |
download | android_packages_apps_UnifiedEmail-225fb227d23031da36bcf8e973f4324701ddaf17.tar.gz android_packages_apps_UnifiedEmail-225fb227d23031da36bcf8e973f4324701ddaf17.tar.bz2 android_packages_apps_UnifiedEmail-225fb227d23031da36bcf8e973f4324701ddaf17.zip |
email: fix back button
If conversation_topmost_overlay is not ready to take the focus, if the drawerlayout
has the focus (this happens always that the drawerlayout is shown in a conversation view)
then the onBackPressed event never get dispatched to the mail activity, and press
the back button doesn't have effect.
Just double check that the conversation_topmost_overlay view can take focus. In case it
can't take the focus don't response we handled the keyup event.
Also, add a double check over the drawer slide event to prevent burger menu to be displayed
when the back arrow button should be the one displayed.
Change-Id: I964eb1eb779af13c9b2c07b77049147c2ff1f2d9
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r-- | src/com/android/mail/ui/AbstractActivityController.java | 3 | ||||
-rw-r--r-- | src/com/android/mail/ui/ConversationViewFragment.java | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java index d5122ae97..88c016754 100644 --- a/src/com/android/mail/ui/AbstractActivityController.java +++ b/src/com/android/mail/ui/AbstractActivityController.java @@ -4410,13 +4410,14 @@ public abstract class AbstractActivityController implements ActivityController, if (slideOffset > 0.15f) { mDrawerToggle.setDrawerIndicatorEnabled(true /* enable */); } else { - if (mOldSlideOffset < slideOffset) { + if (mOldSlideOffset < slideOffset || (slideOffset == 0f && mOldSlideOffset > 0f)) { final int mode = mViewMode.getMode(); final boolean isTopLevel = Folder.isRoot(mFolder); mDrawerToggle.setDrawerIndicatorEnabled( getShouldShowDrawerIndicator(mode, isTopLevel)); } } + mDrawerContainer.clearFocus(); mOldSlideOffset = slideOffset; diff --git a/src/com/android/mail/ui/ConversationViewFragment.java b/src/com/android/mail/ui/ConversationViewFragment.java index d3c7600aa..519196ec5 100644 --- a/src/com/android/mail/ui/ConversationViewFragment.java +++ b/src/com/android/mail/ui/ConversationViewFragment.java @@ -1212,10 +1212,7 @@ public class ConversationViewFragment extends AbstractConversationViewFragment i // Finally we handle the special keys if (keyCode == KeyEvent.KEYCODE_BACK && id != R.id.conversation_topmost_overlay) { - if (isActionUp) { - mTopmostOverlay.requestFocus(); - } - return true; + return mTopmostOverlay.requestFocus(); } else if (keyCode == KeyEvent.KEYCODE_ENTER && id == R.id.conversation_topmost_overlay) { if (isActionUp) { |