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
016ae737
Unverified
Commit
016ae737
authored
Oct 19, 2018
by
Leonardo Aramaki
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into members-user-status
parents
af651b43
79bc2d7d
Changes
47
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
372 additions
and
385 deletions
+372
-385
build.gradle
app/build.gradle
+2
-2
AnswersAnalytics.kt
...ss/java/chat/rocket/android/analytics/AnswersAnalytics.kt
+1
-34
GoogleAnalyticsForFirebase.kt
...at/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
+1
-34
Analytics.kt
app/src/main/java/chat/rocket/android/analytics/Analytics.kt
+12
-7
AnalyticsManager.kt
...in/java/chat/rocket/android/analytics/AnalyticsManager.kt
+6
-0
LoginOptionsPresenter.kt
...cation/loginoptions/presentation/LoginOptionsPresenter.kt
+3
-0
LoginOptionsFragment.kt
...id/authentication/loginoptions/ui/LoginOptionsFragment.kt
+9
-9
RegisterUsernameFragment.kt
...ntication/registerusername/ui/RegisterUsernameFragment.kt
+3
-3
ResetPasswordFragment.kt
.../authentication/resetpassword/ui/ResetPasswordFragment.kt
+3
-3
ServerFragment.kt
...rocket/android/authentication/server/ui/ServerFragment.kt
+5
-2
SignupFragment.kt
...rocket/android/authentication/signup/ui/SignupFragment.kt
+1
-2
MessageInfoFragment.kt
.../rocket/android/chatinformation/ui/MessageInfoFragment.kt
+14
-7
PeopleSuggestionsAdapter.kt
...cket/android/chatroom/adapter/PeopleSuggestionsAdapter.kt
+4
-4
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+4
-4
UiModelMapper.kt
...ava/chat/rocket/android/chatroom/uimodel/UiModelMapper.kt
+4
-3
RoomUiModelMapper.kt
...hat/rocket/android/chatrooms/adapter/RoomUiModelMapper.kt
+12
-10
RoomViewHolder.kt
...a/chat/rocket/android/chatrooms/adapter/RoomViewHolder.kt
+2
-1
ChatRoomsAdapter.kt
...java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
+8
-7
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+3
-0
ChatRoomsViewModel.kt
.../rocket/android/chatrooms/viewmodel/ChatRoomsViewModel.kt
+8
-3
ActivityBuilder.kt
...java/chat/rocket/android/dagger/module/ActivityBuilder.kt
+3
-1
MessageDao.kt
app/src/main/java/chat/rocket/android/db/MessageDao.kt
+7
-7
MessageParser.kt
...src/main/java/chat/rocket/android/helper/MessageParser.kt
+5
-5
MembersFragment.kt
...in/java/chat/rocket/android/members/ui/MembersFragment.kt
+7
-2
CheckServerPresenter.kt
...ocket/android/server/presentation/CheckServerPresenter.kt
+146
-138
Ui.kt
app/src/main/java/chat/rocket/android/util/extensions/Ui.kt
+0
-13
AdminPanelWebViewFragmentProvider.kt
...ebview/adminpanel/di/AdminPanelWebViewFragmentProvider.kt
+12
-0
AdminPanelWebViewFragment.kt
...ndroid/webview/adminpanel/ui/AdminPanelWebViewFragment.kt
+8
-2
fragment_authentication_login_options.xml
...main/res/layout/fragment_authentication_login_options.xml
+12
-30
item_actions_attachment.xml
app/src/main/res/layout/item_actions_attachment.xml
+1
-0
strings.xml
app/src/main/res/values-de/strings.xml
+2
-1
strings.xml
app/src/main/res/values-es/strings.xml
+2
-1
strings.xml
app/src/main/res/values-fr/strings.xml
+2
-1
strings.xml
app/src/main/res/values-hi-rIN/strings.xml
+6
-8
strings.xml
app/src/main/res/values-ja/strings.xml
+2
-1
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+2
-1
strings.xml
app/src/main/res/values-ru-rRU/strings.xml
+21
-21
strings.xml
app/src/main/res/values-tr/strings.xml
+2
-1
strings.xml
app/src/main/res/values-uk/strings.xml
+2
-1
strings.xml
app/src/main/res/values/strings.xml
+2
-1
styles.xml
app/src/main/res/values/styles.xml
+5
-1
AnswersAnalytics.kt
...ay/java/chat/rocket/android/analytics/AnswersAnalytics.kt
+2
-0
GoogleAnalyticsForFirebase.kt
...at/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
+2
-0
build.gradle
build.gradle
+1
-1
dependencies.gradle
dependencies.gradle
+9
-9
build.gradle
emoji/build.gradle
+1
-1
gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+3
-3
No files found.
app/build.gradle
View file @
016ae737
...
...
@@ -16,8 +16,8 @@ android {
applicationId
"chat.rocket.android"
minSdkVersion
versions
.
minSdk
targetSdkVersion
versions
.
targetSdk
versionCode
204
3
versionName
"
2.6.1
"
versionCode
204
8
versionName
"
3.0.0
"
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled
true
...
...
app/src/foss/java/chat/rocket/android/analytics/AnswersAnalytics.kt
View file @
016ae737
package
chat.rocket.android.analytics
import
chat.rocket.android.analytics.event.AuthenticationEvent
import
chat.rocket.android.analytics.event.ScreenViewEvent
import
chat.rocket.android.analytics.event.SubscriptionTypeEvent
class
AnswersAnalytics
:
Analytics
{
override
fun
logLogin
(
event
:
AuthenticationEvent
,
loginSucceeded
:
Boolean
)
{
// Do absolutely nothing
}
override
fun
logSignUp
(
event
:
AuthenticationEvent
,
signUpSucceeded
:
Boolean
)
{
// Do absolutely nothing
}
override
fun
logScreenView
(
event
:
ScreenViewEvent
)
{
// Do absolutely nothing
}
override
fun
logMessageSent
(
event
:
SubscriptionTypeEvent
,
serverUrl
:
String
)
{
// Do absolutely nothing
}
override
fun
logMediaUploaded
(
event
:
SubscriptionTypeEvent
,
mimeType
:
String
)
{
// Do absolutely nothing
}
override
fun
logReaction
(
event
:
SubscriptionTypeEvent
)
{
// Do absolutely nothing
}
override
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
{
// Do absolutely nothing
}
}
class
AnswersAnalytics
:
Analytics
\ No newline at end of file
app/src/foss/java/chat/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
View file @
016ae737
package
chat.rocket.android.analytics
import
android.content.Context
import
chat.rocket.android.analytics.event.AuthenticationEvent
import
chat.rocket.android.analytics.event.ScreenViewEvent
import
chat.rocket.android.analytics.event.SubscriptionTypeEvent
import
javax.inject.Inject
class
GoogleAnalyticsForFirebase
@Inject
constructor
(
val
context
:
Context
)
:
Analytics
{
override
fun
logLogin
(
event
:
AuthenticationEvent
,
loginSucceeded
:
Boolean
)
{
// Do absolutely nothing
}
override
fun
logSignUp
(
event
:
AuthenticationEvent
,
signUpSucceeded
:
Boolean
)
{
// Do absolutely nothing
}
override
fun
logScreenView
(
event
:
ScreenViewEvent
)
{
// Do absolutely nothing
}
override
fun
logMessageSent
(
event
:
SubscriptionTypeEvent
,
serverUrl
:
String
)
{
// Do absolutely nothing
}
override
fun
logMediaUploaded
(
event
:
SubscriptionTypeEvent
,
mimeType
:
String
)
{
// Do absolutely nothing
}
override
fun
logReaction
(
event
:
SubscriptionTypeEvent
)
{
// Do absolutely nothing
}
override
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
{
// Do absolutely nothing
}
}
class
GoogleAnalyticsForFirebase
@Inject
constructor
(
val
context
:
Context
)
:
Analytics
\ No newline at end of file
app/src/main/java/chat/rocket/android/analytics/Analytics.kt
View file @
016ae737
...
...
@@ -12,7 +12,7 @@ interface Analytics {
* @param event The [AuthenticationEvent] used to log in.
* @param loginSucceeded True if successful logged in, false otherwise.
*/
fun
logLogin
(
event
:
AuthenticationEvent
,
loginSucceeded
:
Boolean
)
fun
logLogin
(
event
:
AuthenticationEvent
,
loginSucceeded
:
Boolean
)
{}
/**
* Logs the sign up event.
...
...
@@ -20,14 +20,14 @@ interface Analytics {
* @param event The [AuthenticationEvent] used to sign up.
* @param signUpSucceeded True if successful signed up, false otherwise.
*/
fun
logSignUp
(
event
:
AuthenticationEvent
,
signUpSucceeded
:
Boolean
)
fun
logSignUp
(
event
:
AuthenticationEvent
,
signUpSucceeded
:
Boolean
)
{}
/**
* Logs the screen view event.
*
* @param event The [ScreenViewEvent] to log.
*/
fun
logScreenView
(
event
:
ScreenViewEvent
)
fun
logScreenView
(
event
:
ScreenViewEvent
)
{}
/**
* Logs the message sent event.
...
...
@@ -35,7 +35,7 @@ interface Analytics {
* @param event The [SubscriptionTypeEvent] to log.
* @param serverUrl The server URL to log.
*/
fun
logMessageSent
(
event
:
SubscriptionTypeEvent
,
serverUrl
:
String
)
fun
logMessageSent
(
event
:
SubscriptionTypeEvent
,
serverUrl
:
String
)
{}
/**
* Logs the media upload event.
...
...
@@ -43,14 +43,14 @@ interface Analytics {
* @param event The [SubscriptionTypeEvent] to log.
* @param mimeType The mime type of the media uploaded to log.
*/
fun
logMediaUploaded
(
event
:
SubscriptionTypeEvent
,
mimeType
:
String
)
fun
logMediaUploaded
(
event
:
SubscriptionTypeEvent
,
mimeType
:
String
)
{}
/**
* Logs the reaction event.
*
* @param event The [SubscriptionTypeEvent] to log.
*/
fun
logReaction
(
event
:
SubscriptionTypeEvent
)
fun
logReaction
(
event
:
SubscriptionTypeEvent
)
{}
/**
* Logs the server switch event.
...
...
@@ -58,5 +58,10 @@ interface Analytics {
* @param serverUrl The server URL to log.
* @param serverCount The number of server(s) the use own.
*/
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
fun
logServerSwitch
(
serverUrl
:
String
,
serverCount
:
Int
)
{}
/**
* Logs the admin opening.
*/
fun
logOpenAdmin
()
{}
}
app/src/main/java/chat/rocket/android/analytics/AnalyticsManager.kt
View file @
016ae737
...
...
@@ -64,4 +64,10 @@ class AnalyticsManager @Inject constructor(
analytics
.
forEach
{
it
.
logServerSwitch
(
serverUrl
,
accounts
.
size
)
}
}
}
fun
logOpenAdmin
()
{
if
(
analyticsTrackingInteractor
.
get
())
{
analytics
.
forEach
{
it
.
logOpenAdmin
()
}
}
}
}
app/src/main/java/chat/rocket/android/authentication/loginoptions/presentation/LoginOptionsPresenter.kt
View file @
016ae737
...
...
@@ -68,6 +68,7 @@ class LoginOptionsPresenter @Inject constructor(
fun
toLoginWithEmail
()
=
navigator
.
toLogin
(
currentServer
)
fun
authenticateWithOauth
(
oauthToken
:
String
,
oauthSecret
:
String
)
{
setupConnectionInfo
(
currentServer
)
credentialToken
=
oauthToken
credentialSecret
=
oauthSecret
loginMethod
=
AuthenticationEvent
.
AuthenticationWithOauth
...
...
@@ -75,12 +76,14 @@ class LoginOptionsPresenter @Inject constructor(
}
fun
authenticateWithCas
(
casToken
:
String
)
{
setupConnectionInfo
(
currentServer
)
credentialToken
=
casToken
loginMethod
=
AuthenticationEvent
.
AuthenticationWithCas
doAuthentication
(
TYPE_LOGIN_CAS
)
}
fun
authenticateWithSaml
(
samlToken
:
String
)
{
setupConnectionInfo
(
currentServer
)
credentialToken
=
samlToken
loginMethod
=
AuthenticationEvent
.
AuthenticationWithSaml
doAuthentication
(
TYPE_LOGIN_SAML
)
...
...
app/src/main/java/chat/rocket/android/authentication/loginoptions/ui/LoginOptionsFragment.kt
View file @
016ae737
...
...
@@ -9,6 +9,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.Button
import
android.widget.LinearLayout
import
androidx.appcompat.view.ContextThemeWrapper
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
...
...
@@ -18,11 +19,7 @@ import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo
import
chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsPresenter
import
chat.rocket.android.authentication.loginoptions.presentation.LoginOptionsView
import
chat.rocket.android.authentication.ui.AuthenticationActivity
import
chat.rocket.android.util.extensions.clearLightStatusBar
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.rotateBy
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.ui
import
chat.rocket.android.util.extensions.*
import
chat.rocket.android.webview.oauth.ui.INTENT_OAUTH_CREDENTIAL_SECRET
import
chat.rocket.android.webview.oauth.ui.INTENT_OAUTH_CREDENTIAL_TOKEN
import
chat.rocket.android.webview.oauth.ui.oauthWebViewIntent
...
...
@@ -290,7 +287,6 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
}
}
// OAuth Accounts.
override
fun
enableLoginByFacebook
()
=
enableAccountButton
(
button_facebook
)
...
...
@@ -337,8 +333,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
buttonColor
:
Int
)
{
val
button
=
getCustomServiceButton
(
serviceName
,
serviceNameColor
,
buttonColor
)
accounts_container
.
addView
(
button
)
setupButtonListener
(
button
,
customOauthUrl
,
state
,
REQUEST_CODE_FOR_OAUTH
)
accounts_container
.
addView
(
button
)
}
// SAML account.
...
...
@@ -350,8 +346,8 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
buttonColor
:
Int
)
{
val
button
=
getCustomServiceButton
(
serviceName
,
serviceNameColor
,
buttonColor
)
accounts_container
.
addView
(
button
)
setupButtonListener
(
button
,
samlUrl
,
samlToken
,
REQUEST_CODE_FOR_SAML
)
accounts_container
.
addView
(
button
)
}
override
fun
showAccountsView
()
{
...
...
@@ -487,7 +483,11 @@ class LoginOptionsFragment : Fragment(), LoginOptionsView {
val
marginTop
=
resources
.
getDimensionPixelSize
(
R
.
dimen
.
button_account_margin_top
)
params
.
setMargins
(
0
,
marginTop
,
0
,
0
)
val
button
=
Button
(
context
)
val
button
=
Button
(
ContextThemeWrapper
(
context
,
R
.
style
.
Authentication_Button
),
null
,
R
.
style
.
Authentication_Button
)
button
.
layoutParams
=
params
button
.
text
=
buttonText
button
.
setTextColor
(
buttonTextColor
)
...
...
app/src/main/java/chat/rocket/android/authentication/registerusername/ui/RegisterUsernameFragment.kt
View file @
016ae737
...
...
@@ -8,6 +8,7 @@ import android.view.View
import
android.view.ViewGroup
import
androidx.core.content.ContextCompat
import
androidx.core.view.ViewCompat
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
...
...
@@ -16,7 +17,6 @@ import chat.rocket.android.authentication.registerusername.presentation.Register
import
chat.rocket.android.authentication.registerusername.presentation.RegisterUsernameView
import
chat.rocket.android.util.extension.asObservable
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.showKeyboard
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.textContent
...
...
@@ -113,13 +113,13 @@ class RegisterUsernameFragment : Fragment(), RegisterUsernameView {
override
fun
showLoading
()
{
ui
{
disableUserInput
()
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
()
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/resetpassword/ui/ResetPasswordFragment.kt
View file @
016ae737
...
...
@@ -6,6 +6,7 @@ import android.view.View
import
android.view.ViewGroup
import
androidx.core.content.ContextCompat
import
androidx.core.view.ViewCompat
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
...
...
@@ -15,7 +16,6 @@ import chat.rocket.android.authentication.resetpassword.presentation.ResetPasswo
import
chat.rocket.android.util.extension.asObservable
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.isEmail
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.showKeyboard
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.textContent
...
...
@@ -93,13 +93,13 @@ class ResetPasswordFragment : Fragment(), ResetPasswordView {
override
fun
showLoading
()
{
ui
{
disableUserInput
()
view_loading
.
setVisible
(
true
)
view_loading
.
isVisible
=
true
}
}
override
fun
hideLoading
()
{
ui
{
view_loading
.
setVisible
(
false
)
view_loading
.
isVisible
=
false
enableUserInput
()
}
}
...
...
app/src/main/java/chat/rocket/android/authentication/server/ui/ServerFragment.kt
View file @
016ae737
...
...
@@ -7,6 +7,7 @@ import android.view.ViewGroup
import
android.view.ViewTreeObserver
import
android.widget.AdapterView
import
android.widget.ArrayAdapter
import
android.widget.ScrollView
import
android.widget.Toast
import
androidx.core.content.ContextCompat
import
androidx.core.net.toUri
...
...
@@ -52,8 +53,10 @@ class ServerFragment : Fragment(), ServerView {
private
var
protocol
=
"https://"
private
lateinit
var
serverUrlDisposable
:
Disposable
private
val
layoutListener
=
ViewTreeObserver
.
OnGlobalLayoutListener
{
text_server_url
.
isCursorVisible
=
KeyboardHelper
.
isSoftKeyboardShown
(
scroll_view
.
rootView
)
if
(
KeyboardHelper
.
isSoftKeyboardShown
(
scroll_view
.
rootView
))
{
scroll_view
.
fullScroll
(
ScrollView
.
FOCUS_DOWN
)
text_server_url
.
isCursorVisible
=
true
}
}
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
...
...
app/src/main/java/chat/rocket/android/authentication/signup/ui/SignupFragment.kt
View file @
016ae737
...
...
@@ -11,7 +11,6 @@ import androidx.core.view.ViewCompat
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.R.string.message_credentials_saved_successfully
import
chat.rocket.android.analytics.AnalyticsManager
import
chat.rocket.android.analytics.event.ScreenViewEvent
import
chat.rocket.android.authentication.signup.presentation.SignupPresenter
...
...
@@ -64,7 +63,7 @@ class SignupFragment : Fragment(), SignupView {
if
(
resultCode
==
Activity
.
RESULT_OK
)
{
if
(
data
!=
null
)
{
if
(
requestCode
==
SAVE_CREDENTIALS
)
{
showMessage
(
getString
(
message_credentials_saved_successfully
))
showMessage
(
getString
(
R
.
string
.
message_credentials_saved_successfully
))
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatinformation/ui/MessageInfoFragment.kt
View file @
016ae737
...
...
@@ -4,6 +4,7 @@ import android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.core.view.isVisible
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.DefaultItemAnimator
import
androidx.recyclerview.widget.LinearLayoutManager
...
...
@@ -15,8 +16,8 @@ import chat.rocket.android.chatinformation.adapter.ReadReceiptAdapter
import
chat.rocket.android.chatinformation.presentation.MessageInfoPresenter
import
chat.rocket.android.chatinformation.presentation.MessageInfoView
import
chat.rocket.android.chatinformation.viewmodel.ReadReceiptViewModel
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.android.util.extensions.ui
import
dagger.android.support.AndroidSupportInjection
import
kotlinx.android.synthetic.main.fragment_message_info.*
import
javax.inject.Inject
...
...
@@ -84,16 +85,22 @@ class MessageInfoFragment : Fragment(), MessageInfoView {
}
override
fun
showLoading
()
{
view_loading
.
setVisible
(
true
)
view_loading
.
show
()
ui
{
view_loading
.
isVisible
=
true
view_loading
.
show
()
}
}
override
fun
hideLoading
()
{
view_loading
.
hide
()
view_loading
.
setVisible
(
false
)
ui
{
view_loading
.
isVisible
=
false
view_loading
.
hide
()
}
}
override
fun
showReadReceipts
(
messageReceipts
:
List
<
ReadReceiptViewModel
>)
{
adapter
.
addAll
(
messageReceipts
)
ui
{
adapter
.
addAll
(
messageReceipts
)
}
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/chatroom/adapter/PeopleSuggestionsAdapter.kt
View file @
016ae737
...
...
@@ -7,10 +7,10 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.core.view.isVisible
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.adapter.PeopleSuggestionsAdapter.PeopleSuggestionViewHolder
import
chat.rocket.android.chatroom.uimodel.suggestion.PeopleSuggestionUiModel
import
chat.rocket.android.util.extensions.setVisible
import
chat.rocket.android.suggestions.model.SuggestionModel
import
chat.rocket.android.suggestions.ui.BaseSuggestionViewHolder
import
chat.rocket.android.suggestions.ui.SuggestionsAdapter
...
...
@@ -58,9 +58,9 @@ class PeopleSuggestionsAdapter(context: Context) : SuggestionsAdapter<PeopleSugg
username
.
text
=
item
.
username
name
.
text
=
item
.
name
if
(
item
.
imageUri
?.
isEmpty
()
!=
false
)
{
avatar
.
setVisible
(
false
)
avatar
.
isVisible
=
false
}
else
{
avatar
.
setVisible
(
true
)
avatar
.
isVisible
=
true
avatar
.
setImageURI
(
item
.
imageUri
)
}
val
status
=
item
.
status
...
...
@@ -68,7 +68,7 @@ class PeopleSuggestionsAdapter(context: Context) : SuggestionsAdapter<PeopleSugg
val
statusDrawable
=
DrawableHelper
.
getUserStatusDrawable
(
status
,
itemView
.
context
)
statusView
.
setImageDrawable
(
statusDrawable
)
}
else
{
statusView
.
setVisible
(
false
)
statusView
.
isVisible
=
false
}
setOnClickListener
{
itemClickListener
?.
onClick
(
item
)
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
016ae737
...
...
@@ -141,7 +141,7 @@ class ChatRoomPresenter @Inject constructor(
broadcast
}
?:
false
view
.
onRoomUpdated
(
userCanPost
,
chatIsBroadcast
,
userCanMod
)
loadMessages
(
roomId
,
roomType
)
loadMessages
(
roomId
,
roomType
,
clearDataSet
=
true
)
chatRoomMessage
?.
let
{
messageHelper
.
messageIdFromPermalink
(
it
)
}
?.
let
{
messageId
->
val
name
=
messageHelper
.
roomNameFromPermalink
(
chatRoomMessage
)
...
...
@@ -719,9 +719,9 @@ class ChatRoomPresenter @Inject constructor(
.
filterNot
{
filterSelfOut
&&
it
.
sender
?.
username
==
self
}
val
activeUsers
=
mutableListOf
<
PeopleSuggestionUiModel
>()
recentMessages
.
forEach
{
val
sender
=
it
.
sender
!!
val
username
=
sender
.
username
?:
""
val
name
=
sender
.
name
?:
""
val
sender
=
it
.
sender
val
username
=
sender
?
.
username
?:
""
val
name
=
sender
?
.
name
?:
""
val
avatarUrl
=
currentServer
.
avatarUrl
(
username
)
val
found
=
members
.
firstOrNull
{
member
->
member
.
username
==
username
}
val
status
=
if
(
found
!=
null
)
found
.
status
else
UserStatus
.
Offline
()
...
...
app/src/main/java/chat/rocket/android/chatroom/uimodel/UiModelMapper.kt
View file @
016ae737
...
...
@@ -85,9 +85,10 @@ class UiModelMapper @Inject constructor(
suspend
fun
map
(
message
:
Message
,
roomUiModel
:
RoomUiModel
=
RoomUiModel
(
roles
=
emptyList
(),
isBroadcast
=
true
)
):
List
<
BaseUiModel
<*
>>
{
return
translate
(
message
,
roomUiModel
)
}
):
List
<
BaseUiModel
<*
>>
=
withContext
(
CommonPool
)
{
return
@withContext
translate
(
message
,
roomUiModel
)
}
suspend
fun
map
(
messages
:
List
<
Message
>,
...
...
app/src/main/java/chat/rocket/android/chatrooms/adapter/RoomUiModelMapper.kt
View file @
016ae737
...
...
@@ -42,27 +42,28 @@ class RoomUiModelMapper(
userInteractor
.
get
()
}
fun
map
(
rooms
:
List
<
ChatRoom
>,
grouped
:
Boolean
=
false
):
List
<
ItemHolder
<*
>>
{
fun
map
(
rooms
:
List
<
ChatRoom
>,
grouped
:
Boolean
=
false
,
showLastMessage
:
Boolean
=
true
):
List
<
ItemHolder
<*
>>
{
val
list
=
ArrayList
<
ItemHolder
<*>>(
rooms
.
size
+
4
)
var
lastType
:
String
?
=
null
rooms
.
forEach
{
room
->
if
(
grouped
&&
lastType
!=
room
.
chatRoom
.
type
)
{
list
.
add
(
HeaderItemHolder
(
roomType
(
room
.
chatRoom
.
type
)))
}
list
.
add
(
RoomItemHolder
(
map
(
room
)))
list
.
add
(
RoomItemHolder
(
map
(
room
,
showLastMessage
)))
lastType
=
room
.
chatRoom
.
type
}
return
list
}
fun
map
(
spotlight
:
SpotlightResult
):
List
<
ItemHolder
<*
>>
{
fun
map
(
spotlight
:
SpotlightResult
,
showLastMessage
:
Boolean
=
true
):
List
<
ItemHolder
<*
>>
{
val
list
=
ArrayList
<
ItemHolder
<*>>(
spotlight
.
users
.
size
+
spotlight
.
rooms
.
size
)
spotlight
.
users
.
filterNot
{
it
.
username
.
isNullOrEmpty
()
}.
forEach
{
user
->
list
.
add
(
RoomItemHolder
(
mapUser
(
user
)))
}
spotlight
.
rooms
.
filterNot
{
it
.
name
.
isNullOrEmpty
()
}.
forEach
{
room
->
list
.
add
(
RoomItemHolder
(
mapRoom
(
room
)))
list
.
add
(
RoomItemHolder
(
mapRoom
(
room
,
showLastMessage
)))
}
return
list
...
...
@@ -86,21 +87,21 @@ class RoomUiModelMapper(
}
}
private
fun
mapRoom
(
room
:
Room
):
RoomUiModel
{
private
fun
mapRoom
(
room
:
Room
,
showLastMessage
:
Boolean
=
true
):
RoomUiModel
{
return
with
(
room
)
{
RoomUiModel
(
id
=
id
,
name
=
name
!!
,
type
=
type
,
avatar
=
serverUrl
.
avatarUrl
(
name
!!
,
isGroupOrChannel
=
true
),
lastMessage
=
mapLastMessage
(
lastMessage
?.
sender
?.
id
,
lastMessage
?.
sender
?.
username
,
lastMessage
=
if
(
showLastMessage
)
{
mapLastMessage
(
lastMessage
?.
sender
?.
id
,
lastMessage
?.
sender
?.
username
,
lastMessage
?.
sender
?.
name
,
lastMessage
?.
message
,
isDirectMessage
=
type
is
RoomType
.
DirectMessage
)
isDirectMessage
=
type
is
RoomType
.
DirectMessage
)
}
else
{
null
}
)
}
}
fun
map
(
chatRoom
:
ChatRoom
):
RoomUiModel
{
fun
map
(
chatRoom
:
ChatRoom
,
showLastMessage
:
Boolean
=
true
):
RoomUiModel
{
return
with
(
chatRoom
.
chatRoom
)
{
val
isUnread
=
alert
||
unread
>
0
val
type
=
roomTypeOf
(
type
)
...
...
@@ -113,9 +114,9 @@ class RoomUiModelMapper(
serverUrl
.
avatarUrl
(
name
,
isGroupOrChannel
=
true
)
}
val
unread
=
mapUnread
(
unread
)
val
lastMessage
=
mapLastMessage
(
lastMessageUserId
,
chatRoom
.
lastMessageUserName
,
val
lastMessage
=
if
(
showLastMessage
)
{
mapLastMessage
(
lastMessageUserId
,
chatRoom
.
lastMessageUserName
,
chatRoom
.
lastMessageUserFullName
,
lastMessageText
,
isUnread
,
type
is
RoomType
.
DirectMessage
)
type
is
RoomType
.
DirectMessage
)
}
else
{
null
}
val
open
=
open
RoomUiModel
(
...
...
@@ -148,6 +149,7 @@ class RoomUiModelMapper(
private
fun
mapLastMessage
(
userId
:
String
?,
name
:
String
?,
fullName
:
String
?,
text
:
String
?,
unread
:
Boolean
=
false
,
isDirectMessage
:
Boolean
=
false
):
CharSequence
?
{
return
if
(!
settings
.
showLastMessage
())
{
null
}
else
if
(
name
!=
null
&&
text
!=
null
)
{
...
...
app/src/main/java/chat/rocket/android/chatrooms/adapter/RoomViewHolder.kt
View file @
016ae737
...
...
@@ -11,6 +11,7 @@ import chat.rocket.common.model.RoomType
import
chat.rocket.common.model.UserStatus
import
kotlinx.android.synthetic.main.item_chat.view.*
import
kotlinx.android.synthetic.main.unread_messages_badge.view.*
import
ru.noties.markwon.Markwon
class
RoomViewHolder
(
itemView
:
View
,
private
val
listener
:
(
RoomUiModel
)
->
Unit
)
:
ViewHolder
<
RoomItemHolder
>(
itemView
)
{
...
...
@@ -32,7 +33,7 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
if
(
room
.
lastMessage
!=
null
)
{
text_last_message
.
isVisible
=
true
text_last_message
.
text
=
room
.
lastMessage
text_last_message
.
text
=
Markwon
.
markdown
(
context
,
room
.
lastMessage
.
toString
()).
toString
()
}
else
{
text_last_message
.
isGone
=
true
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsAdapter.kt
View file @
016ae737
...
...
@@ -12,6 +12,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.core.view.isVisible
import
chat.rocket.android.R
import
chat.rocket.android.infrastructure.LocalRepository
import
chat.rocket.android.infrastructure.checkIfMyself
...
...
@@ -53,13 +54,13 @@ class ChatRoomsAdapter(
bindName
(
chatRoom
,
text_chat_name
)
bindIcon
(
chatRoom
,
image_chat_icon
)
if
(
settings
.
showLastMessage
())
{
text_last_message
.
setVisible
(
true
)
text_last_message_date_time
.
setVisible
(
true
)
text_last_message
.
isVisible
=
true
text_last_message_date_time
.
isVisible
=
true
bindLastMessageDateTime
(
chatRoom
,
text_last_message_date_time
)
bindLastMessage
(
chatRoom
,
text_last_message
)
}
else
{
text_last_message
.
setVisible
(
false
)
text_last_message_date_time
.
setVisible
(
false
)
text_last_message
.
isVisible
=
false
text_last_message_date_time
.
isVisible
=
false
}
bindUnreadMessages
(
chatRoom
,
text_total_unread_messages
)
...
...
@@ -178,13 +179,13 @@ class ChatRoomsAdapter(
when
{
totalUnreadMessage
in
1
..
99
->
{
textView
.
textContent
=
totalUnreadMessage
.
toString
()
textView
.
setVisible
(
true
)
textView
.
isVisible
=
true
}
totalUnreadMessage
>
99
->
{
textView
.
textContent
=
context
.
getString
(
R
.
string
.
msg_more_than_ninety_nine_unread_messages
)
textView
.
setVisible
(
true
)
textView
.
isVisible
=
true
}
else
->
textView
.
setVisible
(
false
)
else
->
textView
.
isVisible
=
false
}
}
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
016ae737
...
...
@@ -178,11 +178,14 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
override
fun
onMenuItemActionCollapse
(
item
:
MenuItem
):
Boolean
{
// Simply setting sortView to visible won't work, so we invalidate the options
// to recreate the entire menu...
viewModel
.
showLastMessage
=
true
activity
?.
invalidateOptionsMenu
()
queryChatRoomsByName
(
null
)
return
true
}
override
fun
onMenuItemActionExpand
(
item
:
MenuItem
):
Boolean
{
viewModel
.
showLastMessage
=
false
sortView
?.
isVisible
=
false
return
true
}
...
...
app/src/main/java/chat/rocket/android/chatrooms/viewmodel/ChatRoomsViewModel.kt
View file @
016ae737
...
...
@@ -30,6 +30,7 @@ import timber.log.Timber
import
java.security.InvalidParameterException
import
kotlin.coroutines.experimental.coroutineContext
class
ChatRoomsViewModel
(
private
val
connectionManager
:
ConnectionManager
,
private
val
interactor
:
FetchChatRoomsInteractor
,
...
...
@@ -41,9 +42,11 @@ class ChatRoomsViewModel(
private
val
runContext
=
newSingleThreadContext
(
"chat-rooms-view-model"
)
private
val
client
=
connectionManager
.
client
private
var
loaded
=
false
var
showLastMessage
=
true
fun
getChatRooms
():
LiveData
<
RoomsModel
>
{
return
Transformations
.
switchMap
(
query
)
{
query
->
return
@switchMap
if
(
query
.
isSearch
())
{
this
@ChatRoomsViewModel
.
query
.
wrap
(
runContext
)
{
_
,
data
:
MutableLiveData
<
RoomsModel
>
->
val
string
=
(
query
as
Query
.
Search
).
query
...
...
@@ -53,11 +56,13 @@ class ChatRoomsViewModel(
// TODO - find a better way for cancellation checking
if
(!
coroutineContext
.
isActive
)
return
@wrap
val
rooms
=
repository
.
search
(
string
).
let
{
mapper
.
map
(
it
)
}
val
rooms
=
repository
.
search
(
string
).
let
{
mapper
.
map
(
it
,
showLastMessage
=
this
.
showLastMessage
)
}
data
.
postValue
(
rooms
.
toMutableList
()
+
LoadingItemHolder
())
if
(!
coroutineContext
.
isActive
)
return
@wrap
val
spotlight
=
spotlight
(
query
.
query
)
?.
let
{
mapper
.
map
(
it
)
}
val
spotlight
=
spotlight
(
query
.
query
)
?.
let
{
mapper
.
map
(
it
,
showLastMessage
=
this
.
showLastMessage
)
}
if
(!
coroutineContext
.
isActive
)
return
@wrap
spotlight
?.
let
{
...
...
@@ -72,7 +77,7 @@ class ChatRoomsViewModel(
.
distinct
()
.
transform
(
runContext
)
{
rooms
->
val
mappedRooms
=
rooms
?.
let
{
mapper
.
map
(
rooms
,
query
.
isGrouped
())
mapper
.
map
(
rooms
,
query
.
isGrouped
()
,
this
.
showLastMessage
)
}
if
(
loaded
&&
mappedRooms
?.
isEmpty
()
==
true
)
{
loadingState
.
postValue
(
LoadingState
.
Loaded
(
0
))
...
...
app/src/main/java/chat/rocket/android/dagger/module/ActivityBuilder.kt
View file @
016ae737
...
...
@@ -35,6 +35,7 @@ import chat.rocket.android.server.ui.ChangeServerActivity
import
chat.rocket.android.settings.di.SettingsFragmentProvider
import
chat.rocket.android.settings.password.di.PasswordFragmentProvider
import
chat.rocket.android.settings.password.ui.PasswordActivity
import
chat.rocket.android.webview.adminpanel.di.AdminPanelWebViewFragmentProvider
import
dagger.Module
import
dagger.android.ContributesAndroidInjector
...
...
@@ -64,7 +65,8 @@ abstract class ActivityBuilder {
ProfileFragmentProvider
::
class
,
SettingsFragmentProvider
::
class
,
AboutFragmentProvider
::
class
,
PreferencesFragmentProvider
::
class
PreferencesFragmentProvider
::
class
,
AdminPanelWebViewFragmentProvider
::
class
]
)
abstract
fun
bindMainActivity
():
MainActivity
...
...
app/src/main/java/chat/rocket/android/db/MessageDao.kt
View file @
016ae737
...
...
@@ -25,25 +25,25 @@ abstract class MessageDao {
@Insert
abstract
fun
insert
(
message
:
MessageEntity
)
@Insert
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
insert
(
relation
:
MessageFavoritesRelation
)
@Insert
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
insert
(
relation
:
MessageMentionsRelation
)
@Insert
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
insert
(
relation
:
MessageChannels
)
@Insert
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
insert
(
attachment
:
AttachmentEntity
)
@Insert
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
insert
(
field
:
AttachmentFieldEntity
)
@Insert
(
onConflict
=
OnConflictStrategy
.
IGNORE
)
abstract
fun
insert
(
reaction
:
ReactionEntity
)
@Insert
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
insert
(
url
:
UrlEntity
)
@Query
(
"DELETE FROM messages WHERE id = :id"
)
...
...
@@ -159,7 +159,7 @@ abstract class MessageDao {
internal
fun
retrieveFullMessage
(
message
:
PartialMessage
):
FullMessage
{
val
favorites
=
getFavoritesByMessage
(
message
.
message
.
id
)
val
mentions
=
get
Favorite
sByMessage
(
message
.
message
.
id
)
val
mentions
=
get
Mention
sByMessage
(
message
.
message
.
id
)
return
FullMessage
(
message
,
favorites
,
mentions
)
}
...
...
app/src/main/java/chat/rocket/android/helper/MessageParser.kt
View file @
016ae737
...
...
@@ -10,9 +10,9 @@ import android.text.Spanned
import
android.text.style.ClickableSpan
import
android.text.style.ImageSpan
import
android.text.style.ReplacementSpan
import
android.util.Patterns
import
android.view.View
import
androidx.core.content.res.ResourcesCompat
import
androidx.core.util.PatternsCompat
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.ui.StrikethroughDelimiterProcessor
import
chat.rocket.android.emoji.EmojiParser
...
...
@@ -33,7 +33,6 @@ import org.commonmark.node.ListItem
import
org.commonmark.node.Node
import
org.commonmark.node.OrderedList
import
org.commonmark.node.StrongEmphasis
import
org.commonmark.node.Text
import
org.commonmark.parser.Parser
import
ru.noties.markwon.SpannableBuilder
import
ru.noties.markwon.SpannableConfiguration
...
...
@@ -116,6 +115,7 @@ class MessageParser @Inject constructor(
}
class
StrongEmphasisVisitor
:
AbstractVisitor
()
{
override
fun
visit
(
strongEmphasis
:
StrongEmphasis
)
{
if
(
strongEmphasis
.
openingDelimiter
==
"__"
&&
strongEmphasis
.
firstChild
!=
null
)
{
val
child
=
strongEmphasis
.
firstChild
...
...
@@ -146,7 +146,7 @@ class MessageParser @Inject constructor(
var
offset
=
0
mentions
.
forEach
{
val
mentionMe
=
it
==
currentUser
||
it
==
"@all"
||
it
==
"@here"
val
mentionMe
=
it
==
"@$currentUser"
||
it
==
"@all"
||
it
==
"@here"
offset
=
text
.
indexOf
(
string
=
it
,
startIndex
=
offset
,
ignoreCase
=
false
)
while
(
offset
>
-
1
)
{
val
textColor
=
if
(
mentionMe
)
myselfTextColor
else
othersTextColor
...
...
@@ -223,9 +223,9 @@ class MessageParser @Inject constructor(
class
LinkVisitor
(
private
val
builder
:
SpannableBuilder
)
:
AbstractVisitor
()
{
override
fun
visit
(
text
:
Tex
t
)
{
override
fun
visit
(
document
:
Documen
t
)
{
// Replace all url links to markdown url syntax.
val
matcher
=
Patterns
.
WEB_URL
.
matcher
(
builder
.
text
())
val
matcher
=
Patterns
Compat
.
AUTOLINK_
WEB_URL
.
matcher
(
builder
.
text
())
val
consumed
=
mutableListOf
<
String
>()
while
(
matcher
.
find
())
{
...
...
app/src/main/java/chat/rocket/android/members/ui/MembersFragment.kt
View file @
016ae737
...
...
@@ -66,6 +66,7 @@ class MembersFragment : Fragment(), MembersView {
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
setupToolbar
()
setupRecyclerView
()
presenter
.
loadChatRoomsMembers
(
chatRoomId
)
...
...
@@ -125,9 +126,13 @@ class MembersFragment : Fragment(), MembersView {
}
}
private
fun
setupToolbar
(
totalMembers
:
Long
)
{
private
fun
setupToolbar
(
totalMembers
:
Long
?
=
null
)
{
(
activity
as
ChatRoomActivity
).
let
{
it
.
showToolbarTitle
(
getString
(
R
.
string
.
title_members
,
totalMembers
))
if
(
totalMembers
!=
null
)
{
it
.
showToolbarTitle
(
getString
(
R
.
string
.
title_counted_members
,
totalMembers
))
}
else
{
it
.
showToolbarTitle
(
getString
(
R
.
string
.
title_members
))
}
it
.
hideToolbarChatRoomIcon
()
}
}
...
...
app/src/main/java/chat/rocket/android/server/presentation/CheckServerPresenter.kt
View file @
016ae737
...
...
@@ -124,166 +124,174 @@ abstract class CheckServerPresenter constructor(
if
(
services
.
isNotEmpty
())
{
state
=
OauthHelper
.
getState
()
checkEnabledOauthAccounts
(
services
,
serverUrl
)
checkEnabledCasAccounts
(
serverUrl
)
checkEnabledCustomOauthAccounts
(
services
,
serverUrl
)
checkEnabledSamlAccounts
(
services
,
serverUrl
)
}
}
catch
(
exception
:
RocketChatException
)
{
Timber
.
e
(
exception
)
}
}
// OAuth accounts.
if
(
settings
.
isFacebookAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_FACEBOOK
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
facebookOauthUrl
=
OauthHelper
.
getFacebookOauthUrl
(
clientId
,
serverUrl
,
state
)
totalSocialAccountsEnabled
++
}
}
private
fun
checkEnabledOauthAccounts
(
services
:
List
<
Map
<
String
,
Any
>>,
serverUrl
:
String
)
{
if
(
settings
.
isFacebookAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_FACEBOOK
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
facebookOauthUrl
=
OauthHelper
.
getFacebookOauthUrl
(
clientId
,
serverUrl
,
state
)
totalSocialAccountsEnabled
++
}
}
}
if
(
settings
.
isGithubAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_GITHUB
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
githubOauthUrl
=
OauthHelper
.
getGithubOauthUrl
(
clientId
,
state
)
totalSocialAccountsEnabled
++
}
}
if
(
settings
.
isGithubAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_GITHUB
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
githubOauthUrl
=
OauthHelper
.
getGithubOauthUrl
(
clientId
,
state
)
totalSocialAccountsEnabled
++
}
}
}
if
(
settings
.
isGoogleAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_GOOGLE
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
googleOauthUrl
=
OauthHelper
.
getGoogleOauthUrl
(
clientId
,
serverUrl
,
state
)
totalSocialAccountsEnabled
++
}
}
if
(
settings
.
isGoogleAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_GOOGLE
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
googleOauthUrl
=
OauthHelper
.
getGoogleOauthUrl
(
clientId
,
serverUrl
,
state
)
totalSocialAccountsEnabled
++
}
}
}
if
(
settings
.
isLinkedinAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_LINKEDIN
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
linkedinOauthUrl
=
OauthHelper
.
getLinkedinOauthUrl
(
clientId
,
serverUrl
,
state
)
totalSocialAccountsEnabled
++
}
}
}
if
(
settings
.
isLinkedinAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_LINKEDIN
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
linkedinOauthUrl
=
OauthHelper
.
getLinkedinOauthUrl
(
clientId
,
serverUrl
,
state
)
totalSocialAccountsEnabled
++
}
if
(
settings
.
isGitlabAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_GILAB
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
gitlabOauthUrl
=
if
(
settings
.
gitlabUrl
()
!=
null
)
{
OauthHelper
.
getGitlabOauthUrl
(
host
=
settings
.
gitlabUrl
(),
clientId
=
clientId
,
serverUrl
=
serverUrl
,
state
=
state
)
}
else
{
OauthHelper
.
getGitlabOauthUrl
(
clientId
=
clientId
,
serverUrl
=
serverUrl
,
state
=
state
)
}
totalSocialAccountsEnabled
++
}
}
}
if
(
settings
.
isGitlab
AuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_GILAB
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
gitlabOauthUrl
=
if
(
settings
.
gitlabUrl
()
!=
null
)
{
OauthHelper
.
getGitlabOauthUrl
(
host
=
settings
.
gitlabUrl
(),
clientId
=
clientId
,
serverUrl
=
serverUrl
,
state
=
state
if
(
settings
.
isWordpress
AuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_WORDPRESS
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
wordpressOauthUrl
=
if
(
settings
.
wordpressUrl
().
isNullOrEmpty
())
{
OauthHelper
.
getWordpressComOauthUrl
(
clientId
,
serverUrl
,
state
)
}
else
{
OauthHelper
.
getGitlabOauthUrl
(
clientId
=
clientId
,
serverUrl
=
serverUrl
,
state
=
state
OauthHelper
.
getWordpressCustomOauthUrl
(
getCustomOauthHost
(
serviceMap
)
?:
"https://public-api.wordpress.com"
,
getCustomOauthAuthorizePath
(
serviceMap
)
?:
"/oauth/authorize"
,
clientId
,
serverUrl
,
SERVICE_NAME_WORDPRESS
,
state
,
getCustomOauthScope
(
serviceMap
)
?:
"openid"
)
}
totalSocialAccountsEnabled
++
}
}
totalSocialAccountsEnabled
++
}
}
}
}
if
(
settings
.
isWordpressAuthenticationEnabled
())
{
getServiceMap
(
services
,
SERVICE_NAME_WORDPRESS
)
?.
let
{
serviceMap
->
getOauthClientId
(
serviceMap
)
?.
let
{
clientId
->
wordpressOauthUrl
=
if
(
settings
.
wordpressUrl
().
isNullOrEmpty
())
{
OauthHelper
.
getWordpressComOauthUrl
(
clientId
,
serverUrl
,
state
)
}
else
{
OauthHelper
.
getWordpressCustomOauthUrl
(
getCustomOauthHost
(
serviceMap
)
?:
"https://public-api.wordpress.com"
,
getCustomOauthAuthorizePath
(
serviceMap
)
?:
"/oauth/authorize"
,
clientId
,
serverUrl
,
SERVICE_NAME_WORDPRESS
,
state
,
getCustomOauthScope
(
serviceMap
)
?:
"openid"
)
}
totalSocialAccountsEnabled
++
}
}
}
private
fun
checkEnabledCasAccounts
(
serverUrl
:
String
)
{
if
(
settings
.
isCasAuthenticationEnabled
())
{
casToken
=
generateRandomString
(
17
)
casLoginUrl
=
settings
.
casLoginUrl
().
casUrl
(
serverUrl
,
casToken
.
toString
())
totalSocialAccountsEnabled
++
}
}
// CAS account.
if
(
settings
.
isCasAuthenticationEnabled
())
{
casToken
=
generateRandomString
(
17
)
casLoginUrl
=
settings
.
casLoginUrl
().
casUrl
(
serverUrl
,
casToken
.
toString
())
private
fun
checkEnabledCustomOauthAccounts
(
services
:
List
<
Map
<
String
,
Any
>>,
serverUrl
:
String
)
{
getCustomOauthServices
(
services
).
let
{
for
(
serviceMap
in
it
)
{
customOauthServiceName
=
getCustomOauthServiceName
(
serviceMap
)
val
host
=
getCustomOauthHost
(
serviceMap
)
val
authorizePath
=
getCustomOauthAuthorizePath
(
serviceMap
)
val
clientId
=
getOauthClientId
(
serviceMap
)
val
scope
=
getCustomOauthScope
(
serviceMap
)
val
serviceNameTextColor
=
getServiceNameColorForCustomOauthOrSaml
(
serviceMap
)
val
serviceButtonColor
=
getServiceButtonColor
(
serviceMap
)
if
(
customOauthServiceName
!=
null
&&
host
!=
null
&&
authorizePath
!=
null
&&
clientId
!=
null
&&
scope
!=
null
&&
serviceNameTextColor
!=
null
&&
serviceButtonColor
!=
null
)
{
customOauthUrl
=
OauthHelper
.
getCustomOauthUrl
(
host
,
authorizePath
,
clientId
,
serverUrl
,
customOauthServiceName
.
toString
(),
state
,
scope
)
customOauthServiceNameTextColor
=
serviceNameTextColor
customOauthServiceButtonColor
=
serviceButtonColor
totalSocialAccountsEnabled
++
}
}
}
}
// Custom OAuth account.
getCustomOauthServices
(
services
).
let
{
for
(
serviceMap
in
it
)
{
customOauthServiceName
=
getCustomOauthServiceName
(
serviceMap
)
val
host
=
getCustomOauthHost
(
serviceMap
)
val
authorizePath
=
getCustomOauthAuthorizePath
(
serviceMap
)
val
clientId
=
getOauthClientId
(
serviceMap
)
val
scope
=
getCustomOauthScope
(
serviceMap
)
val
serviceNameTextColor
=
getServiceNameColorForCustomOauthOrSaml
(
serviceMap
)
val
serviceButtonColor
=
getServiceButtonColor
(
serviceMap
)
if
(
customOauthServiceName
!=
null
&&
host
!=
null
&&
authorizePath
!=
null
&&
clientId
!=
null
&&
scope
!=
null
&&
serviceNameTextColor
!=
null
&&
serviceButtonColor
!=
null
)
{
customOauthUrl
=
OauthHelper
.
getCustomOauthUrl
(
host
,
authorizePath
,
clientId
,
serverUrl
,
customOauthServiceName
.
toString
(),
state
,
scope
)
customOauthServiceNameTextColor
=
serviceNameTextColor
customOauthServiceButtonColor
=
serviceButtonColor
totalSocialAccountsEnabled
++
}
}
}
// SAML account.
getSamlServices
(
services
).
let
{
samlToken
=
generateRandomString
(
17
)
for
(
serviceMap
in
it
)
{
val
provider
=
getSamlProvider
(
serviceMap
)
samlServiceName
=
getSamlServiceName
(
serviceMap
)
val
serviceNameTextColor
=
getServiceNameColorForCustomOauthOrSaml
(
serviceMap
)
val
serviceButtonColor
=
getServiceButtonColor
(
serviceMap
)
if
(
provider
!=
null
&&
samlServiceName
!=
null
&&
serviceNameTextColor
!=
null
&&
serviceButtonColor
!=
null
)
{
samlUrl
=
serverUrl
.
samlUrl
(
provider
,
samlToken
.
toString
())
samlServiceNameTextColor
=
serviceNameTextColor
samlServiceButtonColor
=
serviceButtonColor
totalSocialAccountsEnabled
++
}
}
private
fun
checkEnabledSamlAccounts
(
services
:
List
<
Map
<
String
,
Any
>>,
serverUrl
:
String
)
{
getSamlServices
(
services
).
let
{
samlToken
=
generateRandomString
(
17
)
for
(
serviceMap
in
it
)
{
val
provider
=
getSamlProvider
(
serviceMap
)
samlServiceName
=
getSamlServiceName
(
serviceMap
)
val
serviceNameTextColor
=
getServiceNameColorForCustomOauthOrSaml
(
serviceMap
)
val
serviceButtonColor
=
getServiceButtonColor
(
serviceMap
)
if
(
provider
!=
null
&&
samlServiceName
!=
null
&&
serviceNameTextColor
!=
null
&&
serviceButtonColor
!=
null
)
{
samlUrl
=
serverUrl
.
samlUrl
(
provider
,
samlToken
.
toString
())
samlServiceNameTextColor
=
serviceNameTextColor
samlServiceButtonColor
=
serviceButtonColor
totalSocialAccountsEnabled
++
}
}
}
catch
(
exception
:
RocketChatException
)
{
Timber
.
e
(
exception
)
}
}
...
...
app/src/main/java/chat/rocket/android/util/extensions/Ui.kt
View file @
016ae737
...
...
@@ -37,19 +37,6 @@ fun FragmentActivity.clearLightStatusBar() {
}
}
// TODO: Remove. Use KTX instead.
fun
View
.
setVisible
(
visible
:
Boolean
)
{
visibility
=
if
(
visible
)
{
View
.
VISIBLE
}
else
{
View
.
GONE
}
}
fun
View
.
isVisible
():
Boolean
{
return
visibility
==
View
.
VISIBLE
}
fun
ViewGroup
.
inflate
(
@LayoutRes
resource
:
Int
,
attachToRoot
:
Boolean
=
false
):
View
=
LayoutInflater
.
from
(
context
).
inflate
(
resource
,
this
,
attachToRoot
)
...
...
app/src/main/java/chat/rocket/android/webview/adminpanel/di/AdminPanelWebViewFragmentProvider.kt
0 → 100644
View file @
016ae737
package
chat.rocket.android.webview.adminpanel.di
import
chat.rocket.android.webview.adminpanel.ui.AdminPanelWebViewFragment
import
dagger.Module
import
dagger.android.ContributesAndroidInjector
@Module
abstract
class
AdminPanelWebViewFragmentProvider
{
@ContributesAndroidInjector
abstract
fun
provideAdminPanelWebViewFragment
():
AdminPanelWebViewFragment
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/webview/adminpanel/ui/AdminPanelWebViewFragment.kt
View file @
016ae737
...
...
@@ -8,18 +8,22 @@ import android.view.ViewGroup
import
android.webkit.WebView
import
android.webkit.WebViewClient
import
androidx.appcompat.app.AppCompatActivity
import
androidx.fragment.app.Fragment
import
chat.rocket.android.R
import
chat.rocket.android.analytics.AnalyticsManager
import
chat.rocket.android.util.extensions.inflate
import
chat.rocket.android.util.extensions.ui
import
dagger.android.support.DaggerFragment
import
kotlinx.android.synthetic.main.fragment_admin_panel_web_view.*
import
javax.inject.Inject
private
const
val
BUNDLE_WEB_PAGE_URL
=
"web_page_url"
private
const
val
BUNDLE_USER_TOKEN
=
"user_token"
class
AdminPanelWebViewFragment
:
Fragment
()
{
class
AdminPanelWebViewFragment
:
Dagger
Fragment
()
{
private
lateinit
var
webPageUrl
:
String
private
lateinit
var
userToken
:
String
@Inject
lateinit
var
analyticsManager
:
AnalyticsManager
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -42,6 +46,8 @@ class AdminPanelWebViewFragment : Fragment() {
super
.
onViewCreated
(
view
,
savedInstanceState
)
setupToolbar
()
setupWebView
()
analyticsManager
.
logOpenAdmin
()
}
private
fun
setupToolbar
()
{
...
...
app/src/main/res/layout/fragment_authentication_login_options.xml
View file @
016ae737
...
...
@@ -9,19 +9,22 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Linear
Layout
android:id=
"@+id/accounts_container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:visibility=
"gone"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
>
<Button
android:id=
"@+id/button_facebook"
style=
"?borderlessButtonStyle"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"48dp"
android:background=
"@drawable/rounded_border"
android:clickable=
"false"
...
...
@@ -34,15 +37,12 @@
android:textColor=
"@color/colorPrimary"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
/>
<Button
android:id=
"@+id/button_github"
style=
"?borderlessButtonStyle"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"48dp"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rounded_border"
...
...
@@ -56,15 +56,12 @@
android:textColor=
"@color/colorPrimary"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button_facebook"
tools:visibility=
"visible"
/>
<Button
android:id=
"@+id/button_google"
style=
"?borderlessButtonStyle"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"48dp"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rounded_border"
...
...
@@ -78,15 +75,12 @@
android:textColor=
"@color/colorPrimary"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button_github"
tools:visibility=
"visible"
/>
<Button
android:id=
"@+id/button_linkedin"
style=
"?borderlessButtonStyle"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"48dp"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rounded_border"
...
...
@@ -100,15 +94,12 @@
android:textColor=
"@color/colorPrimary"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button_google"
tools:visibility=
"visible"
/>
<Button
android:id=
"@+id/button_gitlab"
style=
"?borderlessButtonStyle"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"48dp"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rounded_border"
...
...
@@ -122,15 +113,12 @@
android:textColor=
"@color/colorPrimary"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button_linkedin"
tools:visibility=
"visible"
/>
<Button
android:id=
"@+id/button_wordpress"
style=
"?borderlessButtonStyle"
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"48dp"
android:layout_marginTop=
"10dp"
android:background=
"@drawable/rounded_border"
...
...
@@ -144,9 +132,6 @@
android:textColor=
"@color/colorPrimary"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button_gitlab"
tools:visibility=
"visible"
/>
<Button
...
...
@@ -156,11 +141,8 @@
android:clickable=
"false"
android:text=
"@string/action_login_or_sign_up"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/button_wordpress"
tools:visibility=
"visible"
/>
</
androidx.constraintlayout.widget.Constraint
Layout>
</
Linear
Layout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/expand_more_accounts_container"
...
...
app/src/main/res/layout/item_actions_attachment.xml
View file @
016ae737
...
...
@@ -21,6 +21,7 @@
android:layout_marginStart=
"56dp"
android:layout_marginTop=
"2dp"
android:textDirection=
"locale"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
tools:text=
"This is a multiline chat message from Bertie that will take more than just one line of text. I have sure that everything is amazing!"
/>
...
...
app/src/main/res/values-de/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
Legal Terms
</string>
<string
name=
"title_chats"
>
Chats
</string>
<string
name=
"title_profile"
>
Profil
</string>
<string
name=
"title_members"
>
Benutzer (%d)
</string>
<string
name=
"title_members"
>
Benutzer
</string>
<string
name=
"title_counted_members"
>
Benutzer (%d)
</string>
<string
name=
"title_settings"
>
Einstellungen
</string>
<string
name=
"title_preferences"
>
Preferences
</string>
<!-- TODO Add translation -->
<string
name=
"title_change_password"
>
Ändere Passwort
</string>
...
...
app/src/main/res/values-es/strings.xml
View file @
016ae737
...
...
@@ -9,7 +9,8 @@
<string
name=
"title_legal_terms"
>
Términos legales
</string>
<string
name=
"title_chats"
>
Chats
</string>
<string
name=
"title_profile"
>
Perfil
</string>
<string
name=
"title_members"
>
Miembros (%d)
</string>
<string
name=
"title_members"
>
Miembros
</string>
<string
name=
"title_counted_members"
>
Miembros (%d)
</string>
<string
name=
"title_settings"
>
Configuraciones
</string>
<string
name=
"title_preferences"
>
Preferences
</string>
<!-- TODO Add translation -->
<string
name=
"title_change_password"
>
Cambia la contraseña
</string>
...
...
app/src/main/res/values-fr/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
Termes juridiques
</string>
<string
name=
"title_chats"
>
Chats
</string>
<string
name=
"title_profile"
>
Profil
</string>
<string
name=
"title_members"
>
Membres (%d)
</string>
<string
name=
"title_members"
>
Membres
</string>
<string
name=
"title_counted_members"
>
Membres (%d)
</string>
<string
name=
"title_settings"
>
Paramètres
</string>
<string
name=
"title_preferences"
>
Préférences
</string>
<string
name=
"title_change_password"
>
Changer le mot de passe
</string>
...
...
app/src/main/res/values-hi-rIN/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
कानूनी शर्तें
</string>
<string
name=
"title_chats"
>
चैट
</string>
<string
name=
"title_profile"
>
प्रोफाइल
</string>
<string
name=
"title_members"
>
सदस्य (%d)
</string>
<string
name=
"title_members"
>
सदस्य
</string>
<string
name=
"title_counted_members"
>
सदस्य (%d)
</string>
<string
name=
"title_settings"
>
सेटिंग्स
</string>
<string
name=
"title_preferences"
>
प्राथमिकताएँ
</string>
<string
name=
"title_change_password"
>
पासवर्ड बदलें
</string>
...
...
@@ -91,7 +92,7 @@
<string
name=
"msg_content_description_log_in_using_gitlab"
>
Gitlab द्वारा लॉगिन करें
</string>
<string
name=
"msg_content_description_log_in_using_wordpress"
>
WordPress द्वारा लॉगिन करें
</string>
<string
name=
"msg_content_description_send_message"
>
मेसेज भेजें
</string>
<string
name=
"msg_content_description_show_more_login_options"
>
Show more login options
</string>
<!-- TODO Translate--
>
<string
name=
"msg_content_description_show_more_login_options"
>
अधिक लॉगिन विकल्प दिखाएं
</string
>
<string
name=
"msg_content_description_show_attachment_options"
>
अटैचमेंट विकल्प दिखाएं
</string>
<string
name=
"msg_you"
>
आप
</string>
<string
name=
"msg_unknown"
>
अनजान
</string>
...
...
@@ -160,10 +161,8 @@
<string
name=
"msg_member_already_added"
>
आपने पहले से ही इस यूजर को चुन चुके है।
</string>
<string
name=
"msg_member_not_found"
>
सदस्य नहीं मिला
</string>
<string
name=
"msg_channel_created_successfully"
>
चैनल सफलतापूर्वक बनाया गया
</string>
<!-- TODO - Add proper translation -->
<string
name=
"msg_view_more"
>
view more
</string>
<!-- TODO - Add proper translation -->
<string
name=
"msg_view_less"
>
view less
</string>
<string
name=
"msg_view_more"
>
और देखें
</string>
<string
name=
"msg_view_less"
>
कम देखें
</string>
<!-- Preferences messages -->
<string
name=
"msg_analytics_tracking"
>
एनालिटिक्स ट्रैकिंग
</string>
...
...
@@ -306,6 +305,5 @@
<string
name=
"read_by"
>
द्वारा पढ़ें
</string>
<string
name=
"message_information_title"
>
संदेश की जानकारी
</string>
<string
name=
"msg_log_out"
>
लॉग आउट कर रहा हूं…
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<string
name=
"message_room_changed_privacy"
>
%2$s ने रूम का प्रकार बदलकर %1$s किया
</string>
</resources>
app/src/main/res/values-ja/strings.xml
View file @
016ae737
...
...
@@ -12,7 +12,8 @@
<string
name=
"title_legal_terms"
>
Legal Terms
</string>
<string
name=
"title_chats"
>
チャット
</string>
<string
name=
"title_profile"
>
プロフィール
</string>
<string
name=
"title_members"
>
メンバー (%d)
</string>
<string
name=
"title_members"
>
メンバー
</string>
<string
name=
"title_counted_members"
>
メンバー (%d)
</string>
<string
name=
"title_settings"
>
設定
</string>
<string
name=
"title_preferences"
>
Preferences
</string>
<!-- TODO Add translation -->
<string
name=
"title_change_password"
>
Change Password
</string>
<!-- TODO Add translation -->
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
Termos Legais
</string>
<string
name=
"title_chats"
>
Chats
</string>
<string
name=
"title_profile"
>
Perfil
</string>
<string
name=
"title_members"
>
Membros (%d)
</string>
<string
name=
"title_members"
>
Membros
</string>
<string
name=
"title_counted_members"
>
Membros (%d)
</string>
<string
name=
"title_settings"
>
Configurações
</string>
<string
name=
"title_preferences"
>
Preferencias
</string>
<string
name=
"title_change_password"
>
Alterar senha
</string>
...
...
app/src/main/res/values-ru-rRU/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
Юридические условия
</string>
<string
name=
"title_chats"
>
Чаты
</string>
<string
name=
"title_profile"
>
Профиль
</string>
<string
name=
"title_members"
>
Пользователи (%d)
</string>
<string
name=
"title_members"
>
Пользователи
</string>
<string
name=
"title_counted_members"
>
Пользователи (%d)
</string>
<string
name=
"title_settings"
>
Настройки
</string>
<string
name=
"title_preferences"
>
Персональные
</string>
<string
name=
"title_change_password"
>
Изменить пароль
</string>
...
...
@@ -45,11 +46,11 @@
<string
name=
"action_select_photo_from_gallery"
>
Выбрать из галереи
</string>
<string
name=
"action_take_photo"
>
Сделать снимок
</string>
<string
name=
"action_reset_avatar"
>
Восстановить аватар
</string>
<string
name=
"action_connect_server"
>
Connect with a server
</string>
<!-- TODO Add translation --
>
<string
name=
"action_join_community"
>
Join in the community
</string>
<!-- TODO Add translation --
>
<string
name=
"action_create_server"
>
Create a new server
</string>
<!-- TODO Add translation --
>
<string
name=
"action_register"
>
Register
</string>
<!-- TODO Add translation --
>
<string
name=
"action_confirm"
>
Confirm
</string>
<!-- TODO Add translation --
>
<string
name=
"action_connect_server"
>
Соединиться с сервером
</string
>
<string
name=
"action_join_community"
>
Сообщество
</string
>
<string
name=
"action_create_server"
>
Создать новый сервер
</string
>
<string
name=
"action_register"
>
Зарегистрировать
</string
>
<string
name=
"action_confirm"
>
Подтвердить
</string
>
<!-- Settings List -->
<string-array
name=
"settings_actions"
>
...
...
@@ -91,7 +92,7 @@
<string
name=
"msg_content_description_log_in_using_gitlab"
>
Войти с помощью Gitlab
</string>
<string
name=
"msg_content_description_log_in_using_wordpress"
>
Войти с помощью WordPress
</string>
<string
name=
"msg_content_description_send_message"
>
Отправить сообщение
</string>
<string
name=
"msg_content_description_show_more_login_options"
>
Show more login options
</string>
<!-- TODO Translate--
>
<string
name=
"msg_content_description_show_more_login_options"
>
Больше параметров входа
</string
>
<string
name=
"msg_content_description_show_attachment_options"
>
Показать параметры вложения
</string>
<string
name=
"msg_you"
>
Вы
</string>
<string
name=
"msg_unknown"
>
Неизвестный
</string>
...
...
@@ -133,18 +134,18 @@
<string
name=
"msg_delete_description"
>
Вы уверены, что хотите удалить это сообщение?
</string>
<string
name=
"msg_channel_name"
>
Название канала
</string>
<string
name=
"msg_search"
>
Поиск
</string>
<string
name=
"msg_welcome_to_rocket_chat"
>
Welcome to Rocket.Chat
</string>
<!-- TODO Add translation --
>
<string
name=
"msg_team_communication"
>
Open Source Communication
</string>
<!-- TODO Add translation --
>
<string
name=
"msg_login_with_email"
>
Login with
<b>
e-mail
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_create_account"
>
Create an account
</string>
<!-- TODO Add translation --
>
<string
name=
"msg_continue_with_facebook"
>
Continue with
<b>
Facebook
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_continue_with_github"
>
Continue with
<b>
Github
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_continue_with_google"
>
Continue with
<b>
Google
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_continue_with_linkedin"
>
Continue with
<b>
Linkedin
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_continue_with_gitlab"
>
Continue with
<b>
GitLab
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_continue_with_wordpress"
>
Continue with
<b>
WordPress
</b></string>
<!-- TODO Add translation --
>
<string
name=
"msg_two_factor_authentication"
>
Two-factor Authentication
</string>
<!-- TODO Add translation --
>
<string
name=
"msg__your_2fa_code"
>
What’s your 2FA code?
</string>
<!-- TODO Add translation --
>
<string
name=
"msg_welcome_to_rocket_chat"
>
Rocket.Chat
</string
>
<string
name=
"msg_team_communication"
>
Чат с открытым исходным кодом
</string
>
<string
name=
"msg_login_with_email"
>
Войти с помощью
<b>
e-mail
</b></string
>
<string
name=
"msg_create_account"
>
Создать аккаунт
</string
>
<string
name=
"msg_continue_with_facebook"
>
Войти с помощью
<b>
Facebook
</b></string
>
<string
name=
"msg_continue_with_github"
>
Войти с помощью
<b>
Github
</b></string
>
<string
name=
"msg_continue_with_google"
>
Войти с помощью
<b>
Google
</b></string
>
<string
name=
"msg_continue_with_linkedin"
>
Войти с помощью
<b>
Linkedin
</b></string
>
<string
name=
"msg_continue_with_gitlab"
>
Войти с помощью
<b>
GitLab
</b></string
>
<string
name=
"msg_continue_with_wordpress"
>
Войти с помощью
<b>
WordPress
</b></string
>
<string
name=
"msg_two_factor_authentication"
>
Двухфакторная аутентификация
</string
>
<string
name=
"msg__your_2fa_code"
>
Ваш код 2FA?
</string
>
<string
name=
"msg_view_more"
>
больше
</string>
<string
name=
"msg_view_less"
>
меньше
</string>
...
...
@@ -300,6 +301,5 @@
<string
name=
"read_by"
>
Прочитано
</string>
<string
name=
"message_information_title"
>
Информация о прочтении
</string>
<string
name=
"msg_log_out"
>
Выходим…
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<string
name=
"message_room_changed_privacy"
>
Тип канала изменен на: %1$s пользователем %2$s
</string>
</resources>
app/src/main/res/values-tr/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
Yasal Şartlar
</string>
<string
name=
"title_chats"
>
Sohbetler
</string>
<string
name=
"title_profile"
>
Profil
</string>
<string
name=
"title_members"
>
Üyeler (%d)
</string>
<string
name=
"title_members"
>
Üyeler
</string>
<string
name=
"title_counted_members"
>
Üyeler (%d)
</string>
<string
name=
"title_settings"
>
Ayarlar
</string>
<string
name=
"title_preferences"
>
Tercihler
</string>
<string
name=
"title_change_password"
>
Şifre Değişikliği
</string>
...
...
app/src/main/res/values-uk/strings.xml
View file @
016ae737
...
...
@@ -10,7 +10,8 @@
<string
name=
"title_legal_terms"
>
Юридичні умови
</string>
<string
name=
"title_chats"
>
Чати
</string>
<string
name=
"title_profile"
>
Профіль
</string>
<string
name=
"title_members"
>
Користувачі (%d)
</string>
<string
name=
"title_members"
>
Користувачі
</string>
<string
name=
"title_counted_members"
>
Користувачі (%d)
</string>
<string
name=
"title_settings"
>
Налаштування
</string>
<string
name=
"title_preferences"
>
Персональні
</string>
<string
name=
"title_change_password"
>
Змінити пароль
</string>
...
...
app/src/main/res/values/strings.xml
View file @
016ae737
...
...
@@ -22,7 +22,8 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string
name=
"title_legal_terms"
>
Legal Terms
</string>
<string
name=
"title_chats"
>
Chats
</string>
<string
name=
"title_profile"
>
Profile
</string>
<string
name=
"title_members"
>
Members (%d)
</string>
<string
name=
"title_members"
>
Members
</string>
<string
name=
"title_counted_members"
>
Members (%d)
</string>
<string
name=
"title_settings"
>
Settings
</string>
<string
name=
"title_preferences"
>
Preferences
</string>
<string
name=
"title_change_password"
>
Change Password
</string>
...
...
app/src/main/res/values/styles.xml
View file @
016ae737
...
...
@@ -40,6 +40,8 @@
<item
name=
"android:textStyle"
>
bold
</item>
<item
name=
"android:textColor"
>
@color/colorAccent
</item>
<item
name=
"android:letterSpacing"
>
0.04
</item>
<item
name=
"android:maxLines"
>
1
</item>
<item
name=
"android:ellipsize"
>
end
</item>
</style>
<style
name=
"Authentication.Button.Title.White"
parent=
"Authentication.Button.Title"
>
...
...
@@ -52,6 +54,8 @@
<item
name=
"android:textStyle"
>
normal
</item>
<item
name=
"android:textColor"
>
@color/colorAuthenticationSecondaryText
</item>
<item
name=
"android:letterSpacing"
>
0.04
</item>
<item
name=
"android:maxLines"
>
1
</item>
<item
name=
"android:ellipsize"
>
end
</item>
</style>
<style
name=
"Authentication.EditText.Hint"
parent=
"TextAppearance.AppCompat"
>
...
...
@@ -76,7 +80,7 @@
</style>
<style
name=
"Authentication.Button"
parent=
"Widget.AppCompat.Button.Borderless"
>
<item
name=
"android:layout_width"
>
0dp
</item>
<item
name=
"android:layout_width"
>
match_parent
</item>
<item
name=
"android:layout_height"
>
48dp
</item>
<item
name=
"android:foreground"
>
?selectableItemBackground
</item>
<item
name=
"android:textSize"
>
18sp
</item>
...
...
app/src/play/java/chat/rocket/android/analytics/AnswersAnalytics.kt
View file @
016ae737
...
...
@@ -65,4 +65,6 @@ class AnswersAnalytics : Analytics {
.
putCustomAttribute
(
"server_url"
,
serverUrl
)
.
putCustomAttribute
(
"server_count"
,
serverCount
)
)
override
fun
logOpenAdmin
()
=
Answers
.
getInstance
().
logCustom
(
CustomEvent
(
"open_admin"
))
}
app/src/play/java/chat/rocket/android/analytics/GoogleAnalyticsForFirebase.kt
View file @
016ae737
...
...
@@ -58,4 +58,6 @@ class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
putInt
(
"server_count"
,
serverCount
)
})
}
override
fun
logOpenAdmin
()
=
firebaseAnalytics
.
logEvent
(
"open_admin"
,
null
)
}
build.gradle
View file @
016ae737
...
...
@@ -10,7 +10,7 @@ buildscript {
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.
2.0-rc03
'
classpath
'com.android.tools.build:gradle:3.
3.0-alpha12
'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath
"org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath
'com.google.gms:google-services:4.0.2'
...
...
dependencies.gradle
View file @
016ae737
...
...
@@ -5,20 +5,20 @@ ext {
compileSdk
:
28
,
targetSdk
:
28
,
minSdk
:
21
,
buildTools
:
'28.0.
2
'
,
buildTools
:
'28.0.
3
'
,
dokka
:
'0.9.16'
,
// For app
kotlin
:
'1.2.61'
,
coroutine
:
'0.25.0'
,
appCompat
:
'1.0.0
-rc02
'
,
recyclerview
:
'1.0.0
-rc02
'
,
appCompat
:
'1.0.0'
,
recyclerview
:
'1.0.0'
,
constraintLayout
:
'2.0.0-alpha2'
,
cardview
:
'1.0.0
-rc02
'
,
browser
:
'1.0.0
-rc02
'
,
androidKtx
:
'1.0.0
-rc02
'
,
workmanager
:
'1.0.0-alpha0
8
'
,
cardview
:
'1.0.0'
,
browser
:
'1.0.0'
,
androidKtx
:
'1.0.0'
,
workmanager
:
'1.0.0-alpha0
9
'
,
dagger
:
'2.16'
,
firebaseCloudMessage
:
'17.3.0'
,
...
...
@@ -28,8 +28,8 @@ ext {
flexbox
:
'1.0.0'
,
material
:
'1.0.0-beta01'
,
room
:
'2.0.0
-rc01
'
,
lifecycle
:
'2.0.0
-rc01
'
,
room
:
'2.0.0'
,
lifecycle
:
'2.0.0'
,
livedataKtx
:
'2.0.1'
,
...
...
emoji/build.gradle
View file @
016ae737
...
...
@@ -5,7 +5,7 @@ apply plugin: 'kotlin-kapt'
android
{
compileSdkVersion
versions
.
compileSdk
buildToolsVersion
versions
.
buildTools
buildToolsVersion
'28.0.3'
defaultConfig
{
minSdkVersion
versions
.
minSdk
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
016ae737
#
Mon Aug 06 11:30:07 BR
T 2018
#
Wed Oct 10 10:41:36 UY
T 2018
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.9-all.zip
distributionSha256Sum
=
39e2d5803bbd5eaf6c8efe07067b0e5a00235e8c71318642b2ed262920b27721
\ No newline at end of file
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.10.2-all.zip
distributionSha256Sum
=
b7aedd369a26b177147bcb715f8b1fc4fe32b0a6ade0d7fd8ee5ed0c6f731f2c
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