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
a3fef50c
Commit
a3fef50c
authored
Apr 14, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add backup config
parent
63bc35a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
7 deletions
+33
-7
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
AppModule.kt
.../main/java/chat/rocket/android/dagger/module/AppModule.kt
+14
-6
ForMessages.kt
.../java/chat/rocket/android/dagger/qualifier/ForMessages.kt
+11
-0
backup_config.xml
app/src/main/res/xml/backup_config.xml
+6
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
a3fef50c
...
...
@@ -17,10 +17,11 @@
<application
android:name=
".app.RocketChatApplication"
android:allowBackup=
"true"
android:fullBackupContent=
"@xml/backup_config"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:networkSecurityConfig=
"@xml/network_security_config"
>
android:networkSecurityConfig=
"@xml/network_security_config"
android:supportsRtl=
"true"
>
<activity
...
...
app/src/main/java/chat/rocket/android/dagger/module/AppModule.kt
View file @
a3fef50c
...
...
@@ -16,6 +16,7 @@ import chat.rocket.android.authentication.infraestructure.SharedPreferencesMulti
import
chat.rocket.android.authentication.infraestructure.SharedPreferencesTokenRepository
import
chat.rocket.android.chatroom.service.MessageService
import
chat.rocket.android.dagger.qualifier.ForFresco
import
chat.rocket.android.dagger.qualifier.ForMessages
import
chat.rocket.android.helper.FrescoAuthInterceptor
import
chat.rocket.android.helper.MessageParser
import
chat.rocket.android.infrastructure.LocalRepository
...
...
@@ -73,7 +74,7 @@ class AppModule {
@Provides
@Singleton
fun
provideRocketChatDatabase
(
context
:
Application
):
RocketChatDatabase
{
return
Room
.
databaseBuilder
(
context
,
RocketChatDatabase
::
class
.
java
,
"rocketchat-db"
).
build
()
return
Room
.
databaseBuilder
(
context
.
applicationContext
,
RocketChatDatabase
::
class
.
java
,
"rocketchat-db"
).
build
()
}
@Provides
...
...
@@ -168,9 +169,14 @@ class AppModule {
}
@Provides
fun
provideSharedPreferences
(
context
:
Application
):
SharedPreferences
{
return
context
.
getSharedPreferences
(
"rocket.chat"
,
Context
.
MODE_PRIVATE
)
}
fun
provideSharedPreferences
(
context
:
Application
)
=
context
.
getSharedPreferences
(
"rocket.chat"
,
Context
.
MODE_PRIVATE
)
@Provides
@ForMessages
fun
provideMessagesSharedPreferences
(
context
:
Application
)
=
context
.
getSharedPreferences
(
"messages"
,
Context
.
MODE_PRIVATE
)
@Provides
@Singleton
...
...
@@ -225,8 +231,10 @@ class AppModule {
@Provides
@Singleton
fun
provideMessageRepository
(
context
:
Application
,
moshi
:
Moshi
,
currentServerInteractor
:
GetCurrentServerInteractor
):
MessagesRepository
{
val
preferences
=
context
.
getSharedPreferences
(
"messages"
,
Context
.
MODE_PRIVATE
)
fun
provideMessageRepository
(
context
:
Application
,
@ForMessages
preferences
:
SharedPreferences
,
moshi
:
Moshi
,
currentServerInteractor
:
GetCurrentServerInteractor
):
MessagesRepository
{
return
SharedPreferencesMessagesRepository
(
preferences
,
moshi
,
currentServerInteractor
)
}
...
...
app/src/main/java/chat/rocket/android/dagger/qualifier/ForMessages.kt
0 → 100644
View file @
a3fef50c
package
chat.rocket.android.dagger.qualifier
import
javax.inject.Qualifier
/**
* Created by luciofm on 4/14/18.
*/
@Qualifier
@Retention
(
AnnotationRetention
.
RUNTIME
)
annotation
class
ForMessages
\ No newline at end of file
app/src/main/res/xml/backup_config.xml
0 → 100644
View file @
a3fef50c
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<include
domain=
"sharedpref"
path=
"."
/>
<exclude
domain=
"sharedpref"
path=
"messages.xml"
/>
<exclude
domain=
"file"
path=
"instant-run"
/>
</full-backup-content>
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