action mode: show amount of selected articles

This commit is contained in:
Andrew Dolgov 2017-06-04 07:18:16 +03:00
parent ba12f1bba2
commit b92b49e492
1 changed files with 6 additions and 2 deletions

View File

@ -1487,8 +1487,12 @@ public class OnlineActivity extends CommonActivity {
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
if (hf != null && !m_forceDisableActionMode) {
if (hf.getSelectedArticles().size() > 0 && m_headlinesActionMode == null) {
m_headlinesActionMode = startSupportActionMode(m_headlinesActionModeCallback);
if (hf.getSelectedArticles().size() > 0) {
if (m_headlinesActionMode == null) {
m_headlinesActionMode = startSupportActionMode(m_headlinesActionModeCallback);
}
m_headlinesActionMode.setTitle(String.valueOf(hf.getSelectedArticles().size()));
} else if (hf.getSelectedArticles().size() == 0 && m_headlinesActionMode != null) {
m_headlinesActionMode.finish();
}