attempt at better reverse navigation
This commit is contained in:
parent
ee687410d8
commit
8c923e309f
@ -73,10 +73,11 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
public void onOpened() {
|
||||
if (m_actionbarRevertDepth == 0) {
|
||||
m_actionbarUpEnabled = false;
|
||||
m_feedIsSelected = false;
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
|
||||
initMenu();
|
||||
}
|
||||
|
||||
m_feedIsSelected = false;
|
||||
initMenu();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -256,11 +257,15 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
public void 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 {
|
||||
@ -272,6 +277,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
if (m_actionbarUpEnabled)
|
||||
onBackPressed();
|
||||
return true;
|
||||
case R.id.show_feeds:
|
||||
|
@ -129,11 +129,15 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
||||
public void 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 {
|
||||
@ -145,6 +149,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
if (m_actionbarUpEnabled)
|
||||
onBackPressed();
|
||||
return true;
|
||||
case R.id.show_feeds:
|
||||
|
Loading…
Reference in New Issue
Block a user