Skip to content

Commit e9bfc4b

Browse files
neslihanturanmaskaravivek
authored andcommitted
Fix visibility error on media details view (commons-app#2009)
1 parent f607c1c commit e9bfc4b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ private void checkLocationPermission() {
546546

547547

548548
private void updateClosestNearbyCardViewInfo() {
549-
550549
curLatLng = locationManager.getLastLocation();
551550

552551
placesDisposable = Observable.fromCallable(() -> nearbyController

app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import fr.free.nrw.commons.MediaWikiImageView;
4646
import fr.free.nrw.commons.R;
4747
import fr.free.nrw.commons.category.CategoryDetailsActivity;
48+
import fr.free.nrw.commons.contributions.ContributionsFragment;
4849
import fr.free.nrw.commons.delete.DeleteTask;
4950
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
5051
import fr.free.nrw.commons.location.LatLng;
@@ -204,12 +205,14 @@ public void onGlobalLayout() {
204205
};
205206
view.getViewTreeObserver().addOnGlobalLayoutListener(layoutListener);
206207
locale = getResources().getConfiguration().locale;
208+
207209
return view;
208210
}
209211

210212
@Override
211213
public void onResume() {
212214
super.onResume();
215+
((ContributionsFragment)(getParentFragment().getParentFragment())).nearbyNoificationCardView.setVisibility(View.GONE);
213216
media = detailProvider.getMediaAtPosition(index);
214217
if (media == null) {
215218
// Ask the detail provider to ping us when we're ready

app/src/main/java/fr/free/nrw/commons/nearby/NearbyNoificationCardView.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ public void onClick(View view) {
201201
* @param place Closes place where we will get information from
202202
*/
203203
public void updateContent(boolean isClosestNearbyPlaceFound, Place place) {
204-
if (this.getVisibility() == GONE) {
205-
return; // If nearby card view is invisible because of preferences, do nothing
206-
}
204+
Timber.d("Update nearby card notification content");
207205
cardViewVisibilityState = CardViewVisibilityState.READY;
208206
permissionRequestButton.setVisibility(GONE);
209207
contentLayout.setVisibility(VISIBLE);

0 commit comments

Comments
 (0)