Merge pull request #7044 from JosJuice/android-refresh-all-fragments
Android: Refresh all fragments, not just the selected one
This commit is contained in:
commit
fcae27981a
|
@ -110,7 +110,7 @@ public final class MainActivity extends AppCompatActivity implements MainView
|
||||||
public void refresh()
|
public void refresh()
|
||||||
{
|
{
|
||||||
getContentResolver().insert(GameProvider.URI_REFRESH, null);
|
getContentResolver().insert(GameProvider.URI_REFRESH, null);
|
||||||
refreshFragment();
|
refreshAllFragments();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -203,16 +203,17 @@ public final class MainActivity extends AppCompatActivity implements MainView
|
||||||
return mPresenter.handleOptionSelection(item.getItemId());
|
return mPresenter.handleOptionSelection(item.getItemId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshFragment()
|
private void refreshAllFragments()
|
||||||
|
{
|
||||||
|
for (Platform platform : Platform.values())
|
||||||
{
|
{
|
||||||
|
|
||||||
Platform platform = Platform.fromPosition(mViewPager.getCurrentItem());
|
|
||||||
PlatformGamesView fragment = getPlatformGamesView(platform);
|
PlatformGamesView fragment = getPlatformGamesView(platform);
|
||||||
if (fragment != null)
|
if (fragment != null)
|
||||||
{
|
{
|
||||||
fragment.refresh();
|
fragment.refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private PlatformGamesView getPlatformGamesView(Platform platform)
|
private PlatformGamesView getPlatformGamesView(Platform platform)
|
||||||
|
|
Loading…
Reference in New Issue