From 029e2750393587f61e9be2038c853473bddfb4d7 Mon Sep 17 00:00:00 2001 From: Amr Hossam Date: Wed, 28 Aug 2024 02:47:15 +0300 Subject: [PATCH] fix: donation UI visibility issue Signed-off-by: Amr Hossam --- .../main/java/org/onebusaway/android/ui/HomeActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.java index d8ff6dfd6..17c6abc6a 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/HomeActivity.java @@ -585,8 +585,8 @@ private void goToNavDrawerItem(int item) { startActivity(i); break; } + updateDonationsUIVisibility(); if (mCurrentNavDrawerPosition != NAVDRAWER_ITEM_NEARBY) { - updateDonationsUIVisibility(); WeatherUtils.toggleWeatherViewVisibility(false,weatherView); }else{ setWeatherData(); @@ -2097,9 +2097,10 @@ private void setupDonationView(HomeActivity homeActivity) { private void updateDonationsUIVisibility() { mDonationView = findViewById(R.id.donationView); + if(mDonationView == null) return; DonationsManager donationsManager = Application.getDonationsManager(); - if (donationsManager.shouldShowDonationUI()) { + if (donationsManager.shouldShowDonationUI() && mCurrentNavDrawerPosition == NAVDRAWER_ITEM_NEARBY) { mDonationView.setVisibility(View.VISIBLE); } else {