refine previous a bit

This commit is contained in:
Andrew Dolgov 2014-11-04 12:34:05 +04:00
parent 1cfa48c5b9
commit a1ad7e0c41
4 changed files with 19 additions and 9 deletions

View File

@ -257,7 +257,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
ff.initialize(cat, true); ff.initialize(cat, true);
ft.replace(R.id.feeds_fragment, ff, FRAG_FEEDS); ft.replace(R.id.feeds_fragment, ff, FRAG_FEEDS);
//ft.addToBackStack(null); ft.addToBackStack(null);
ft.commit(); ft.commit();
//getSupportActionBar().setDisplayHomeAsUpEnabled(true); //getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@ -294,7 +294,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
switch (item.getItemId()) { switch (item.getItemId()) {
case android.R.id.home: case android.R.id.home:
onBackPressed(); //getSupportFragmentManager().popBackStack();
return true; return true;
case R.id.show_feeds: case R.id.show_feeds:
setUnreadOnly(!getUnreadOnly()); setUnreadOnly(!getUnreadOnly());
@ -311,6 +311,11 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
} }
} }
@Override
public void onBackPressed() {
finish();
}
@Override @Override
protected void loginSuccess(boolean refresh) { protected void loginSuccess(boolean refresh) {
initMenu(); initMenu();

View File

@ -304,7 +304,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
parentBtn.setOnClickListener(new OnClickListener() { parentBtn.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
m_activity.onBackPressed(); m_activity.getSupportFragmentManager().popBackStack();
} }
}); });
} else { } else {

View File

@ -129,7 +129,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
switch (item.getItemId()) { switch (item.getItemId()) {
case android.R.id.home: case android.R.id.home:
onBackPressed(); //getSupportFragmentManager().popBackStack();
return true; return true;
case R.id.show_feeds: case R.id.show_feeds:
setUnreadOnly(!getUnreadOnly()); setUnreadOnly(!getUnreadOnly());
@ -206,7 +206,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
ff.initialize(catId, true); ff.initialize(catId, true);
ft.replace(R.id.feeds_fragment, ff, FRAG_FEEDS); ft.replace(R.id.feeds_fragment, ff, FRAG_FEEDS);
//ft.addToBackStack(null); ft.addToBackStack(null);
//getSupportActionBar().setDisplayHomeAsUpEnabled(true); //getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//m_actionbarUpEnabled = true; //m_actionbarUpEnabled = true;
@ -216,7 +216,12 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
} }
} }
public void onFeedSelected(int feedId) { @Override
public void onBackPressed() {
finish();
}
public void onFeedSelected(int feedId) {
onFeedSelected(feedId, false, true); onFeedSelected(feedId, false, true);
} }

View File

@ -179,7 +179,7 @@ public class OfflineFeedsFragment extends Fragment implements OnItemClickListene
parentBtn.setOnClickListener(new OnClickListener() { parentBtn.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
m_activity.onBackPressed(); m_activity.getSupportFragmentManager().popBackStack();
} }
}); });
} else { } else {