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
5964f871
Unverified
Commit
5964f871
authored
Jul 18, 2018
by
Rafael Kellermann Streit
Committed by
GitHub
Jul 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1509 from RocketChat/fix/fix-crashes-2.5.0-beta
[FIX] fix crashes 2.5.0 beta
parents
c3d08b98
63e2da00
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
24 deletions
+25
-24
FetchChatRoomsInteractor.kt
...cket/android/chatrooms/domain/FetchChatRoomsInteractor.kt
+0
-1
DatabaseManager.kt
app/src/main/java/chat/rocket/android/db/DatabaseManager.kt
+7
-6
ProfileFragment.kt
...in/java/chat/rocket/android/profile/ui/ProfileFragment.kt
+5
-4
activity_add_members.xml
app/src/main/res/layout/activity_add_members.xml
+7
-7
item_read_receipt.xml
app/src/main/res/layout/item_read_receipt.xml
+2
-2
layout_toolbar.xml
app/src/main/res/layout/layout_toolbar.xml
+4
-4
No files found.
app/src/main/java/chat/rocket/android/chatrooms/domain/FetchChatRoomsInteractor.kt
View file @
5964f871
...
...
@@ -3,7 +3,6 @@ package chat.rocket.android.chatrooms.domain
import
chat.rocket.android.db.DatabaseManager
import
chat.rocket.android.db.model.ChatRoomEntity
import
chat.rocket.android.db.model.UserEntity
import
chat.rocket.android.infrastructure.LocalRepository
import
chat.rocket.android.util.retryIO
import
chat.rocket.core.RocketChatClient
import
chat.rocket.core.internal.rest.chatRooms
...
...
app/src/main/java/chat/rocket/android/db/DatabaseManager.kt
View file @
5964f871
...
...
@@ -154,14 +154,14 @@ class DatabaseManager(val context: Application,
val
chatRoom
=
current
.
chatRoom
lastMessage
?.
sender
?.
let
{
user
->
if
(
findUser
(
user
.
id
!!
)
==
null
)
{
if
(
findUser
(
user
.
id
)
==
null
)
{
Timber
.
d
(
"Missing last message user, inserting: ${user.id}"
)
insert
(
UserEntity
(
user
.
id
!!
,
user
.
username
,
user
.
name
))
}
}
user
?.
let
{
user
->
if
(
findUser
(
user
.
id
!!
)
==
null
)
{
if
(
findUser
(
user
.
id
)
==
null
)
{
Timber
.
d
(
"Missing owner user, inserting: ${user.id}"
)
insert
(
UserEntity
(
user
.
id
!!
,
user
.
username
,
user
.
name
))
}
...
...
@@ -260,15 +260,16 @@ class DatabaseManager(val context: Application,
Timber
.
d
(
"Missing user, inserting: $userId"
)
insert
(
UserEntity
(
userId
))
}
room
.
lastMessage
?.
sender
?.
let
{
user
->
if
(
findUser
(
user
.
id
!!
)
==
null
)
{
if
(
findUser
(
user
.
id
)
==
null
)
{
Timber
.
d
(
"Missing last message user, inserting: ${user.id}"
)
insert
(
UserEntity
(
user
.
id
!!
,
user
.
username
,
user
.
name
))
}
}
room
.
user
?.
let
{
user
->
if
(
findUser
(
user
.
id
!!
)
==
null
)
{
if
(
findUser
(
user
.
id
)
==
null
)
{
Timber
.
d
(
"Missing owner user, inserting: ${user.id}"
)
insert
(
UserEntity
(
user
.
id
!!
,
user
.
username
,
user
.
name
))
}
...
...
@@ -312,13 +313,13 @@ class DatabaseManager(val context: Application,
}
}
fun
findUser
(
userId
:
String
):
String
?
=
userDao
().
findUser
(
userId
)
fun
findUser
(
userId
:
String
?):
String
?
=
if
(
userId
!=
null
)
userDao
().
findUser
(
userId
)
else
null
}
fun
User
.
toEntity
():
BaseUserEntity
?
{
return
if
(
name
==
null
&&
username
==
null
&&
utcOffset
==
null
&&
status
!=
null
)
{
UserStatus
(
id
=
id
,
status
=
status
.
toString
())
}
else
if
(
username
!=
null
){
}
else
if
(
username
!=
null
)
{
UserEntity
(
id
,
username
,
name
,
status
?.
toString
()
?:
"offline"
,
utcOffset
)
}
else
{
null
...
...
app/src/main/java/chat/rocket/android/profile/ui/ProfileFragment.kt
View file @
5964f871
...
...
@@ -14,6 +14,7 @@ import chat.rocket.android.profile.presentation.ProfileView
import
chat.rocket.android.util.extension.asObservable
import
chat.rocket.android.util.extensions.*
import
dagger.android.support.AndroidSupportInjection
import
io.reactivex.disposables.CompositeDisposable
import
io.reactivex.disposables.Disposable
import
io.reactivex.rxkotlin.Observables
import
kotlinx.android.synthetic.main.avatar_profile.*
...
...
@@ -28,7 +29,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
private
lateinit
var
currentEmail
:
String
private
lateinit
var
currentAvatar
:
String
private
var
actionMode
:
ActionMode
?
=
null
private
lateinit
var
editTextsDisposable
:
Disposable
private
val
editTextsDisposable
=
CompositeDisposable
()
companion
object
{
fun
newInstance
()
=
ProfileFragment
()
...
...
@@ -170,7 +171,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
}
private
fun
subscribeEditTexts
()
{
editTextsDisposable
=
Observables
.
combineLatest
(
editTextsDisposable
.
add
(
Observables
.
combineLatest
(
text_name
.
asObservable
(),
text_username
.
asObservable
(),
text_email
.
asObservable
(),
...
...
@@ -186,11 +187,11 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
}
else
{
finishActionMode
()
}
}
}
)
}
private
fun
unsubscribeEditTexts
()
{
editTextsDisposable
.
dispose
()
editTextsDisposable
.
clear
()
}
private
fun
startActionMode
()
{
...
...
app/src/main/res/layout/activity_add_members.xml
View file @
5964f871
<?xml version="1.0" encoding="utf-8"?>
<android
.support.constrain
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android
x.constraintlayout.widge
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
@@ -11,7 +11,7 @@
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
/>
<android
.support.constrain
t.ConstraintLayout
<android
x.constraintlayout.widge
t.ConstraintLayout
android:id=
"@+id/layout_container"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
...
...
@@ -20,7 +20,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/toolbar_layout"
>
<
android.support.design
.chip.ChipGroup
<
com.google.android.material
.chip.ChipGroup
android:id=
"@+id/members_chips"
style=
"@style/Widget.MaterialComponents.Chip.Entry"
android:layout_width=
"match_parent"
...
...
@@ -31,7 +31,7 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
</
android.support.design
.chip.ChipGroup>
</
com.google.android.material
.chip.ChipGroup>
<com.wang.avi.AVLoadingIndicatorView
android:id=
"@+id/view_loading"
...
...
@@ -63,12 +63,12 @@
android:background=
"@color/colorDividerMessageComposer"
app:layout_constraintTop_toBottomOf=
"@id/text_search_member"
/>
<android
.support.v7
.widget.RecyclerView
<android
x.recyclerview
.widget.RecyclerView
android:id=
"@+id/recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:scrollbars=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/separator_1"
/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/item_read_receipt.xml
View file @
5964f871
<?xml version="1.0" encoding="utf-8"?>
<android
.support.constrain
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android
x.constraintlayout.widge
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
...
...
@@ -41,4 +41,4 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"04/06/2018 14:18:36"
/>
</android
.support.constrain
t.ConstraintLayout>
</android
x.constraintlayout.widge
t.ConstraintLayout>
app/src/main/res/layout/layout_toolbar.xml
View file @
5964f871
<?xml version="1.0" encoding="utf-8"?>
<android
.support.constrain
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android
x.constraintlayout.widge
t.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/toolbar_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android
.support.v7
.widget.Toolbar
<android
x.appcompat
.widget.Toolbar
android:id=
"@+id/toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/toolbar_height"
...
...
@@ -29,6 +29,6 @@
android:gravity=
"end"
android:textSize=
"14sp"
/>
</android
.support.v7
.widget.Toolbar>
</android
x.appcompat
.widget.Toolbar>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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