mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add a bugfix to set visibility of nearby notification cardview
This commit is contained in:
parent
b1ac46c0da
commit
13ed4c0b5b
2 changed files with 8 additions and 0 deletions
|
|
@ -474,6 +474,7 @@ public class ContributionsFragment
|
|||
|
||||
if (prefs.getBoolean("displayNearbyCardView", true)) {
|
||||
nearbyNoificationCardView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
if (((ContributionsActivity)getActivity()).locationManager.isLocationPermissionGranted()) {
|
||||
// Display nearest location, first listen
|
||||
|
|
|
|||
|
|
@ -99,6 +99,13 @@ public class NearbyNoificationCardView extends CardView{
|
|||
});
|
||||
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) this.getLayoutParams();
|
||||
layoutParams.setBehavior(swipeDismissBehavior);
|
||||
|
||||
// If you don't setVisibility after getting layout params, then you will se an empty space in place of nerabyNotificationCardView
|
||||
if (((ContributionsActivity)context).prefs.getBoolean("displayNearbyCardView", true)) {
|
||||
this.setVisibility(VISIBLE);
|
||||
} else {
|
||||
this.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue