Permalink
Browse files

Merge pull request #7044 from JosJuice/android-refresh-all-fragments

Android: Refresh all fragments, not just the selected one
  • Loading branch information...
Helios747 committed Jun 1, 2018
2 parents a9684b5 + 1b127bd commit fcae27981acce6f1ccbc0cfa5163416385830c5e
@@ -110,7 +110,7 @@ public void setVersionString(String version)
public void refresh()
{
getContentResolver().insert(GameProvider.URI_REFRESH, null);
refreshFragment();
refreshAllFragments();
}
@Override
@@ -203,14 +203,15 @@ public boolean onOptionsItemSelected(MenuItem item)
return mPresenter.handleOptionSelection(item.getItemId());
}
private void refreshFragment()
private void refreshAllFragments()
{
Platform platform = Platform.fromPosition(mViewPager.getCurrentItem());
PlatformGamesView fragment = getPlatformGamesView(platform);
if (fragment != null)
for (Platform platform : Platform.values())
{
fragment.refresh();
PlatformGamesView fragment = getPlatformGamesView(platform);
if (fragment != null)
{
fragment.refresh();
}
}
}

0 comments on commit fcae279

Please sign in to comment.