Fix visibility error on media details view (#2009)

This commit is contained in:
neslihanturan 2018-11-19 12:35:36 +02:00 committed by Vivek Maskara
parent f607c1c14d
commit e9bfc4bc7a
3 changed files with 4 additions and 4 deletions

View file

@ -546,7 +546,6 @@ public class ContributionsFragment
private void updateClosestNearbyCardViewInfo() {
curLatLng = locationManager.getLastLocation();
placesDisposable = Observable.fromCallable(() -> nearbyController

View file

@ -45,6 +45,7 @@ import fr.free.nrw.commons.MediaDataExtractor;
import fr.free.nrw.commons.MediaWikiImageView;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.category.CategoryDetailsActivity;
import fr.free.nrw.commons.contributions.ContributionsFragment;
import fr.free.nrw.commons.delete.DeleteTask;
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
import fr.free.nrw.commons.location.LatLng;
@ -204,12 +205,14 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
};
view.getViewTreeObserver().addOnGlobalLayoutListener(layoutListener);
locale = getResources().getConfiguration().locale;
return view;
}
@Override
public void onResume() {
super.onResume();
((ContributionsFragment)(getParentFragment().getParentFragment())).nearbyNoificationCardView.setVisibility(View.GONE);
media = detailProvider.getMediaAtPosition(index);
if (media == null) {
// Ask the detail provider to ping us when we're ready

View file

@ -201,9 +201,7 @@ public class NearbyNoificationCardView extends CardView{
* @param place Closes place where we will get information from
*/
public void updateContent(boolean isClosestNearbyPlaceFound, Place place) {
if (this.getVisibility() == GONE) {
return; // If nearby card view is invisible because of preferences, do nothing
}
Timber.d("Update nearby card notification content");
cardViewVisibilityState = CardViewVisibilityState.READY;
permissionRequestButton.setVisibility(GONE);
contentLayout.setVisibility(VISIBLE);