mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	removed Search This Area button if network connection is lost (#2774)
* removed Search This Area button if no connection is lost
This commit is contained in:
		
							parent
							
								
									13ea61c7a7
								
							
						
					
					
						commit
						40e8182c9b
					
				
					 2 changed files with 5 additions and 1 deletions
				
			
		|  | @ -729,6 +729,9 @@ public class NearbyFragment extends CommonsDaggerSupportFragment | |||
|                     } else { | ||||
|                         if (snackbar == null) { | ||||
|                             snackbar = Snackbar.make(view, R.string.no_internet, Snackbar.LENGTH_INDEFINITE); | ||||
|                             if (nearbyMapFragment != null && nearbyMapFragment.searchThisAreaButton != null) { | ||||
|                                 nearbyMapFragment.searchThisAreaButton.setVisibility(View.GONE); | ||||
|                             } | ||||
|                         } | ||||
| 
 | ||||
|                         isNetworkErrorOccured = true; | ||||
|  |  | |||
|  | @ -64,6 +64,7 @@ import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao; | |||
| import fr.free.nrw.commons.contributions.ContributionController; | ||||
| import fr.free.nrw.commons.kvstore.JsonKvStore; | ||||
| import fr.free.nrw.commons.utils.LocationUtils; | ||||
| import fr.free.nrw.commons.utils.NetworkUtils; | ||||
| import fr.free.nrw.commons.utils.UiUtils; | ||||
| import fr.free.nrw.commons.utils.ViewUtil; | ||||
| import timber.log.Timber; | ||||
|  | @ -571,7 +572,7 @@ public class NearbyMapFragment extends DaggerFragment { | |||
| 
 | ||||
|             if (NearbyController.currentLocation != null) { // If our nearby markers are calculated at least once | ||||
| 
 | ||||
|                 if (searchThisAreaButton.getVisibility() == View.GONE) { | ||||
|                 if (searchThisAreaButton.getVisibility() == View.GONE && NetworkUtils.isInternetConnectionEstablished(getContext())) { | ||||
|                     searchThisAreaButton.setVisibility(View.VISIBLE); | ||||
|                 } | ||||
|                 double distance = mapboxMap.getCameraPosition().target | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Shubham Pinjwani
						Shubham Pinjwani