Fixes #4218 - In-App notifications appear on media detail fragment (#4246)

* Fixed issue with In-App Notification appearing on media detail view.

* Added a comment

* fixed style issues

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
Pratham Pahariya 2021-02-22 15:30:28 +05:30 committed by GitHub
parent 7d8ea51c4f
commit d81caf6a42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -431,19 +431,22 @@ public class ContributionsFragment
showNearbyCardPermissionRationale();
});
if (store.getBoolean("displayNearbyCardView", true)) {
checkPermissionsAndShowNearbyCardView();
if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
nearbyNotificationCardView.setVisibility(View.VISIBLE);
// Notification cards should only be seen on contributions list, not in media details
if (mediaDetailPagerFragment == null) {
if (store.getBoolean("displayNearbyCardView", true)) {
checkPermissionsAndShowNearbyCardView();
if (nearbyNotificationCardView.cardViewVisibilityState == NearbyNotificationCardView.CardViewVisibilityState.READY) {
nearbyNotificationCardView.setVisibility(View.VISIBLE);
}
} else {
// Hide nearby notification card view if related shared preferences is false
nearbyNotificationCardView.setVisibility(View.GONE);
}
} else {
// Hide nearby notification card view if related shared preferences is false
nearbyNotificationCardView.setVisibility(View.GONE);
setNotificationCount();
fetchCampaigns();
}
setNotificationCount();
fetchCampaigns();
}
private void checkPermissionsAndShowNearbyCardView() {