Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Show messages even when offline.
Browse files Browse the repository at this point in the history
Fixes #82
  • Loading branch information
nitish1211 committed Jan 29, 2017
1 parent 5d57e88 commit f29a45f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,6 @@ protected void onResume() {
if (narrowedList != null) {
narrowedList.onActivityResume();
}
startRequests();
}

@Override
Expand Down Expand Up @@ -2163,7 +2162,7 @@ public enum Flag {
}
public void setupNetworkBroadcastReceiver()
{
networkStateReceiver = new BroadcastReceiver() {
networkStateReceiver = new BroadcastReceiver() {
final CoordinatorLayout coordinatorLayout = (CoordinatorLayout) findViewById(R.id.coordinatorLayout);
@Override
public void onReceive(Context context, Intent intent) {
Expand All @@ -2172,9 +2171,13 @@ public void onReceive(Context context, Intent intent) {
//Remove chatBox when network connectivity is lost
displayChatBox(false);
Snackbar.make(coordinatorLayout,R.string.no_connection,Snackbar.LENGTH_INDEFINITE).show();
//Displays old offline messages
onReadyToDisplay(true);
Log.d("Network Listener", "No Internet");
}
else{
//Starts a network request only when there is an active network connection
startRequests();
Snackbar.make(coordinatorLayout,R.string.connection_established,Snackbar.LENGTH_SHORT).show();
Log.d("Network Listener", "Internet");
}
Expand Down

0 comments on commit f29a45f

Please sign in to comment.