From a051a73c2ba04bebdfbf83a7292d3e1bc54ba187 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 24 May 2020 18:54:33 +0100 Subject: [PATCH] Tweak PIP restore. Fix Library wunderbar value. --- app/src/main/java/io/lbry/browser/MainActivity.java | 11 +++++++++-- .../io/lbry/browser/ui/library/LibraryFragment.java | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index 13c43072..d73e65a0 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -821,9 +821,16 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener } findViewById(R.id.content_main).setVisibility(View.VISIBLE); - findViewById(R.id.floating_balance_main_container).setVisibility(inFullscreenMode ? View.INVISIBLE : View.VISIBLE); - Fragment fragment = getCurrentFragment(); + boolean canShowFloatingBalance = fragment == null || + fragment instanceof FollowingFragment || + fragment instanceof FileViewFragment || + fragment instanceof ChannelFragment || + fragment instanceof EditorsChoiceFragment || + fragment instanceof AllContentFragment || + fragment instanceof LibraryFragment || + fragment instanceof SearchFragment; + findViewById(R.id.floating_balance_main_container).setVisibility(!canShowFloatingBalance || inFullscreenMode ? View.INVISIBLE : View.VISIBLE); if (!(fragment instanceof FileViewFragment) && !inFullscreenMode) { findViewById(R.id.global_now_playing_card).setVisibility(View.VISIBLE); } diff --git a/app/src/main/java/io/lbry/browser/ui/library/LibraryFragment.java b/app/src/main/java/io/lbry/browser/ui/library/LibraryFragment.java index 49377b2a..157ed9ba 100644 --- a/app/src/main/java/io/lbry/browser/ui/library/LibraryFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/library/LibraryFragment.java @@ -213,6 +213,7 @@ public class LibraryFragment extends BaseFragment implements super.onResume(); Context context = getContext(); + Helper.setWunderbarValue(null, context); if (context instanceof MainActivity) { MainActivity activity = (MainActivity) context; LbryAnalytics.setCurrentScreen(activity, "Library", "Library");