From 0a3a533844f1209b13cd45d961b7de72197d90de Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 31 Oct 2014 09:36:45 +0300 Subject: [PATCH] open drawer if needed onbackpressed --- org.fox.ttrss/src/main/AndroidManifest.xml | 2 +- .../java/org/fox/ttrss/FeedsActivity.java | 23 ++++--------------- .../ttrss/offline/OfflineFeedsActivity.java | 23 ++++--------------- 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index 25e2d377..53ecb683 100644 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ 0) { - - if (m_feedIsSelected && m_drawerLayout != null && !m_drawerLayout.isDrawerOpen(Gravity.START)) { - m_drawerLayout.closeDrawers(); - } else { - 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(); - } */ + if (m_drawerLayout != null && !m_drawerLayout.isDrawerOpen(Gravity.START)) { + m_drawerLayout.openDrawer(Gravity.START); + } else { + super.onBackPressed(); + } } @Override diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java index 2dca3c85..28db6ab9 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -123,24 +123,11 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead @Override public void onBackPressed() { - super.onBackPressed(); - - /* if (m_actionbarRevertDepth > 0) { - - if (m_feedIsSelected && m_slidingMenu != null && !m_slidingMenu.isMenuShowing()) { - m_slidingMenu.showMenu(); - } else { - 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(); - } */ + if (m_drawerLayout != null && !m_drawerLayout.isDrawerOpen(Gravity.START)) { + m_drawerLayout.openDrawer(Gravity.START); + } else { + super.onBackPressed(); + } } @Override