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

View File

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