From 339f37e5b099efffac72aee2f7cb77de46e3d2e4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 28 May 2013 10:38:59 +0400 Subject: [PATCH] fix revertdepth not decreasing properly on backpressed --- src/org/fox/ttrss/FeedsActivity.java | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/org/fox/ttrss/FeedsActivity.java b/src/org/fox/ttrss/FeedsActivity.java index 060d4ebd..d462e438 100644 --- a/src/org/fox/ttrss/FeedsActivity.java +++ b/src/org/fox/ttrss/FeedsActivity.java @@ -297,7 +297,14 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe @Override public void onBackPressed() { - if (m_slidingMenu != null && !m_slidingMenu.isMenuShowing()) { + if (m_actionbarRevertDepth > 0) { + + m_actionbarRevertDepth = m_actionbarRevertDepth - 1; + m_actionbarUpEnabled = m_actionbarRevertDepth > 0; + getSupportActionBar().setDisplayHomeAsUpEnabled(m_actionbarUpEnabled); + + onBackPressed(); + } else if (m_slidingMenu != null && !m_slidingMenu.isMenuShowing()) { m_slidingMenu.showMenu(); } else { super.onBackPressed(); @@ -308,18 +315,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: - if (m_actionbarRevertDepth > 0) { - - m_actionbarRevertDepth = m_actionbarRevertDepth - 1; - m_actionbarUpEnabled = m_actionbarRevertDepth > 0; - getSupportActionBar().setDisplayHomeAsUpEnabled(m_actionbarUpEnabled); - - onBackPressed(); - } else if (m_slidingMenu != null && !m_slidingMenu.isMenuShowing()) { - m_slidingMenu.showMenu(); - } else { - finish(); - } + onBackPressed(); return true; case R.id.show_feeds: setUnreadOnly(!getUnreadOnly());