From 1b127bdf33845a1f82479180b497fb7cf5baa4c7 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 1 Jun 2018 18:17:51 +0200 Subject: [PATCH] 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. --- .../dolphinemu/ui/main/MainActivity.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java index 848ab7dc95..97ad22bd7a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/main/MainActivity.java @@ -110,7 +110,7 @@ public final class MainActivity extends AppCompatActivity implements MainView public void refresh() { getContentResolver().insert(GameProvider.URI_REFRESH, null); - refreshFragment(); + refreshAllFragments(); } @Override @@ -203,14 +203,15 @@ public final class MainActivity extends AppCompatActivity implements MainView 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(); + } } }