From ee687410d8a92dfc9dc93651f2f44967ef75aeb6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 28 May 2013 19:50:08 +0400 Subject: [PATCH] fix for actionbar up button disappearing on rotate when switching between slide and normal sidebar --- src/org/fox/ttrss/FeedsActivity.java | 17 +++++++++++------ .../fox/ttrss/offline/OfflineFeedsActivity.java | 7 ++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/org/fox/ttrss/FeedsActivity.java b/src/org/fox/ttrss/FeedsActivity.java index e0b82739..0925840a 100644 --- a/src/org/fox/ttrss/FeedsActivity.java +++ b/src/org/fox/ttrss/FeedsActivity.java @@ -103,9 +103,18 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe m_actionbarRevertDepth = savedInstanceState.getInt("actionbarRevertDepth"); m_feedIsSelected = savedInstanceState.getBoolean("feedIsSelected"); - if (m_slidingMenu != null && m_feedIsSelected == false) + if (m_slidingMenu != null && m_feedIsSelected == false) { m_slidingMenu.showMenu(); - + } else if (m_slidingMenu != null) { + m_actionbarUpEnabled = true; + } else { + m_actionbarUpEnabled = m_actionbarRevertDepth > 0; + } + + if (m_actionbarUpEnabled) { + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + if (!isSmallScreen()) { // temporary hack because FeedsActivity doesn't track whether active feed is open LinearLayout container = (LinearLayout) findViewById(R.id.fragment_container); @@ -113,10 +122,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe if (container != null) container.setWeightSum(3f); } - - if (m_actionbarUpEnabled) { - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - } } /* if (!isCompatMode() && !isSmallScreen()) { diff --git a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java index 99bbdac8..608520cb 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -77,8 +77,13 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead m_actionbarRevertDepth = savedInstanceState.getInt("actionbarRevertDepth"); m_feedIsSelected = savedInstanceState.getBoolean("feedIsSelected"); - if (!m_feedIsSelected && m_slidingMenu != null) + if (m_slidingMenu != null && m_feedIsSelected == false) { m_slidingMenu.showMenu(); + } else if (m_slidingMenu != null) { + m_actionbarUpEnabled = true; + } else { + m_actionbarUpEnabled = m_actionbarRevertDepth > 0; + } if (m_actionbarUpEnabled) { getSupportActionBar().setDisplayHomeAsUpEnabled(true);