Permalink
Browse files

Android: Refresh all fragments, not just the selected one

This fixes the oddity of having to manually refresh after adding a
folder that contains games for a different tab than the one you're on.
  • Loading branch information...
JosJuice committed Jun 1, 2018
1 parent 816c80c commit 1b127bdf33845a1f82479180b497fb7cf5baa4c7
@@ -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 1b127bd

Please sign in to comment.