@@ -200,7 +200,7 @@ class HomeActivity : ScreenLockActionBarActivity(),
200
200
binding.globalSearchInputLayout.listener = this
201
201
homeAdapter.setHasStableIds(true )
202
202
homeAdapter.glide = glide
203
- binding.searchContactsRecyclerView .adapter = homeAdapter
203
+ binding.conversationsRecyclerView .adapter = homeAdapter
204
204
binding.globalSearchRecycler.adapter = globalSearchAdapter
205
205
206
206
binding.configOutdatedView.setOnClickListener {
@@ -237,7 +237,7 @@ class HomeActivity : ScreenLockActionBarActivity(),
237
237
homeViewModel.data
238
238
.filterNotNull() // We don't actually want the null value here as it indicates a loading state (maybe we need a loading state?)
239
239
.collectLatest { data ->
240
- val manager = binding.searchContactsRecyclerView .layoutManager as LinearLayoutManager
240
+ val manager = binding.conversationsRecyclerView .layoutManager as LinearLayoutManager
241
241
val firstPos = manager.findFirstCompletelyVisibleItemPosition()
242
242
val offsetTop = if (firstPos >= 0 ) {
243
243
manager.findViewByPosition(firstPos)?.let { view ->
@@ -429,14 +429,15 @@ class HomeActivity : ScreenLockActionBarActivity(),
429
429
430
430
binding.searchToolbar.isVisible = isShown
431
431
binding.sessionToolbar.isVisible = ! isShown
432
- binding.searchContactsRecyclerView .isVisible = ! isShown
432
+ binding.conversationsRecyclerView .isVisible = ! isShown
433
433
binding.seedReminderView.isVisible = ! TextSecurePreferences .getHasViewedSeed(this ) && ! isShown
434
434
binding.globalSearchRecycler.isVisible = isShown
435
435
binding.conversationListContainer.isVisible = ! isShown
436
436
if (isShown){
437
437
binding.newConversationButton.animate().cancel()
438
438
binding.newConversationButton.isVisible = false
439
439
} else {
440
+ updateEmptyState()
440
441
binding.newConversationButton.apply {
441
442
alpha = 0.0f
442
443
visibility = View .VISIBLE
@@ -482,8 +483,8 @@ class HomeActivity : ScreenLockActionBarActivity(),
482
483
483
484
// region Updating
484
485
private fun updateEmptyState () {
485
- val threadCount = ( binding.searchContactsRecyclerView .adapter) !! .itemCount
486
- binding.emptyStateContainer.isVisible = threadCount == 0 && binding.searchContactsRecyclerView .isVisible
486
+ val threadCount = binding.conversationsRecyclerView .adapter? .itemCount ? : 0
487
+ binding.emptyStateContainer.isVisible = threadCount == 0 && binding.conversationsRecyclerView .isVisible
487
488
}
488
489
489
490
@Subscribe(threadMode = ThreadMode .MAIN )
@@ -606,7 +607,7 @@ class HomeActivity : ScreenLockActionBarActivity(),
606
607
storage.setBlocked(listOf (thread.recipient), true )
607
608
608
609
withContext(Dispatchers .Main ) {
609
- binding.searchContactsRecyclerView .adapter!! .notifyDataSetChanged()
610
+ binding.conversationsRecyclerView .adapter!! .notifyDataSetChanged()
610
611
}
611
612
}
612
613
// Block confirmation toast added as per SS-64
@@ -625,7 +626,7 @@ class HomeActivity : ScreenLockActionBarActivity(),
625
626
lifecycleScope.launch(Dispatchers .Default ) {
626
627
storage.setBlocked(listOf (thread.recipient), false )
627
628
withContext(Dispatchers .Main ) {
628
- binding.searchContactsRecyclerView .adapter!! .notifyDataSetChanged()
629
+ binding.conversationsRecyclerView .adapter!! .notifyDataSetChanged()
629
630
}
630
631
}
631
632
}
0 commit comments