Skip to content
Snippets Groups Projects
Verified Commit bd7d512f authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Allow clicking on disconnected warning bar to reconnect

parent 0c0cc852
Branches
Tags
No related merge requests found
...@@ -753,6 +753,14 @@ class ChatActivity : ServiceBoundActivity(), SharedPreferences.OnSharedPreferenc ...@@ -753,6 +753,14 @@ class ChatActivity : ServiceBoundActivity(), SharedPreferences.OnSharedPreferenc
} }
}) })
connectionStatusDisplay.setOnClickListener {
viewModel.sessionManager.value?.orNull()?.apply {
ifDisconnected {
autoReconnect()
}
}
}
// Show Connection Progress Bar // Show Connection Progress Bar
viewModel.connectionProgress.toLiveData().observe(this, Observer { viewModel.connectionProgress.toLiveData().observe(this, Observer {
val (state, progress, max) = it ?: Triple(ConnectionState.DISCONNECTED, 0, 0) val (state, progress, max) = it ?: Triple(ConnectionState.DISCONNECTED, 0, 0)
...@@ -790,6 +798,7 @@ class ChatActivity : ServiceBoundActivity(), SharedPreferences.OnSharedPreferenc ...@@ -790,6 +798,7 @@ class ChatActivity : ServiceBoundActivity(), SharedPreferences.OnSharedPreferenc
} }
ConnectionState.CONNECTED -> { ConnectionState.CONNECTED -> {
progressBar.visibility = View.INVISIBLE progressBar.visibility = View.INVISIBLE
connectionStatusDisplay.setMode(WarningBarView.MODE_NONE) connectionStatusDisplay.setMode(WarningBarView.MODE_NONE)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment