Skip to content

Fix visibility error on media details view #2009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ private void checkLocationPermission() {


private void updateClosestNearbyCardViewInfo() {

curLatLng = locationManager.getLastLocation();

placesDisposable = Observable.fromCallable(() -> nearbyController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
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;
Expand Down Expand Up @@ -204,12 +205,14 @@ public void onGlobalLayout() {
};
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ public void onClick(View view) {
* @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);
Expand Down