File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
app/src/main/java/com/nextcloud/talk/conversationlist Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,16 @@ class ConversationsListActivity :
345
345
showSearchOrToolbar()
346
346
}
347
347
348
+ override fun onPause () {
349
+ super .onPause()
350
+ val firstVisible = layoutManager?.findFirstVisibleItemPosition() ? : 0
351
+ val firstItem = adapter?.getItem(firstVisible)
352
+ val firstTop = (firstItem as ConversationItem ).mHolder?.itemView?.top
353
+ val firstOffset = firstTop?.minus(CONVERSATION_ITEM_HEIGHT ) ? : 0
354
+
355
+ appPreferences.setConversationListPositionAndOffset(firstVisible, firstOffset)
356
+ }
357
+
348
358
// if edge to edge is used, add an empty item at the bottom of the list
349
359
@Suppress(" MagicNumber" )
350
360
private fun addEmptyItemForEdgeToEdgeIfNecessary () {
@@ -1881,12 +1891,6 @@ class ConversationsListActivity :
1881
1891
bundle.putString(BundleKeys .KEY_MESSAGE_ID , selectedMessageId)
1882
1892
selectedMessageId = null
1883
1893
}
1884
- val firstVisible = layoutManager?.findFirstVisibleItemPosition() ? : 0
1885
- val firstItem = adapter?.getItem(firstVisible)
1886
- val firstTop = (firstItem as ConversationItem ).mHolder?.itemView?.top
1887
- val firstOffset = firstTop?.minus(CONVERSATION_ITEM_HEIGHT ) ? : 0
1888
-
1889
- appPreferences.setConversationListPositionAndOffset(firstVisible, firstOffset)
1890
1894
1891
1895
val intent = Intent (context, ChatActivity ::class .java)
1892
1896
intent.putExtras(bundle)
You can’t perform that action at this time.
0 commit comments