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
e2ce221d
Commit
e2ce221d
authored
Dec 11, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error message on rotating and change server
parent
a4213242
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
7 deletions
+17
-7
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+4
-2
AppModule.kt
.../main/java/chat/rocket/android/dagger/module/AppModule.kt
+2
-1
LocalModule.kt
...ain/java/chat/rocket/android/dagger/module/LocalModule.kt
+2
-3
MainPresenter.kt
...va/chat/rocket/android/main/presentation/MainPresenter.kt
+1
-0
RocketChatClientFactory.kt
...android/server/infraestructure/RocketChatClientFactory.kt
+1
-0
String.kt
...c/main/java/chat/rocket/android/util/extensions/String.kt
+7
-1
No files found.
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
e2ce221d
...
...
@@ -36,6 +36,8 @@ import chat.rocket.android.helper.SharedPreferenceHelper
import
chat.rocket.android.util.extension.onQueryTextListener
import
chat.rocket.android.util.extensions.fadeIn
import
chat.rocket.android.util.extensions.fadeOut
import
chat.rocket.android.util.extensions.ifNotNullNorEmpty
import
chat.rocket.android.util.extensions.ifNotNullNotEmpty
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.ui
...
...
@@ -83,8 +85,8 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
val
bundle
=
arguments
if
(
bundle
!=
null
)
{
chatRoomId
=
bundle
.
getString
(
BUNDLE_CHAT_ROOM_ID
)
chatRoomId
?.
let
{
presenter
.
loadChatRoom
(
it
)
chatRoomId
.
ifNotNullNotEmpty
{
roomId
->
presenter
.
loadChatRoom
(
roomId
)
chatRoomId
=
null
}
}
...
...
app/src/main/java/chat/rocket/android/dagger/module/AppModule.kt
View file @
e2ce221d
...
...
@@ -64,6 +64,7 @@ import chat.rocket.common.internal.ISO8601Date
import
chat.rocket.common.model.TimestampAdapter
import
chat.rocket.common.util.CalendarISO8601Converter
import
chat.rocket.common.util.Logger
import
chat.rocket.common.util.NoOpLogger
import
chat.rocket.common.util.PlatformLogger
import
chat.rocket.core.internal.AttachmentAdapterFactory
import
chat.rocket.core.internal.ReactionsAdapter
...
...
@@ -231,7 +232,7 @@ class AppModule {
return
Moshi
.
Builder
()
.
add
(
FallbackSealedClassJsonAdapter
.
ADAPTER_FACTORY
)
.
add
(
AppJsonAdapterFactory
.
INSTANCE
)
.
add
(
AttachmentAdapterFactory
(
Logger
(
logger
,
url
)
))
.
add
(
AttachmentAdapterFactory
(
NoOpLogger
))
.
add
(
java
.
lang
.
Long
::
class
.
java
,
ISO8601Date
::
class
.
java
,
...
...
app/src/main/java/chat/rocket/android/dagger/module/LocalModule.kt
View file @
e2ce221d
...
...
@@ -14,6 +14,7 @@ import chat.rocket.common.internal.ISO8601Date
import
chat.rocket.common.model.TimestampAdapter
import
chat.rocket.common.util.CalendarISO8601Converter
import
chat.rocket.common.util.Logger
import
chat.rocket.common.util.NoOpLogger
import
chat.rocket.common.util.PlatformLogger
import
chat.rocket.core.internal.AttachmentAdapterFactory
import
chat.rocket.core.internal.ReactionsAdapter
...
...
@@ -47,7 +48,7 @@ class LocalModule {
return
Moshi
.
Builder
()
.
add
(
FallbackSealedClassJsonAdapter
.
ADAPTER_FACTORY
)
.
add
(
AppJsonAdapterFactory
.
INSTANCE
)
.
add
(
AttachmentAdapterFactory
(
Logger
(
logger
,
url
)
))
.
add
(
AttachmentAdapterFactory
(
NoOpLogger
))
.
add
(
java
.
lang
.
Long
::
class
.
java
,
ISO8601Date
::
class
.
java
,
...
...
@@ -67,8 +68,6 @@ class LocalModule {
return
context
.
getSharedPreferences
(
"rocket.chat"
,
Context
.
MODE_PRIVATE
)
}
@Provides
@Singleton
fun
provideLocalRepository
(
sharedPreferences
:
SharedPreferences
,
moshi
:
Moshi
):
LocalRepository
{
...
...
app/src/main/java/chat/rocket/android/main/presentation/MainPresenter.kt
View file @
e2ce221d
...
...
@@ -110,6 +110,7 @@ class MainPresenter @Inject constructor(
}
fun
loadCurrentInfo
()
{
setupConnectionInfo
(
currentServer
)
checkServerInfo
(
currentServer
)
launchUI
(
strategy
)
{
try
{
...
...
app/src/main/java/chat/rocket/android/server/infraestructure/RocketChatClientFactory.kt
View file @
e2ce221d
...
...
@@ -30,6 +30,7 @@ class RocketChatClientFactory @Inject constructor(
userAgent
=
"RC Mobile; Android ${Build.VERSION.RELEASE}; v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
tokenRepository
=
repository
platformLogger
=
logger
enableLogger
=
false
}
Timber
.
d
(
"Returning NEW client for: $url"
)
...
...
app/src/main/java/chat/rocket/android/util/extensions/String.kt
View file @
e2ce221d
...
...
@@ -77,3 +77,9 @@ fun String.lowercaseUrl(): String? {
}
fun
String
?.
isNotNullNorEmpty
():
Boolean
=
this
!=
null
&&
this
.
isNotEmpty
()
inline
fun
String
?.
ifNotNullNotEmpty
(
block
:
(
String
)
->
Unit
)
{
if
(
this
!=
null
&&
this
.
isNotEmpty
())
{
block
(
this
)
}
}
\ 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