Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
612f67bd
Commit
612f67bd
authored
Jun 13, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ANR on ChatRoom screen
parent
eb57fd00
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
4 deletions
+9
-4
build.gradle
app/build.gradle
+1
-0
MessageInfoFragmentProvider.kt
...android/chatinformation/di/MessageInfoFragmentProvider.kt
+2
-0
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+1
-1
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+3
-1
dependencies.gradle
dependencies.gradle
+2
-2
No files found.
app/build.gradle
View file @
612f67bd
...
...
@@ -54,6 +54,7 @@ android {
packagingOptions
{
exclude
'META-INF/core.kotlin_module'
exclude
'META-INF/main.kotlin_module'
}
}
...
...
app/src/main/java/chat/rocket/android/chatinformation/di/MessageInfoFragmentProvider.kt
View file @
612f67bd
package
chat.rocket.android.chatinformation.di
import
chat.rocket.android.chatinformation.ui.MessageInfoFragment
import
chat.rocket.android.dagger.scope.PerFragment
import
dagger.Module
import
dagger.android.ContributesAndroidInjector
...
...
@@ -8,5 +9,6 @@ import dagger.android.ContributesAndroidInjector
abstract
class
MessageInfoFragmentProvider
{
@ContributesAndroidInjector
(
modules
=
[
MessageInfoFragmentModule
::
class
])
@PerFragment
abstract
fun
provideMessageInfoFragment
():
MessageInfoFragment
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
612f67bd
...
...
@@ -559,7 +559,7 @@ class ChatRoomPresenter @Inject constructor(
try
{
val
members
=
retryIO
(
"getMembers($chatRoomId, $chatRoomType, $offset)"
)
{
client
.
getMembers
(
chatRoomId
,
roomTypeOf
(
chatRoomType
),
offset
,
50
).
result
}
}
.
take
(
50
)
// Get only 50, the backend is returning 7k+ users
usersRepository
.
saveAll
(
members
)
val
self
=
localRepository
.
get
(
LocalRepository
.
CURRENT_USERNAME_KEY
)
// Take at most the 100 most recent messages distinguished by user. Can return less.
...
...
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
612f67bd
...
...
@@ -265,6 +265,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
recycler_view
.
addOnLayoutChangeListener
(
layoutChangeListener
)
recycler_view
.
addOnScrollListener
(
onScrollListener
)
// Load just once, on the first page...
presenter
.
loadActiveMembers
(
chatRoomId
,
chatRoomType
,
filterSelfOut
=
true
)
}
val
oldMessagesCount
=
adapter
.
itemCount
...
...
@@ -273,7 +276,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
recycler_view
.
scrollToPosition
(
0
)
verticalScrollOffset
.
set
(
0
)
}
presenter
.
loadActiveMembers
(
chatRoomId
,
chatRoomType
,
filterSelfOut
=
true
)
toggleNoChatView
(
adapter
.
itemCount
)
}
}
...
...
dependencies.gradle
View file @
612f67bd
...
...
@@ -4,8 +4,8 @@ ext {
compileSdk
:
27
,
targetSdk
:
27
,
buildTools
:
'27.0.3'
,
kotlin
:
'1.2.
41
'
,
coroutine
:
'0.2
2.5
'
,
kotlin
:
'1.2.
50
'
,
coroutine
:
'0.2
3.1
'
,
dokka
:
'0.9.16'
,
// Main dependencies
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment