Reworked main layouts with recyclerview to improve scrolling performances (like in chat)

This commit is contained in:
Sylvain Berfini 2023-11-16 13:12:11 +01:00
parent 297eb71ff7
commit 6f4e1a45d1
13 changed files with 32 additions and 55 deletions

View file

@ -93,14 +93,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/conversations_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/top_bar_height"
android:layout_marginStart="@dimen/landscape_nav_bar_width" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/new_conversation"

View file

@ -126,8 +126,6 @@
android:visibility="@{viewModel.showFavourites &amp;&amp; !viewModel.isListFiltered &amp;&amp; viewModel.favourites.size() > 0 ? View.VISIBLE : View.GONE}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"

View file

@ -112,14 +112,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/top_bar"
app:layout_constraintBottom_toBottomOf="parent" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/top_bar_height"
android:layout_marginStart="@dimen/landscape_nav_bar_width" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:onClick="@{startCallClickListener}"

View file

@ -109,14 +109,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/meetings_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toEndOf="@id/bottom_nav_bar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/background"
app:layout_constraintBottom_toBottomOf="parent" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/top_bar_height"
android:layout_marginStart="@dimen/landscape_nav_bar_width" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/new_meeting"

View file

@ -24,10 +24,10 @@
android:onLongClickListener="@{onLongClickListener}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView

View file

@ -83,13 +83,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/conversations_list"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/background"
android:layout_marginTop="@dimen/top_bar_height"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/bottom_nav_bar" />
<include

View file

@ -23,6 +23,7 @@
android:onLongClick="@{onLongClickListener}"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:padding="5dp"
android:background="@drawable/primary_cell_background">

View file

@ -115,13 +115,9 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/favourites_contacts_list"
android:visibility="@{viewModel.showFavourites &amp;&amp; !viewModel.isListFiltered &amp;&amp; viewModel.favourites.size() > 0 ? View.VISIBLE : View.GONE}"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/favourites_label" />
<androidx.appcompat.widget.AppCompatTextView
@ -141,11 +137,9 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/contactsList"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/all_contacts_label"
app:layout_constraintBottom_toTopOf="@id/bottom_nav_bar" />

View file

@ -27,6 +27,8 @@
android:onLongClickListener="@{onLongClickListener}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="@drawable/primary_cell_background">
<com.google.android.material.imageview.ShapeableImageView

View file

@ -102,13 +102,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_list"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/top_bar"
android:layout_marginTop="@dimen/top_bar_height"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/bottom_nav_bar" />
<include

View file

@ -18,7 +18,9 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_300"

View file

@ -14,6 +14,7 @@
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingStart="16dp"
android:text="October"
android:textSize="20sp"
android:textColor="@color/gray_main2_600"

View file

@ -99,13 +99,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/meetings_list"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/background"
android:layout_marginTop="@dimen/top_bar_height"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/bottom_nav_bar" />
<include