mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix #1921, missing information about internet connectivity on nearby page
The reported issue is that in the Nearby activity, the app does not communicate that there is no internet connection. On investigation, it appears that a toast message does briefly display "No internet connection". It looks like other activities have implemented this same message within the snackbar instead. In order to have a consistent style of communication to the user, I removed the toast message and replace it with the snackbar message, as implemented in NotificationActivity.java.
This commit is contained in:
parent
e8f4a286c5
commit
ef73204cc0
1 changed files with 4 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ import android.os.Bundle;
|
|||
import android.os.Handler;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomSheetBehavior;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.Menu;
|
||||
|
|
@ -371,6 +372,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
|||
|
||||
private void addNetworkBroadcastReceiver() {
|
||||
IntentFilter intentFilter = new IntentFilter(NETWORK_INTENT_ACTION);
|
||||
Snackbar snackbar = Snackbar.make(transparentView , R.string.no_internet, Snackbar.LENGTH_INDEFINITE);
|
||||
|
||||
broadcastReceiver = new BroadcastReceiver() {
|
||||
|
||||
|
|
@ -378,8 +380,9 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
|
|||
public void onReceive(Context context, Intent intent) {
|
||||
if (NetworkUtils.isInternetConnectionEstablished(NearbyActivity.this)) {
|
||||
refreshView(LOCATION_SIGNIFICANTLY_CHANGED);
|
||||
snackbar.dismiss();
|
||||
} else {
|
||||
ViewUtil.showLongToast(NearbyActivity.this, getString(R.string.no_internet));
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue