mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Add network connection established check on view side, check it from presenter
This commit is contained in:
parent
f8e8d13b78
commit
034a2e2f08
3 changed files with 12 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ public interface NearbyParentFragmentContract {
|
||||||
void showLocationPermissionDeniedErrorDialog(LocationServiceManager locationServiceManager);
|
void showLocationPermissionDeniedErrorDialog(LocationServiceManager locationServiceManager);
|
||||||
void checkGps(LocationServiceManager locationServiceManager);
|
void checkGps(LocationServiceManager locationServiceManager);
|
||||||
void checkLocationPermission(LocationServiceManager locationServiceManager);
|
void checkLocationPermission(LocationServiceManager locationServiceManager);
|
||||||
|
boolean isNetworkConnectionEstablished();
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UserActions {
|
interface UserActions {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import fr.free.nrw.commons.nearby.NearbyListFragment;
|
||||||
import fr.free.nrw.commons.nearby.NearbyMapFragment;
|
import fr.free.nrw.commons.nearby.NearbyMapFragment;
|
||||||
import fr.free.nrw.commons.nearby.mvp.contract.NearbyParentFragmentContract;
|
import fr.free.nrw.commons.nearby.mvp.contract.NearbyParentFragmentContract;
|
||||||
import fr.free.nrw.commons.nearby.mvp.presenter.NearbyParentFragmentPresenter;
|
import fr.free.nrw.commons.nearby.mvp.presenter.NearbyParentFragmentPresenter;
|
||||||
|
import fr.free.nrw.commons.utils.NetworkUtils;
|
||||||
import fr.free.nrw.commons.wikidata.WikidataEditListener;
|
import fr.free.nrw.commons.wikidata.WikidataEditListener;
|
||||||
import timber.log.Timber;
|
import timber.log.Timber;
|
||||||
|
|
||||||
|
|
@ -289,4 +290,9 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
|
||||||
nearbyParentFragmentPresenter.updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);
|
nearbyParentFragmentPresenter.updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNetworkConnectionEstablished() {
|
||||||
|
return NetworkUtils.isInternetConnectionEstablished(getActivity());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,11 @@ public class NearbyParentFragmentPresenter
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!nearbyParentFragmentView.isNetworkConnectionEstablished()) {
|
||||||
|
Timber.d("Network connection is not established");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue