Add function for monitor the state of network, and adjust UI layout. Add method to notify the refresh thread.