Commit a4c1dc31 authored by Wilko Manger's avatar Wilko Manger

Show progress bar while loading chats

parent d6350ba8
Pipeline #246 passed with stage
in 2 minutes and 59 seconds
......@@ -22,6 +22,7 @@ import android.graphics.drawable.InsetDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.View.GONE
import android.view.ViewGroup
import android.widget.LinearLayout.VERTICAL
import androidx.recyclerview.widget.DividerItemDecoration
......@@ -78,6 +79,9 @@ class ChatOverviewFragment : BaseFragment<ChatOverviewViewModel>() {
model.getChatsOverview()
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe { chat ->
view.progressBar.visibility = GONE
runOnUiThread {
adapter.submitChange(chat)
}
......
......@@ -20,6 +20,7 @@ along with Pattle. If not, see <https://www.gnu.org/licenses/>.
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -46,4 +47,15 @@ along with Pattle. If not, see <https://www.gnu.org/licenses/>.
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="128dp"
android:layout_height="128dp"
android:indeterminate="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/chatOverviewsView" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment