Skip to content

Fix empty state showing up on home screen #1038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,9 @@ class HomeActivity : ScreenLockActionBarActivity(),
binding.searchToolbar.isVisible = isShown
binding.sessionToolbar.isVisible = !isShown
binding.recyclerView.isVisible = !isShown
binding.emptyStateContainer.isVisible = (binding.recyclerView.adapter as HomeAdapter).itemCount == 0 && binding.recyclerView.isVisible
binding.seedReminderView.isVisible = !TextSecurePreferences.getHasViewedSeed(this) && !isShown
binding.globalSearchRecycler.isInvisible = !isShown
binding.newConversationButton.isVisible = !isShown
binding.conversationListContainer.isInvisible = isShown
}

private fun updateLegacyConfigView() {
Expand Down
66 changes: 36 additions & 30 deletions app/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,45 @@

</androidx.appcompat.widget.Toolbar>

<RelativeLayout
<FrameLayout
android:animateLayoutChanges="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:focusable="false">
android:layout_height="match_parent">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="172dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="6"
tools:listitem="@layout/view_conversation" />
android:id="@+id/conversationListContainer">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="172dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="6"
tools:listitem="@layout/view_conversation" />

<androidx.compose.ui.platform.ComposeView
android:id="@+id/emptyStateContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/newConversationButton"
android:contentDescription="@string/AccessibilityId_conversationsNew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/new_conversation_button_bottom_offset"
app:rippleColor="@color/button_primary_ripple"
android:src="@drawable/ic_plus"
app:maxImageSize="32dp"
android:tint="?message_sent_text_color"/>

</FrameLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/globalSearchRecycler"
Expand All @@ -173,25 +197,7 @@
tools:itemCount="6"
tools:listitem="@layout/view_global_search_result" />

<androidx.compose.ui.platform.ComposeView
android:id="@+id/emptyStateContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
</FrameLayout>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/newConversationButton"
android:contentDescription="@string/AccessibilityId_conversationsNew"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/new_conversation_button_bottom_offset"
app:rippleColor="@color/button_primary_ripple"
android:src="@drawable/ic_plus"
app:maxImageSize="32dp"
android:tint="?message_sent_text_color"/>

</RelativeLayout>

</LinearLayout>