Commit b6849d3a authored by Leonardo Aramaki's avatar Leonardo Aramaki

Merge branch 'develop' into new/download-received-pictures

parents 4508749d dc5b109e
...@@ -104,7 +104,6 @@ dependencies { ...@@ -104,7 +104,6 @@ dependencies {
implementation libraries.frescoImageViewer implementation libraries.frescoImageViewer
implementation libraries.markwon implementation libraries.markwon
implementation libraries.markwonImageLoader
implementation libraries.sheetMenu implementation libraries.sheetMenu
......
...@@ -18,6 +18,7 @@ import chat.rocket.android.app.migration.model.RealmSession ...@@ -18,6 +18,7 @@ import chat.rocket.android.app.migration.model.RealmSession
import chat.rocket.android.app.migration.model.RealmUser import chat.rocket.android.app.migration.model.RealmUser
import chat.rocket.android.authentication.domain.model.toToken import chat.rocket.android.authentication.domain.model.toToken
import chat.rocket.android.dagger.DaggerAppComponent import chat.rocket.android.dagger.DaggerAppComponent
import chat.rocket.android.dagger.qualifier.ForMessages
import chat.rocket.android.helper.CrashlyticsTree import chat.rocket.android.helper.CrashlyticsTree
import chat.rocket.android.infrastructure.LocalRepository import chat.rocket.android.infrastructure.LocalRepository
import chat.rocket.android.server.domain.* import chat.rocket.android.server.domain.*
...@@ -84,6 +85,10 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje ...@@ -84,6 +85,10 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje
@Inject @Inject
lateinit var localRepository: LocalRepository lateinit var localRepository: LocalRepository
@Inject
@field:ForMessages
lateinit var messagesPrefs: SharedPreferences
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
...@@ -107,6 +112,13 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje ...@@ -107,6 +112,13 @@ class RocketChatApplication : Application(), HasActivityInjector, HasServiceInje
setupFresco() setupFresco()
setupTimber() setupTimber()
if (localRepository.needOldMessagesCleanUp()) {
messagesPrefs.edit {
clear()
}
localRepository.setOldMessagesCleanedUp()
}
// TODO - remove this and all realm stuff when we got to 80% in 2.0 // TODO - remove this and all realm stuff when we got to 80% in 2.0
try { try {
if (!localRepository.hasMigrated()) { if (!localRepository.hasMigrated()) {
...@@ -286,5 +298,9 @@ private fun LocalRepository.setMigrated(migrated: Boolean) { ...@@ -286,5 +298,9 @@ private fun LocalRepository.setMigrated(migrated: Boolean) {
} }
private fun LocalRepository.hasMigrated() = getBoolean(LocalRepository.MIGRATION_FINISHED_KEY) private fun LocalRepository.hasMigrated() = getBoolean(LocalRepository.MIGRATION_FINISHED_KEY)
private fun LocalRepository.needOldMessagesCleanUp() = getBoolean(CLEANUP_OLD_MESSAGES_NEEDED, true)
private fun LocalRepository.setOldMessagesCleanedUp() = save(CLEANUP_OLD_MESSAGES_NEEDED, false)
private const val INTERNAL_TOKEN_MIGRATION_NEEDED = "INTERNAL_TOKEN_MIGRATION_NEEDED"
private const val INTERNAL_TOKEN_MIGRATION_NEEDED = "INTERNAL_TOKEN_MIGRATION_NEEDED" private const val CLEANUP_OLD_MESSAGES_NEEDED = "CLEANUP_OLD_MESSAGES_NEEDED"
\ No newline at end of file \ No newline at end of file
...@@ -59,6 +59,7 @@ class LoginPresenter @Inject constructor( ...@@ -59,6 +59,7 @@ class LoginPresenter @Inject constructor(
setupConnectionInfo(currentServer) setupConnectionInfo(currentServer)
setupLoginView() setupLoginView()
setupUserRegistrationView() setupUserRegistrationView()
setupForgotPasswordView()
setupCasView() setupCasView()
setupOauthServicesView() setupOauthServicesView()
} }
...@@ -107,6 +108,8 @@ class LoginPresenter @Inject constructor( ...@@ -107,6 +108,8 @@ class LoginPresenter @Inject constructor(
fun signup() = navigator.toSignUp() fun signup() = navigator.toSignUp()
fun forgotPassword() = navigator.toForgotPassword()
private fun setupLoginView() { private fun setupLoginView() {
if (settings.isLoginFormEnabled()) { if (settings.isLoginFormEnabled()) {
view.showFormView() view.showFormView()
...@@ -127,8 +130,15 @@ class LoginPresenter @Inject constructor( ...@@ -127,8 +130,15 @@ class LoginPresenter @Inject constructor(
private fun setupUserRegistrationView() { private fun setupUserRegistrationView() {
if (settings.isRegistrationEnabledForNewUsers() && settings.isLoginFormEnabled()) { if (settings.isRegistrationEnabledForNewUsers() && settings.isLoginFormEnabled()) {
view.showSignUpView()
view.setupSignUpView() view.setupSignUpView()
view.showSignUpView()
}
}
private fun setupForgotPasswordView() {
if (settings.isPasswordResetEnabled()) {
view.setupForgotPasswordView()
view.showForgotPasswordView()
} }
} }
...@@ -207,6 +217,31 @@ class LoginPresenter @Inject constructor( ...@@ -207,6 +217,31 @@ class LoginPresenter @Inject constructor(
} }
} }
getCustomOauthServices(services).let {
for (service in it) {
val serviceName = getCustomOauthServiceName(service)
val customOauthUrl = OauthHelper.getCustomOauthUrl(
getCustomOauthHost(service),
getCustomOauthAuthorizePath(service),
getCustomOauthClientId(service),
currentServer,
serviceName,
state,
getCustomOauthScope(service)
)
view.addCustomOauthServiceButton(
customOauthUrl,
state,
serviceName,
getCustomOauthServiceNameColor(service),
getCustomOauthButtonColor(service)
)
totalSocialAccountsEnabled++
}
}
if (totalSocialAccountsEnabled > 0) { if (totalSocialAccountsEnabled > 0) {
view.enableOauthView() view.enableOauthView()
if (totalSocialAccountsEnabled > 3) { if (totalSocialAccountsEnabled > 3) {
...@@ -299,6 +334,38 @@ class LoginPresenter @Inject constructor( ...@@ -299,6 +334,38 @@ class LoginPresenter @Inject constructor(
}.toString() }.toString()
} }
private fun getCustomOauthServices(listMap: List<Map<String, Any>>): List<Map<String, Any>> {
return listMap.filter { map -> map["custom"] == true }
}
private fun getCustomOauthHost(service: Map<String, Any>): String {
return service["serverURL"].toString()
}
private fun getCustomOauthAuthorizePath(service: Map<String, Any>): String {
return service["authorizePath"].toString()
}
private fun getCustomOauthClientId(service: Map<String, Any>): String {
return service["clientId"].toString()
}
private fun getCustomOauthServiceName(service: Map<String, Any>): String {
return service["service"].toString()
}
private fun getCustomOauthScope(service: Map<String, Any>): String {
return service["scope"].toString()
}
private fun getCustomOauthButtonColor(service: Map<String, Any>): Int {
return service["buttonColor"].toString().parseColor()
}
private fun getCustomOauthServiceNameColor(service: Map<String, Any>): Int {
return service["buttonLabelColor"].toString().parseColor()
}
private suspend fun saveAccount(username: String) { private suspend fun saveAccount(username: String) {
val icon = settings.favicon()?.let { val icon = settings.favicon()?.let {
currentServer.serverLogoUrl(it) currentServer.serverLogoUrl(it)
......
package chat.rocket.android.authentication.login.presentation package chat.rocket.android.authentication.login.presentation
import chat.rocket.android.authentication.server.presentation.VersionCheckView
import chat.rocket.android.core.behaviours.LoadingView import chat.rocket.android.core.behaviours.LoadingView
import chat.rocket.android.core.behaviours.MessageView import chat.rocket.android.core.behaviours.MessageView
...@@ -66,6 +65,18 @@ interface LoginView : LoadingView, MessageView { ...@@ -66,6 +65,18 @@ interface LoginView : LoadingView, MessageView {
*/ */
fun setupSignUpView() fun setupSignUpView()
/**
* Shows the forgot password view if enabled by the server settings.
*
* REMARK: We must set up the forgot password view listener [setupForgotPasswordView].
*/
fun showForgotPasswordView()
/**
* Setups the forgot password view when tapped.
*/
fun setupForgotPasswordView()
/** /**
* Hides the sign up view. * Hides the sign up view.
*/ */
...@@ -75,7 +86,7 @@ interface LoginView : LoadingView, MessageView { ...@@ -75,7 +86,7 @@ interface LoginView : LoadingView, MessageView {
* Enables and shows the oauth view if there is login via social accounts enabled by the server settings. * Enables and shows the oauth view if there is login via social accounts enabled by the server settings.
* *
* REMARK: We must show at maximum *three* social accounts views ([enableLoginByFacebook], [enableLoginByGithub], [enableLoginByGoogle], * REMARK: We must show at maximum *three* social accounts views ([enableLoginByFacebook], [enableLoginByGithub], [enableLoginByGoogle],
* [enableLoginByLinkedin], [enableLoginByMeteor], [enableLoginByTwitter] or [enableLoginByGitlab]) for the oauth view. * [enableLoginByLinkedin], [enableLoginByMeteor], [enableLoginByTwitter], [enableLoginByGitlab] or [addCustomOauthServiceButton]) for the oauth view.
* If the possibility of login via social accounts exceeds 3 different ways we should set up the FAB ([setupFabListener]) to show the remaining view(s). * If the possibility of login via social accounts exceeds 3 different ways we should set up the FAB ([setupFabListener]) to show the remaining view(s).
*/ */
fun enableOauthView() fun enableOauthView()
...@@ -178,6 +189,24 @@ interface LoginView : LoadingView, MessageView { ...@@ -178,6 +189,24 @@ interface LoginView : LoadingView, MessageView {
*/ */
fun setupGitlabButtonListener(gitlabUrl: String, state: String) fun setupGitlabButtonListener(gitlabUrl: String, state: String)
/**
* Adds a custom OAuth button in the oauth view.
*
* @customOauthUrl The custom OAuth url to sets up the button (the listener).
* @state A random string generated by the app, which you'll verify later (to protect against forgery attacks).
* @serviceName The custom OAuth service name.
* @serviceNameColor The custom OAuth service name color (just stylizing).
* @buttonColor The color of the custom OAuth button (just stylizing).
* @see [enableOauthView]
*/
fun addCustomOauthServiceButton(
customOauthUrl: String,
state: String,
serviceName: String,
serviceNameColor: Int,
buttonColor: Int
)
/** /**
* Setups the FloatingActionButton to show more social accounts views (expanding the oauth view interface to show the remaining view(s)). * Setups the FloatingActionButton to show more social accounts views (expanding the oauth view interface to show the remaining view(s)).
*/ */
......
...@@ -2,8 +2,8 @@ package chat.rocket.android.authentication.login.ui ...@@ -2,8 +2,8 @@ package chat.rocket.android.authentication.login.ui
import DrawableHelper import DrawableHelper
import android.app.Activity import android.app.Activity
import android.app.AlertDialog
import android.content.Intent import android.content.Intent
import android.graphics.PorterDuff
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
...@@ -12,10 +12,12 @@ import android.view.LayoutInflater ...@@ -12,10 +12,12 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewTreeObserver import android.view.ViewTreeObserver
import android.widget.Button
import android.widget.ImageButton import android.widget.ImageButton
import android.widget.LinearLayout
import android.widget.ScrollView import android.widget.ScrollView
import androidx.core.view.isVisible
import androidx.core.view.postDelayed import androidx.core.view.postDelayed
import chat.rocket.android.BuildConfig
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo
import chat.rocket.android.authentication.login.presentation.LoginPresenter import chat.rocket.android.authentication.login.presentation.LoginPresenter
...@@ -37,7 +39,8 @@ internal const val REQUEST_CODE_FOR_CAS = 1 ...@@ -37,7 +39,8 @@ internal const val REQUEST_CODE_FOR_CAS = 1
internal const val REQUEST_CODE_FOR_OAUTH = 2 internal const val REQUEST_CODE_FOR_OAUTH = 2
class LoginFragment : Fragment(), LoginView { class LoginFragment : Fragment(), LoginView {
@Inject lateinit var presenter: LoginPresenter @Inject
lateinit var presenter: LoginPresenter
private var isOauthViewEnable = false private var isOauthViewEnable = false
private val layoutListener = ViewTreeObserver.OnGlobalLayoutListener { private val layoutListener = ViewTreeObserver.OnGlobalLayoutListener {
areLoginOptionsNeeded() areLoginOptionsNeeded()
...@@ -61,7 +64,11 @@ class LoginFragment : Fragment(), LoginView { ...@@ -61,7 +64,11 @@ class LoginFragment : Fragment(), LoginView {
deepLinkInfo = arguments?.getParcelable(DEEP_LINK_INFO) deepLinkInfo = arguments?.getParcelable(DEEP_LINK_INFO)
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? = override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? =
container?.inflate(R.layout.fragment_authentication_log_in) container?.inflate(R.layout.fragment_authentication_log_in)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
...@@ -94,7 +101,10 @@ class LoginFragment : Fragment(), LoginView { ...@@ -94,7 +101,10 @@ class LoginFragment : Fragment(), LoginView {
} }
} else if (requestCode == REQUEST_CODE_FOR_OAUTH) { } else if (requestCode == REQUEST_CODE_FOR_OAUTH) {
data?.apply { data?.apply {
presenter.authenticateWithOauth(getStringExtra(INTENT_OAUTH_CREDENTIAL_TOKEN), getStringExtra(INTENT_OAUTH_CREDENTIAL_SECRET)) presenter.authenticateWithOauth(
getStringExtra(INTENT_OAUTH_CREDENTIAL_TOKEN),
getStringExtra(INTENT_OAUTH_CREDENTIAL_SECRET)
)
} }
} }
} }
...@@ -102,25 +112,29 @@ class LoginFragment : Fragment(), LoginView { ...@@ -102,25 +112,29 @@ class LoginFragment : Fragment(), LoginView {
private fun tintEditTextDrawableStart() { private fun tintEditTextDrawableStart() {
ui { ui {
val personDrawable = DrawableHelper.getDrawableFromId(R.drawable.ic_assignment_ind_black_24dp, it) val personDrawable =
DrawableHelper.getDrawableFromId(R.drawable.ic_assignment_ind_black_24dp, it)
val lockDrawable = DrawableHelper.getDrawableFromId(R.drawable.ic_lock_black_24dp, it) val lockDrawable = DrawableHelper.getDrawableFromId(R.drawable.ic_lock_black_24dp, it)
val drawables = arrayOf(personDrawable, lockDrawable) val drawables = arrayOf(personDrawable, lockDrawable)
DrawableHelper.wrapDrawables(drawables) DrawableHelper.wrapDrawables(drawables)
DrawableHelper.tintDrawables(drawables, it, R.color.colorDrawableTintGrey) DrawableHelper.tintDrawables(drawables, it, R.color.colorDrawableTintGrey)
DrawableHelper.compoundDrawables(arrayOf(text_username_or_email, text_password), drawables) DrawableHelper.compoundDrawables(
arrayOf(text_username_or_email, text_password),
drawables
)
} }
} }
override fun showLoading() { override fun showLoading() {
ui { ui {
view_loading.setVisible(true) view_loading.isVisible = true
} }
} }
override fun hideLoading() { override fun hideLoading() {
ui { ui {
view_loading.setVisible(false) view_loading.isVisible = false
} }
} }
...@@ -142,23 +156,25 @@ class LoginFragment : Fragment(), LoginView { ...@@ -142,23 +156,25 @@ class LoginFragment : Fragment(), LoginView {
override fun showFormView() { override fun showFormView() {
ui { ui {
text_username_or_email.setVisible(true) text_username_or_email.isVisible = true
text_password.setVisible(true) text_password.isVisible = true
} }
} }
override fun hideFormView() { override fun hideFormView() {
ui { ui {
text_username_or_email.setVisible(false) text_username_or_email.isVisible = false
text_password.setVisible(false) text_password.isVisible = false
} }
} }
override fun setupLoginButtonListener() { override fun setupLoginButtonListener() {
ui { ui {
button_log_in.setOnClickListener { button_log_in.setOnClickListener {
presenter.authenticateWithUserAndPassword(text_username_or_email.textContent, presenter.authenticateWithUserAndPassword(
text_password.textContent) text_username_or_email.textContent,
text_password.textContent
)
} }
} }
} }
...@@ -181,21 +197,23 @@ class LoginFragment : Fragment(), LoginView { ...@@ -181,21 +197,23 @@ class LoginFragment : Fragment(), LoginView {
override fun showCasButton() { override fun showCasButton() {
ui { ui {
button_cas.setVisible(true) button_cas.isVisible = true
} }
} }
override fun hideCasButton() { override fun hideCasButton() {
ui { ui {
button_cas.setVisible(false) button_cas.isVisible = false
} }
} }
override fun setupCasButtonListener(casUrl: String, casToken: String) { override fun setupCasButtonListener(casUrl: String, casToken: String) {
ui { activity -> ui { activity ->
button_cas.setOnClickListener { button_cas.setOnClickListener {
startActivityForResult(activity.casWebViewIntent(casUrl, casToken), startActivityForResult(
REQUEST_CODE_FOR_CAS) activity.casWebViewIntent(casUrl, casToken),
REQUEST_CODE_FOR_CAS
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
} }
} }
...@@ -203,7 +221,7 @@ class LoginFragment : Fragment(), LoginView { ...@@ -203,7 +221,7 @@ class LoginFragment : Fragment(), LoginView {
override fun showSignUpView() { override fun showSignUpView() {
ui { ui {
text_new_to_rocket_chat.setVisible(true) text_new_to_rocket_chat.isVisible = true
} }
} }
...@@ -222,9 +240,30 @@ class LoginFragment : Fragment(), LoginView { ...@@ -222,9 +240,30 @@ class LoginFragment : Fragment(), LoginView {
} }
} }
override fun showForgotPasswordView() {
ui {
text_forgot_your_password.isVisible = true
}
}
override fun setupForgotPasswordView() {
ui {
val reset = getString(R.string.msg_reset)
val forgotPassword = String.format(getString(R.string.msg_forgot_password), reset)
text_forgot_your_password.text = forgotPassword
val resetListener = object : ClickableSpan() {
override fun onClick(view: View) = presenter.forgotPassword()
}
TextHelper.addLink(text_forgot_your_password, arrayOf(reset), arrayOf(resetListener))
}
}
override fun hideSignUpView() { override fun hideSignUpView() {
ui { ui {
text_new_to_rocket_chat.setVisible(false) text_new_to_rocket_chat.isVisible = false
} }
} }
...@@ -232,26 +271,26 @@ class LoginFragment : Fragment(), LoginView { ...@@ -232,26 +271,26 @@ class LoginFragment : Fragment(), LoginView {
ui { ui {
isOauthViewEnable = true isOauthViewEnable = true
showThreeSocialAccountsMethods() showThreeSocialAccountsMethods()
social_accounts_container.setVisible(true) social_accounts_container.isVisible = true
} }
} }
override fun disableOauthView() { override fun disableOauthView() {
ui { ui {
isOauthViewEnable = false isOauthViewEnable = false
social_accounts_container.setVisible(false) social_accounts_container.isVisible = false
} }
} }
override fun showLoginButton() { override fun showLoginButton() {
ui { ui {
button_log_in.setVisible(true) button_log_in.isVisible = true
} }
} }
override fun hideLoginButton() { override fun hideLoginButton() {
ui { ui {
button_log_in.setVisible(false) button_log_in.isVisible = false
} }
} }
...@@ -264,7 +303,10 @@ class LoginFragment : Fragment(), LoginView { ...@@ -264,7 +303,10 @@ class LoginFragment : Fragment(), LoginView {
override fun setupFacebookButtonListener(facebookOauthUrl: String, state: String) { override fun setupFacebookButtonListener(facebookOauthUrl: String, state: String) {
ui { activity -> ui { activity ->
button_facebook.setOnClickListener { button_facebook.setOnClickListener {
startActivityForResult(activity.oauthWebViewIntent(facebookOauthUrl, state), REQUEST_CODE_FOR_OAUTH) startActivityForResult(
activity.oauthWebViewIntent(facebookOauthUrl, state),
REQUEST_CODE_FOR_OAUTH
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
} }
} }
...@@ -279,7 +321,10 @@ class LoginFragment : Fragment(), LoginView { ...@@ -279,7 +321,10 @@ class LoginFragment : Fragment(), LoginView {
override fun setupGithubButtonListener(githubUrl: String, state: String) { override fun setupGithubButtonListener(githubUrl: String, state: String) {
ui { activity -> ui { activity ->
button_github.setOnClickListener { button_github.setOnClickListener {
startActivityForResult(activity.oauthWebViewIntent(githubUrl, state), REQUEST_CODE_FOR_OAUTH) startActivityForResult(
activity.oauthWebViewIntent(githubUrl, state),
REQUEST_CODE_FOR_OAUTH
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
} }
} }
...@@ -291,11 +336,15 @@ class LoginFragment : Fragment(), LoginView { ...@@ -291,11 +336,15 @@ class LoginFragment : Fragment(), LoginView {
} }
} }
// TODO: Use custom tabs instead of web view. See https://github.com/RocketChat/Rocket.Chat.Android/issues/968 // TODO: Use custom tabs instead of web view.
// See https://github.com/RocketChat/Rocket.Chat.Android/issues/968
override fun setupGoogleButtonListener(googleUrl: String, state: String) { override fun setupGoogleButtonListener(googleUrl: String, state: String) {
ui { activity -> ui { activity ->
button_google.setOnClickListener { button_google.setOnClickListener {
startActivityForResult(activity.oauthWebViewIntent(googleUrl, state), REQUEST_CODE_FOR_OAUTH) startActivityForResult(
activity.oauthWebViewIntent(googleUrl, state),
REQUEST_CODE_FOR_OAUTH
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
} }
} }
...@@ -310,7 +359,10 @@ class LoginFragment : Fragment(), LoginView { ...@@ -310,7 +359,10 @@ class LoginFragment : Fragment(), LoginView {
override fun setupLinkedinButtonListener(linkedinUrl: String, state: String) { override fun setupLinkedinButtonListener(linkedinUrl: String, state: String) {
ui { activity -> ui { activity ->
button_linkedin.setOnClickListener { button_linkedin.setOnClickListener {
startActivityForResult(activity.oauthWebViewIntent(linkedinUrl, state), REQUEST_CODE_FOR_OAUTH) startActivityForResult(
activity.oauthWebViewIntent(linkedinUrl, state),
REQUEST_CODE_FOR_OAUTH
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
} }
} }
...@@ -337,7 +389,31 @@ class LoginFragment : Fragment(), LoginView { ...@@ -337,7 +389,31 @@ class LoginFragment : Fragment(), LoginView {
override fun setupGitlabButtonListener(gitlabUrl: String, state: String) { override fun setupGitlabButtonListener(gitlabUrl: String, state: String) {
ui { activity -> ui { activity ->
button_gitlab.setOnClickListener { button_gitlab.setOnClickListener {
startActivityForResult(activity.oauthWebViewIntent(gitlabUrl, state), REQUEST_CODE_FOR_OAUTH) startActivityForResult(
activity.oauthWebViewIntent(gitlabUrl, state),
REQUEST_CODE_FOR_OAUTH
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
}
}
}
override fun addCustomOauthServiceButton(
customOauthUrl: String,
state: String,
serviceName: String,
serviceNameColor: Int,
buttonColor: Int
) {
ui { activity ->
val button = getCustomOauthButton(serviceName, serviceNameColor, buttonColor)
social_accounts_container.addView(button)
button.setOnClickListener {
startActivityForResult(
activity.oauthWebViewIntent(customOauthUrl, state),
REQUEST_CODE_FOR_OAUTH
)
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
} }
} }
...@@ -345,7 +421,7 @@ class LoginFragment : Fragment(), LoginView { ...@@ -345,7 +421,7 @@ class LoginFragment : Fragment(), LoginView {
override fun setupFabListener() { override fun setupFabListener() {
ui { ui {
button_fab.setVisible(true) button_fab.isVisible = true
button_fab.setOnClickListener({ button_fab.setOnClickListener({
button_fab.hide() button_fab.hide()
showRemainingSocialAccountsView() showRemainingSocialAccountsView()
...@@ -355,8 +431,9 @@ class LoginFragment : Fragment(), LoginView { ...@@ -355,8 +431,9 @@ class LoginFragment : Fragment(), LoginView {
} }
override fun setupGlobalListener() { override fun setupGlobalListener() {
// We need to setup the layout to hide and show the oauth interface when the soft keyboard is shown // We need to setup the layout to hide and show the oauth interface when the soft keyboard
// (means that the user touched the text_username_or_email or text_password EditText to fill that respective fields). // is shown (which means that the user has touched the text_username_or_email or
// text_password EditText to fill that respective fields).
if (!isGlobalLayoutListenerSetUp) { if (!isGlobalLayoutListenerSetUp) {
scroll_view.viewTreeObserver.addOnGlobalLayoutListener(layoutListener) scroll_view.viewTreeObserver.addOnGlobalLayoutListener(layoutListener)
isGlobalLayoutListenerSetUp = true isGlobalLayoutListenerSetUp = true
...@@ -383,9 +460,9 @@ class LoginFragment : Fragment(), LoginView { ...@@ -383,9 +460,9 @@ class LoginFragment : Fragment(), LoginView {
social_accounts_container.postDelayed(300) { social_accounts_container.postDelayed(300) {
ui { ui {
(0..social_accounts_container.childCount) (0..social_accounts_container.childCount)
.mapNotNull { social_accounts_container.getChildAt(it) as? ImageButton } .mapNotNull { social_accounts_container.getChildAt(it) as? ImageButton }
.filter { it.isClickable } .filter { it.isClickable }
.forEach { it.setVisible(true) } .forEach { it.isVisible = true }
} }
} }
} }
...@@ -413,28 +490,73 @@ class LoginFragment : Fragment(), LoginView { ...@@ -413,28 +490,73 @@ class LoginFragment : Fragment(), LoginView {
} }
// Returns true if *all* EditTexts are empty. // Returns true if *all* EditTexts are empty.
private fun isEditTextEmpty(): Boolean { private fun isEditTextEmpty(): Boolean {
return text_username_or_email.textContent.isBlank() && text_password.textContent.isEmpty() return text_username_or_email.textContent.isBlank() && text_password.textContent.isEmpty()
} }
private fun showThreeSocialAccountsMethods() { private fun showThreeSocialAccountsMethods() {
(0..social_accounts_container.childCount) (0..social_accounts_container.childCount)
.mapNotNull { social_accounts_container.getChildAt(it) as? ImageButton } .mapNotNull { social_accounts_container.getChildAt(it) as? ImageButton }
.filter { it.isClickable } .filter { it.isClickable }
.take(3) .take(3)
.forEach { it.setVisible(true) } .forEach { it.isVisible = true }
} }
private fun showOauthView() { private fun showOauthView() {
if (isOauthViewEnable) { if (isOauthViewEnable) {
social_accounts_container.setVisible(true) social_accounts_container.isVisible = true
if (enabledSocialAccounts() > 3) {
button_fab.isVisible = true
}
} }
} }
private fun hideOauthView() { private fun hideOauthView() {
if (isOauthViewEnable) { if (isOauthViewEnable) {
social_accounts_container.setVisible(false) social_accounts_container.isVisible = false
button_fab.setVisible(false) button_fab.isVisible = false
} }
} }
private fun enabledSocialAccounts(): Int {
return enabledOauthAccountsImageButtons() + enabledServicesAccountsButtons()
}
private fun enabledOauthAccountsImageButtons(): Int {
return (0..social_accounts_container.childCount)
.mapNotNull { social_accounts_container.getChildAt(it) as? ImageButton }
.filter { it.isClickable }
.size
}
private fun enabledServicesAccountsButtons(): Int {
return (0..social_accounts_container.childCount)
.mapNotNull { social_accounts_container.getChildAt(it) as? Button }
.size
}
/**
* Gets a stylized custom OAuth button.
*/
private fun getCustomOauthButton(
buttonText: String,
buttonTextColor: Int,
buttonBgColor: Int
): Button {
val params: LinearLayout.LayoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
val margin = resources.getDimensionPixelSize(R.dimen.screen_edge_left_and_right_margins)
params.setMargins(margin, margin, margin, 0)
val button = Button(context)
button.layoutParams = params
button.text = buttonText
button.setTextColor(buttonTextColor)
button.background.setColorFilter(buttonBgColor, PorterDuff.Mode.MULTIPLY)
return button
}
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import chat.rocket.android.R ...@@ -5,6 +5,7 @@ import chat.rocket.android.R
import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo import chat.rocket.android.authentication.domain.model.LoginDeepLinkInfo
import chat.rocket.android.authentication.login.ui.LoginFragment import chat.rocket.android.authentication.login.ui.LoginFragment
import chat.rocket.android.authentication.registerusername.ui.RegisterUsernameFragment import chat.rocket.android.authentication.registerusername.ui.RegisterUsernameFragment
import chat.rocket.android.authentication.resetpassword.ui.ResetPasswordFragment
import chat.rocket.android.authentication.signup.ui.SignupFragment import chat.rocket.android.authentication.signup.ui.SignupFragment
import chat.rocket.android.authentication.twofactor.ui.TwoFAFragment import chat.rocket.android.authentication.twofactor.ui.TwoFAFragment
import chat.rocket.android.authentication.ui.AuthenticationActivity import chat.rocket.android.authentication.ui.AuthenticationActivity
...@@ -12,6 +13,7 @@ import chat.rocket.android.authentication.ui.newServerIntent ...@@ -12,6 +13,7 @@ import chat.rocket.android.authentication.ui.newServerIntent
import chat.rocket.android.main.ui.MainActivity import chat.rocket.android.main.ui.MainActivity
import chat.rocket.android.server.ui.changeServerIntent import chat.rocket.android.server.ui.changeServerIntent
import chat.rocket.android.util.extensions.addFragmentBackStack import chat.rocket.android.util.extensions.addFragmentBackStack
import chat.rocket.android.util.extensions.toPreviousView
import chat.rocket.android.webview.ui.webViewIntent import chat.rocket.android.webview.ui.webViewIntent
class AuthenticationNavigator(internal val activity: AuthenticationActivity) { class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
...@@ -28,6 +30,10 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) { ...@@ -28,6 +30,10 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
} }
} }
fun toPreviousView() {
activity.toPreviousView()
}
fun toTwoFA(username: String, password: String) { fun toTwoFA(username: String, password: String) {
activity.addFragmentBackStack("TwoFAFragment", R.id.fragment_container) { activity.addFragmentBackStack("TwoFAFragment", R.id.fragment_container) {
TwoFAFragment.newInstance(username, password) TwoFAFragment.newInstance(username, password)
...@@ -40,6 +46,12 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) { ...@@ -40,6 +46,12 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
} }
} }
fun toForgotPassword() {
activity.addFragmentBackStack("ResetPasswordFragment", R.id.fragment_container) {
ResetPasswordFragment.newInstance()
}
}
fun toWebPage(url: String) { fun toWebPage(url: String) {
activity.startActivity(activity.webViewIntent(url)) activity.startActivity(activity.webViewIntent(url))
activity.overridePendingTransition(R.anim.slide_up, R.anim.hold) activity.overridePendingTransition(R.anim.slide_up, R.anim.hold)
......
...@@ -16,7 +16,8 @@ import kotlinx.android.synthetic.main.fragment_authentication_register_username. ...@@ -16,7 +16,8 @@ import kotlinx.android.synthetic.main.fragment_authentication_register_username.
import javax.inject.Inject import javax.inject.Inject
class RegisterUsernameFragment : Fragment(), RegisterUsernameView { class RegisterUsernameFragment : Fragment(), RegisterUsernameView {
@Inject lateinit var presenter: RegisterUsernamePresenter @Inject
lateinit var presenter: RegisterUsernamePresenter
private lateinit var userId: String private lateinit var userId: String
private lateinit var authToken: String private lateinit var authToken: String
...@@ -41,7 +42,11 @@ class RegisterUsernameFragment : Fragment(), RegisterUsernameView { ...@@ -41,7 +42,11 @@ class RegisterUsernameFragment : Fragment(), RegisterUsernameView {
authToken = arguments?.getString(AUTH_TOKEN) ?: "" authToken = arguments?.getString(AUTH_TOKEN) ?: ""
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? = container?.inflate(R.layout.fragment_authentication_register_username) override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? = container?.inflate(R.layout.fragment_authentication_register_username)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
......
package chat.rocket.android.authentication.resetpassword.di
import android.arch.lifecycle.LifecycleOwner
import chat.rocket.android.authentication.resetpassword.presentation.ResetPasswordView
import chat.rocket.android.authentication.resetpassword.ui.ResetPasswordFragment
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.dagger.scope.PerFragment
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.experimental.Job
@Module
@PerFragment
class ResetPasswordFragmentModule {
@Provides
fun resetPasswordView(frag: ResetPasswordFragment): ResetPasswordView {
return frag
}
@Provides
fun provideLifecycleOwner(frag: ResetPasswordFragment): LifecycleOwner {
return frag
}
@Provides
fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy {
return CancelStrategy(owner, jobs)
}
}
\ No newline at end of file
package chat.rocket.android.authentication.resetpassword.di
import chat.rocket.android.authentication.resetpassword.ui.ResetPasswordFragment
import dagger.Module
import dagger.android.ContributesAndroidInjector
@Module
abstract class ResetPasswordFragmentProvider {
@ContributesAndroidInjector(modules = [ResetPasswordFragmentModule::class])
abstract fun provideResetPasswordFragment(): ResetPasswordFragment
}
\ No newline at end of file
package chat.rocket.android.authentication.resetpassword.presentation
import chat.rocket.android.authentication.presentation.AuthenticationNavigator
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.server.domain.GetCurrentServerInteractor
import chat.rocket.android.server.infraestructure.RocketChatClientFactory
import chat.rocket.android.util.extensions.isEmail
import chat.rocket.android.util.extensions.launchUI
import chat.rocket.android.util.retryIO
import chat.rocket.common.RocketChatException
import chat.rocket.common.RocketChatInvalidResponseException
import chat.rocket.common.util.ifNull
import chat.rocket.core.RocketChatClient
import chat.rocket.core.internal.rest.forgotPassword
import javax.inject.Inject
class ResetPasswordPresenter @Inject constructor(
private val view: ResetPasswordView,
private val strategy: CancelStrategy,
private val navigator: AuthenticationNavigator,
factory: RocketChatClientFactory,
serverInteractor: GetCurrentServerInteractor
) {
private val currentServer = serverInteractor.get()!!
private val client: RocketChatClient = factory.create(currentServer)
fun resetPassword(email: String) {
when {
email.isBlank() -> view.alertBlankEmail()
!email.isEmail() -> view.alertInvalidEmail()
else -> launchUI(strategy) {
view.showLoading()
try {
retryIO("forgotPassword(email = $email)") {
client.forgotPassword(email)
}
navigator.toPreviousView()
view.emailSent()
} catch (exception: RocketChatException) {
if (exception is RocketChatInvalidResponseException) {
view.updateYourServerVersion()
} else {
exception.message?.let {
view.showMessage(it)
}.ifNull {
view.showGenericErrorMessage()
}
}
} finally {
view.hideLoading()
}
}
}
}
}
\ No newline at end of file
package chat.rocket.android.authentication.resetpassword.presentation
import chat.rocket.android.core.behaviours.LoadingView
import chat.rocket.android.core.behaviours.MessageView
interface ResetPasswordView : LoadingView, MessageView {
/**
* Alerts the user about a blank email.
*/
fun alertBlankEmail()
/**
* Alerts the user about a invalid email.
*/
fun alertInvalidEmail()
/**
* Shows a successful email sent message.
*/
fun emailSent()
/**
* Shows a message to update the server version in order to use an app feature.
*/
fun updateYourServerVersion()
}
\ No newline at end of file
package chat.rocket.android.authentication.resetpassword.ui
import DrawableHelper
import android.os.Build
import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import chat.rocket.android.R
import chat.rocket.android.authentication.resetpassword.presentation.ResetPasswordPresenter
import chat.rocket.android.authentication.resetpassword.presentation.ResetPasswordView
import chat.rocket.android.util.extensions.*
import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.fragment_authentication_reset_password.*
import javax.inject.Inject
class ResetPasswordFragment : Fragment(), ResetPasswordView {
@Inject
lateinit var presenter: ResetPasswordPresenter
companion object {
fun newInstance() = ResetPasswordFragment()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
AndroidSupportInjection.inject(this)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? = container?.inflate(R.layout.fragment_authentication_reset_password)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
activity?.apply {
text_email.requestFocus()
showKeyboard(text_email)
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
tintEditTextDrawableStart()
}
setupOnClickListener()
}
override fun alertBlankEmail() {
ui {
vibrateShakeAndRequestFocusForTextEmail()
}
}
override fun alertInvalidEmail() {
ui {
vibrateShakeAndRequestFocusForTextEmail()
showMessage(R.string.msg_invalid_email)
}
}
override fun emailSent() {
showToast(R.string.msg_check_your_email_to_reset_your_password, Toast.LENGTH_LONG)
}
override fun updateYourServerVersion() {
showMessage(R.string.msg_update_app_version_in_order_to_continue)
}
override fun showLoading() {
ui {
disableUserInput()
view_loading.setVisible(true)
}
}
override fun hideLoading() {
ui {
view_loading.setVisible(false)
enableUserInput()
}
}
override fun showMessage(resId: Int) {
ui {
showToast(resId)
}
}
override fun showMessage(message: String) {
ui {
showToast(message)
}
}
override fun showGenericErrorMessage() {
showMessage(getString(R.string.msg_generic_error))
}
private fun tintEditTextDrawableStart() {
ui {
val emailDrawable = DrawableHelper.getDrawableFromId(R.drawable.ic_email_black_24dp, it)
DrawableHelper.wrapDrawable(emailDrawable)
DrawableHelper.tintDrawable(emailDrawable, it, R.color.colorDrawableTintGrey)
DrawableHelper.compoundDrawable(text_email, emailDrawable)
}
}
private fun enableUserInput() {
button_reset_password.isEnabled = true
text_email.isEnabled = true
}
private fun disableUserInput() {
button_reset_password.isEnabled = false
text_email.isEnabled = true
}
private fun vibrateShakeAndRequestFocusForTextEmail() {
vibrateSmartPhone()
text_email.shake()
text_email.requestFocus()
}
private fun setupOnClickListener() {
button_reset_password.setOnClickListener {
presenter.resetPassword(text_email.textContent)
}
}
}
\ No newline at end of file
...@@ -14,11 +14,11 @@ import timber.log.Timber ...@@ -14,11 +14,11 @@ import timber.log.Timber
import java.security.InvalidParameterException import java.security.InvalidParameterException
class ChatRoomAdapter( class ChatRoomAdapter(
private val roomType: String, private val roomType: String,
private val roomName: String, private val roomName: String,
private val presenter: ChatRoomPresenter?, private val presenter: ChatRoomPresenter?,
private val enableActions: Boolean = true, private val enableActions: Boolean = true,
private val reactionListener: EmojiReactionListener? = null private val reactionListener: EmojiReactionListener? = null
) : RecyclerView.Adapter<BaseViewHolder<*>>() { ) : RecyclerView.Adapter<BaseViewHolder<*>>() {
private val dataSet = ArrayList<BaseViewModel<*>>() private val dataSet = ArrayList<BaseViewModel<*>>()
...@@ -61,6 +61,10 @@ class ChatRoomAdapter( ...@@ -61,6 +61,10 @@ class ChatRoomAdapter(
val view = parent.inflate(R.layout.item_color_attachment) val view = parent.inflate(R.layout.item_color_attachment)
ColorAttachmentViewHolder(view, actionsListener, reactionListener) ColorAttachmentViewHolder(view, actionsListener, reactionListener)
} }
BaseViewModel.ViewType.GENERIC_FILE_ATTACHMENT -> {
val view = parent.inflate(R.layout.item_file_attachment)
GenericFileAttachmentViewHolder(view, actionsListener, reactionListener)
}
else -> { else -> {
throw InvalidParameterException("TODO - implement for ${viewType.toViewType()}") throw InvalidParameterException("TODO - implement for ${viewType.toViewType()}")
} }
...@@ -102,6 +106,7 @@ class ChatRoomAdapter( ...@@ -102,6 +106,7 @@ class ChatRoomAdapter(
is MessageAttachmentViewHolder -> holder.bind(dataSet[position] as MessageAttachmentViewModel) is MessageAttachmentViewHolder -> holder.bind(dataSet[position] as MessageAttachmentViewModel)
is AuthorAttachmentViewHolder -> holder.bind(dataSet[position] as AuthorAttachmentViewModel) is AuthorAttachmentViewHolder -> holder.bind(dataSet[position] as AuthorAttachmentViewModel)
is ColorAttachmentViewHolder -> holder.bind(dataSet[position] as ColorAttachmentViewModel) is ColorAttachmentViewHolder -> holder.bind(dataSet[position] as ColorAttachmentViewModel)
is GenericFileAttachmentViewHolder -> holder.bind(dataSet[position] as GenericFileAttachmentViewModel)
} }
} }
...@@ -175,15 +180,15 @@ class ChatRoomAdapter( ...@@ -175,15 +180,15 @@ class ChatRoomAdapter(
} }
} }
val actionsListener = object : BaseViewHolder.ActionsListener { private val actionsListener = object : BaseViewHolder.ActionsListener {
override fun isActionsEnabled(): Boolean = enableActions override fun isActionsEnabled(): Boolean = enableActions
override fun onActionSelected(item: MenuItem, message: Message) { override fun onActionSelected(item: MenuItem, message: Message) {
message.apply { message.apply {
when (item.itemId) { when (item.itemId) {
R.id.action_menu_msg_delete -> presenter?.deleteMessage(roomId, id) R.id.action_menu_msg_delete -> presenter?.deleteMessage(roomId, id)
R.id.action_menu_msg_quote -> presenter?.citeMessage(roomType, roomName, id, false) R.id.action_menu_msg_quote -> presenter?.citeMessage(roomType, id, false)
R.id.action_menu_msg_reply -> presenter?.citeMessage(roomType, roomName, id, true) R.id.action_menu_msg_reply -> presenter?.citeMessage(roomType, id, true)
R.id.action_menu_msg_copy -> presenter?.copyMessage(id) R.id.action_menu_msg_copy -> presenter?.copyMessage(id)
R.id.action_menu_msg_edit -> presenter?.editMessage(roomId, id, message.message) R.id.action_menu_msg_edit -> presenter?.editMessage(roomId, id, message.message)
R.id.action_menu_msg_pin_unpin -> { R.id.action_menu_msg_pin_unpin -> {
......
package chat.rocket.android.chatroom.adapter
import android.content.Intent
import android.net.Uri
import android.view.View
import chat.rocket.android.chatroom.viewmodel.GenericFileAttachmentViewModel
import chat.rocket.android.util.extensions.content
import chat.rocket.android.widget.emoji.EmojiReactionListener
import chat.rocket.common.util.ifNull
import kotlinx.android.synthetic.main.item_file_attachment.view.*
class GenericFileAttachmentViewHolder(itemView: View,
listener: ActionsListener,
reactionListener: EmojiReactionListener? = null)
: BaseViewHolder<GenericFileAttachmentViewModel>(itemView, listener, reactionListener) {
init {
with(itemView) {
setupActionMenu(file_attachment_container)
setupActionMenu(text_file_name)
}
}
override fun bindViews(data: GenericFileAttachmentViewModel) {
with(itemView) {
text_file_name.content = data.attachmentTitle
text_file_name.setOnClickListener {
it.context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(data.attachmentUrl)))
}
}
}
}
\ No newline at end of file
...@@ -31,7 +31,6 @@ import chat.rocket.core.internal.rest.* ...@@ -31,7 +31,6 @@ import chat.rocket.core.internal.rest.*
import chat.rocket.core.model.Command import chat.rocket.core.model.Command
import chat.rocket.core.model.Message import chat.rocket.core.model.Message
import chat.rocket.core.model.Myself import chat.rocket.core.model.Myself
import chat.rocket.core.model.Value
import kotlinx.coroutines.experimental.CommonPool import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.android.UI import kotlinx.coroutines.experimental.android.UI
import kotlinx.coroutines.experimental.async import kotlinx.coroutines.experimental.async
...@@ -59,10 +58,11 @@ class ChatRoomPresenter @Inject constructor( ...@@ -59,10 +58,11 @@ class ChatRoomPresenter @Inject constructor(
private val mapper: ViewModelMapper, private val mapper: ViewModelMapper,
private val jobSchedulerInteractor: JobSchedulerInteractor private val jobSchedulerInteractor: JobSchedulerInteractor
) { ) {
private val currentServer = serverInteractor.get()!! private val currentServer = serverInteractor.get()!!
private val manager = factory.create(currentServer) private val manager = factory.create(currentServer)
private val client = manager.client private val client = manager.client
private var settings: Map<String, Value<Any>> = getSettingsInteractor.get(serverInteractor.get()!!) private var settings: PublicSettings = getSettingsInteractor.get(serverInteractor.get()!!)
private val messagesChannel = Channel<Message>() private val messagesChannel = Channel<Message>()
private var chatRoomId: String? = null private var chatRoomId: String? = null
...@@ -194,7 +194,7 @@ class ChatRoomPresenter @Inject constructor( ...@@ -194,7 +194,7 @@ class ChatRoomPresenter @Inject constructor(
} }
} catch (ex: Exception) { } catch (ex: Exception) {
Timber.d(ex, "Error uploading file") Timber.d(ex, "Error uploading file")
when(ex) { when (ex) {
is RocketChatException -> view.showMessage(ex) is RocketChatException -> view.showMessage(ex)
else -> view.showGenericErrorMessage() else -> view.showGenericErrorMessage()
} }
...@@ -279,7 +279,6 @@ class ChatRoomPresenter @Inject constructor( ...@@ -279,7 +279,6 @@ class ChatRoomPresenter @Inject constructor(
// TODO - we need to better treat connection problems here, but no let gaps // TODO - we need to better treat connection problems here, but no let gaps
// on the messages list // on the messages list
Timber.d(ex, "Error fetching channel history") Timber.d(ex, "Error fetching channel history")
ex.printStackTrace()
} }
} }
} }
...@@ -326,43 +325,37 @@ class ChatRoomPresenter @Inject constructor( ...@@ -326,43 +325,37 @@ class ChatRoomPresenter @Inject constructor(
* Quote or reply a message. * Quote or reply a message.
* *
* @param roomType The current room type. * @param roomType The current room type.
* @param roomName The name of the current room.
* @param messageId The id of the message to make citation for. * @param messageId The id of the message to make citation for.
* @param mentionAuthor true means the citation is a reply otherwise it's a quote. * @param mentionAuthor true means the citation is a reply otherwise it's a quote.
*/ */
fun citeMessage(roomType: String, roomName: String, messageId: String, mentionAuthor: Boolean) { fun citeMessage(roomType: String, messageId: String, mentionAuthor: Boolean) {
launchUI(strategy) { launchUI(strategy) {
val message = messagesRepository.getById(messageId) val message = messagesRepository.getById(messageId)
val me: Myself? = try { val me: Myself? = try {
retryIO("me()") { client.me() } //TODO: Cache this and use an interactor retryIO("me()") { client.me() } //TODO: Cache this and use an interactor
} catch (ex: Exception) { } catch (ex: Exception) {
Timber.d(ex, "Error getting myself info.") Timber.e(ex)
ex.printStackTrace()
null null
} }
message?.let { m -> message?.let { msg ->
val id = m.id val id = msg.id
val username = m.sender?.username val username = msg.sender?.username ?: ""
val user = "@" + if (settings.useRealName()) m.sender?.name val mention = if (mentionAuthor && me?.username != username) "@$username" else ""
?: m.sender?.username else m.sender?.username val room = if (roomTypeOf(roomType) is RoomType.DirectMessage) username else roomType
val mention = if (mentionAuthor && me?.username != username) user else ""
val type = roomTypeOf(roomType)
val room = when (type) {
is RoomType.Channel -> "channel"
is RoomType.DirectMessage -> "direct"
is RoomType.PrivateGroup -> "group"
is RoomType.Livechat -> "livechat"
is RoomType.Custom -> "custom" //TODO: put appropriate callback string here.
}
view.showReplyingAction( view.showReplyingAction(
username = user, username = getDisplayName(msg.sender),
replyMarkdown = "[ ]($currentServer/$room/$roomName?msg=$id) $mention ", replyMarkdown = "[ ]($currentServer/$roomType/$room?msg=$id) $mention ",
quotedMessage = mapper.map(message).last().preview?.message ?: "" quotedMessage = mapper.map(message).last().preview?.message ?: ""
) )
} }
} }
} }
private fun getDisplayName(user: SimpleUser?): String {
val username = user?.username ?: ""
return if (settings.useRealName()) user?.name ?: "@$username" else "@$username"
}
/** /**
* Copy message to clipboard. * Copy message to clipboard.
* *
......
...@@ -35,6 +35,7 @@ import kotlinx.android.synthetic.main.fragment_chat_room.* ...@@ -35,6 +35,7 @@ import kotlinx.android.synthetic.main.fragment_chat_room.*
import kotlinx.android.synthetic.main.message_attachment_options.* import kotlinx.android.synthetic.main.message_attachment_options.*
import kotlinx.android.synthetic.main.message_composer.* import kotlinx.android.synthetic.main.message_composer.*
import kotlinx.android.synthetic.main.message_list.* import kotlinx.android.synthetic.main.message_list.*
import timber.log.Timber
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
import javax.inject.Inject import javax.inject.Inject
...@@ -228,6 +229,19 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -228,6 +229,19 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
verticalScrollOffset.set(0) verticalScrollOffset.set(0)
} }
presenter.loadActiveMembers(chatRoomId, chatRoomType, filterSelfOut = true) presenter.loadActiveMembers(chatRoomId, chatRoomType, filterSelfOut = true)
toggleNoChatView(adapter.itemCount)
}
}
private fun toggleNoChatView(size: Int) {
if (size == 0){
image_chat_icon.setVisible(true)
text_chat_title.setVisible(true)
text_chat_description.setVisible(true)
}else{
image_chat_icon.setVisible(false)
text_chat_title.setVisible(false)
text_chat_description.setVisible(false)
} }
} }
...@@ -312,6 +326,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -312,6 +326,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
adapter.prependData(message) adapter.prependData(message)
recycler_view.scrollToPosition(0) recycler_view.scrollToPosition(0)
verticalScrollOffset.set(0) verticalScrollOffset.set(0)
toggleNoChatView(adapter.itemCount)
} }
} }
......
...@@ -23,7 +23,8 @@ interface BaseViewModel<out T> { ...@@ -23,7 +23,8 @@ interface BaseViewModel<out T> {
AUDIO_ATTACHMENT(5), AUDIO_ATTACHMENT(5),
MESSAGE_ATTACHMENT(6), MESSAGE_ATTACHMENT(6),
AUTHOR_ATTACHMENT(7), AUTHOR_ATTACHMENT(7),
COLOR_ATTACHMENT(8) COLOR_ATTACHMENT(8),
GENERIC_FILE_ATTACHMENT(9)
} }
} }
......
package chat.rocket.android.chatroom.viewmodel
import chat.rocket.android.R
import chat.rocket.core.model.Message
import chat.rocket.core.model.attachment.GenericFileAttachment
import chat.rocket.core.model.attachment.ImageAttachment
data class GenericFileAttachmentViewModel(
override val message: Message,
override val rawData: GenericFileAttachment,
override val messageId: String,
override val attachmentUrl: String,
override val attachmentTitle: CharSequence,
override val id: Long,
override var reactions: List<ReactionViewModel>,
override var nextDownStreamMessage: BaseViewModel<*>? = null,
override var preview: Message? = null,
override var isTemporary: Boolean = false
) : BaseFileAttachmentViewModel<GenericFileAttachment> {
override val viewType: Int
get() = BaseViewModel.ViewType.GENERIC_FILE_ATTACHMENT.viewType
override val layoutId: Int
get() = R.layout.item_file_attachment
}
\ No newline at end of file
...@@ -5,7 +5,6 @@ import android.content.Context ...@@ -5,7 +5,6 @@ import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.graphics.Typeface import android.graphics.Typeface
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.text.Html
import android.text.SpannableStringBuilder import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan import android.text.style.StyleSpan
...@@ -32,21 +31,21 @@ import okhttp3.HttpUrl ...@@ -32,21 +31,21 @@ import okhttp3.HttpUrl
import java.security.InvalidParameterException import java.security.InvalidParameterException
import javax.inject.Inject import javax.inject.Inject
class ViewModelMapper @Inject constructor(private val context: Context, class ViewModelMapper @Inject constructor(
private val parser: MessageParser, private val context: Context,
private val messagesRepository: MessagesRepository, private val parser: MessageParser,
private val getAccountInteractor: GetAccountInteractor, tokenRepository: TokenRepository,
tokenRepository: TokenRepository, serverInteractor: GetCurrentServerInteractor,
serverInteractor: GetCurrentServerInteractor, getSettingsInteractor: GetSettingsInteractor,
getSettingsInteractor: GetSettingsInteractor, localRepository: LocalRepository
localRepository: LocalRepository) { ) {
private val currentServer = serverInteractor.get()!! private val currentServer = serverInteractor.get()!!
private val settings: Map<String, Value<Any>> = getSettingsInteractor.get(currentServer) private val settings: Map<String, Value<Any>> = getSettingsInteractor.get(currentServer)
private val baseUrl = settings.baseUrl() private val baseUrl = settings.baseUrl()
private val token = tokenRepository.get(currentServer) private val token = tokenRepository.get(currentServer)
private val currentUsername: String? = localRepository.get(LocalRepository.CURRENT_USERNAME_KEY) private val currentUsername: String? = localRepository.get(LocalRepository.CURRENT_USERNAME_KEY)
private val secundaryTextColor = ContextCompat.getColor(context, R.color.colorSecondaryText) private val secondaryTextColor = ContextCompat.getColor(context, R.color.colorSecondaryText)
suspend fun map(message: Message): List<BaseViewModel<*>> { suspend fun map(message: Message): List<BaseViewModel<*>> {
return translate(message) return translate(message)
...@@ -99,10 +98,10 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -99,10 +98,10 @@ class ViewModelMapper @Inject constructor(private val context: Context,
val description = url.meta?.description val description = url.meta?.description
return UrlPreviewViewModel(message, url, message.id, title, hostname, description, thumb, return UrlPreviewViewModel(message, url, message.id, title, hostname, description, thumb,
getReactions(message), preview = message.copy(message = url.url)) getReactions(message), preview = message.copy(message = url.url))
} }
private suspend fun mapAttachment(message: Message, attachment: Attachment): BaseViewModel<*>? { private fun mapAttachment(message: Message, attachment: Attachment): BaseViewModel<*>? {
return when (attachment) { return when (attachment) {
is FileAttachment -> mapFileAttachment(message, attachment) is FileAttachment -> mapFileAttachment(message, attachment)
is MessageAttachment -> mapMessageAttachment(message, attachment) is MessageAttachment -> mapMessageAttachment(message, attachment)
...@@ -112,19 +111,19 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -112,19 +111,19 @@ class ViewModelMapper @Inject constructor(private val context: Context,
} }
} }
private suspend fun mapColorAttachment(message: Message, attachment: ColorAttachment): BaseViewModel<*>? { private fun mapColorAttachment(message: Message, attachment: ColorAttachment): BaseViewModel<*>? {
return with(attachment) { return with(attachment) {
val content = stripMessageQuotes(message) val content = stripMessageQuotes(message)
val id = attachmentId(message, attachment) val id = attachmentId(message, attachment)
ColorAttachmentViewModel(attachmentUrl = url, id = id, color = color.color, ColorAttachmentViewModel(attachmentUrl = url, id = id, color = color.color,
text = text, message = message, rawData = attachment, text = text, message = message, rawData = attachment,
messageId = message.id, reactions = getReactions(message), messageId = message.id, reactions = getReactions(message),
preview = message.copy(message = content.message)) preview = message.copy(message = content.message))
} }
} }
private suspend fun mapAuthorAttachment(message: Message, attachment: AuthorAttachment): AuthorAttachmentViewModel { private fun mapAuthorAttachment(message: Message, attachment: AuthorAttachment): AuthorAttachmentViewModel {
return with(attachment) { return with(attachment) {
val content = stripMessageQuotes(message) val content = stripMessageQuotes(message)
...@@ -146,26 +145,27 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -146,26 +145,27 @@ class ViewModelMapper @Inject constructor(private val context: Context,
val id = attachmentId(message, attachment) val id = attachmentId(message, attachment)
AuthorAttachmentViewModel(attachmentUrl = url, id = id, name = authorName, AuthorAttachmentViewModel(attachmentUrl = url, id = id, name = authorName,
icon = authorIcon, fields = fieldsText, message = message, rawData = attachment, icon = authorIcon, fields = fieldsText, message = message, rawData = attachment,
messageId = message.id, reactions = getReactions(message), messageId = message.id, reactions = getReactions(message),
preview = message.copy(message = content.message)) preview = message.copy(message = content.message))
} }
} }
private suspend fun mapMessageAttachment(message: Message, attachment: MessageAttachment): MessageAttachmentViewModel { private fun mapMessageAttachment(message: Message, attachment: MessageAttachment): MessageAttachmentViewModel {
val attachmentAuthor = attachment.author val attachmentAuthor = attachment.author
val time = attachment.timestamp?.let { getTime(it) } val time = attachment.timestamp?.let { getTime(it) }
val attachmentText = when (attachment.attachments.orEmpty().firstOrNull()) { val attachmentText = when (attachment.attachments.orEmpty().firstOrNull()) {
is ImageAttachment -> context.getString(R.string.msg_preview_photo) is ImageAttachment -> context.getString(R.string.msg_preview_photo)
is VideoAttachment -> context.getString(R.string.msg_preview_video) is VideoAttachment -> context.getString(R.string.msg_preview_video)
is AudioAttachment -> context.getString(R.string.msg_preview_audio) is AudioAttachment -> context.getString(R.string.msg_preview_audio)
is GenericFileAttachment -> context.getString(R.string.msg_preview_file)
else -> attachment.text ?: "" else -> attachment.text ?: ""
} }
val content = stripMessageQuotes(message) val content = stripMessageQuotes(message)
return MessageAttachmentViewModel(message = content, rawData = message, return MessageAttachmentViewModel(message = content, rawData = message,
messageId = message.id, time = time, senderName = attachmentAuthor, messageId = message.id, time = time, senderName = attachmentAuthor,
content = attachmentText, isPinned = message.pinned, reactions = getReactions(message), content = attachmentText, isPinned = message.pinned, reactions = getReactions(message),
preview = message.copy(message = content.message)) preview = message.copy(message = content.message))
} }
private fun mapFileAttachment(message: Message, attachment: FileAttachment): BaseViewModel<*>? { private fun mapFileAttachment(message: Message, attachment: FileAttachment): BaseViewModel<*>? {
...@@ -174,14 +174,17 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -174,14 +174,17 @@ class ViewModelMapper @Inject constructor(private val context: Context,
val id = attachmentId(message, attachment) val id = attachmentId(message, attachment)
return when (attachment) { return when (attachment) {
is ImageAttachment -> ImageAttachmentViewModel(message, attachment, message.id, is ImageAttachment -> ImageAttachmentViewModel(message, attachment, message.id,
attachmentUrl, attachmentTitle, id, getReactions(message), attachmentUrl, attachmentTitle, id, getReactions(message),
preview = message.copy(message = context.getString(R.string.msg_preview_photo))) preview = message.copy(message = context.getString(R.string.msg_preview_photo)))
is VideoAttachment -> VideoAttachmentViewModel(message, attachment, message.id, is VideoAttachment -> VideoAttachmentViewModel(message, attachment, message.id,
attachmentUrl, attachmentTitle, id, getReactions(message), attachmentUrl, attachmentTitle, id, getReactions(message),
preview = message.copy(message = context.getString(R.string.msg_preview_video))) preview = message.copy(message = context.getString(R.string.msg_preview_video)))
is AudioAttachment -> AudioAttachmentViewModel(message, attachment, message.id, is AudioAttachment -> AudioAttachmentViewModel(message, attachment, message.id,
attachmentUrl, attachmentTitle, id, getReactions(message), attachmentUrl, attachmentTitle, id, getReactions(message),
preview = message.copy(message = context.getString(R.string.msg_preview_audio))) preview = message.copy(message = context.getString(R.string.msg_preview_audio)))
is GenericFileAttachment -> GenericFileAttachmentViewModel(message, attachment,
message.id, attachmentUrl, attachmentTitle, id, getReactions(message),
preview = message.copy(message = context.getString(R.string.msg_preview_file)))
else -> null else -> null
} }
} }
...@@ -230,12 +233,12 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -230,12 +233,12 @@ class ViewModelMapper @Inject constructor(private val context: Context,
val content = getContent(stripMessageQuotes(message)) val content = getContent(stripMessageQuotes(message))
MessageViewModel(message = stripMessageQuotes(message), rawData = message, MessageViewModel(message = stripMessageQuotes(message), rawData = message,
messageId = message.id, avatar = avatar!!, time = time, senderName = sender, messageId = message.id, avatar = avatar!!, time = time, senderName = sender,
content = content, isPinned = message.pinned, reactions = getReactions(message), content = content, isPinned = message.pinned, reactions = getReactions(message),
isFirstUnread = false, preview = preview, isTemporary = isTemp) isFirstUnread = false, preview = preview, isTemporary = isTemp)
} }
private suspend fun mapMessagePreview(message: Message): Message { private fun mapMessagePreview(message: Message): Message {
return when (message.isSystemMessage()) { return when (message.isSystemMessage()) {
false -> stripMessageQuotes(message) false -> stripMessageQuotes(message)
true -> message.copy(message = getSystemMessage(message).toString()) true -> message.copy(message = getSystemMessage(message).toString())
...@@ -249,11 +252,11 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -249,11 +252,11 @@ class ViewModelMapper @Inject constructor(private val context: Context,
val usernames = it.getUsernames(shortname) ?: emptyList() val usernames = it.getUsernames(shortname) ?: emptyList()
val count = usernames.size val count = usernames.size
list.add( list.add(
ReactionViewModel(messageId = message.id, ReactionViewModel(messageId = message.id,
shortname = shortname, shortname = shortname,
unicode = EmojiParser.parse(shortname), unicode = EmojiParser.parse(shortname),
count = count, count = count,
usernames = usernames) usernames = usernames)
) )
} }
list list
...@@ -261,10 +264,10 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -261,10 +264,10 @@ class ViewModelMapper @Inject constructor(private val context: Context,
return reactions ?: emptyList() return reactions ?: emptyList()
} }
private suspend fun stripMessageQuotes(message: Message): Message { private fun stripMessageQuotes(message: Message): Message {
val baseUrl = settings.baseUrl() val baseUrl = settings.baseUrl()
return message.copy( return message.copy(
message = message.message.replace("\\[[^\\]]+\\]\\($baseUrl[^)]+\\)".toRegex(), "").trim() message = message.message.replace("\\[[^\\]]+\\]\\($baseUrl[^)]+\\)".toRegex(), "").trim()
) )
} }
...@@ -276,7 +279,7 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -276,7 +279,7 @@ class ViewModelMapper @Inject constructor(private val context: Context,
username?.let { username?.let {
append(" ") append(" ")
scale(0.8f) { scale(0.8f) {
color(secundaryTextColor) { color(secondaryTextColor) {
append("@$username") append("@$username")
} }
} }
...@@ -302,10 +305,10 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -302,10 +305,10 @@ class ViewModelMapper @Inject constructor(private val context: Context,
private fun getTime(timestamp: Long) = DateTimeHelper.getTime(DateTimeHelper.getLocalDateTime(timestamp)) private fun getTime(timestamp: Long) = DateTimeHelper.getTime(DateTimeHelper.getLocalDateTime(timestamp))
private suspend fun getContent(message: Message): CharSequence { private fun getContent(message: Message): CharSequence {
return when (message.isSystemMessage()) { return when (message.isSystemMessage()) {
true -> getSystemMessage(message) true -> getSystemMessage(message)
false -> parser.renderMarkdown(message, currentUsername) false -> parser.render(message, currentUsername)
} }
} }
...@@ -325,9 +328,9 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -325,9 +328,9 @@ class ViewModelMapper @Inject constructor(private val context: Context,
} }
val spannableMsg = SpannableStringBuilder(content) val spannableMsg = SpannableStringBuilder(content)
spannableMsg.setSpan(StyleSpan(Typeface.ITALIC), 0, spannableMsg.length, spannableMsg.setSpan(StyleSpan(Typeface.ITALIC), 0, spannableMsg.length,
0) 0)
spannableMsg.setSpan(ForegroundColorSpan(Color.GRAY), 0, spannableMsg.length, spannableMsg.setSpan(ForegroundColorSpan(Color.GRAY), 0, spannableMsg.length,
0) 0)
return spannableMsg return spannableMsg
} }
......
...@@ -3,6 +3,7 @@ package chat.rocket.android.dagger.module ...@@ -3,6 +3,7 @@ package chat.rocket.android.dagger.module
import chat.rocket.android.authentication.di.AuthenticationModule import chat.rocket.android.authentication.di.AuthenticationModule
import chat.rocket.android.authentication.login.di.LoginFragmentProvider import chat.rocket.android.authentication.login.di.LoginFragmentProvider
import chat.rocket.android.authentication.registerusername.di.RegisterUsernameFragmentProvider import chat.rocket.android.authentication.registerusername.di.RegisterUsernameFragmentProvider
import chat.rocket.android.authentication.resetpassword.di.ResetPasswordFragmentProvider
import chat.rocket.android.authentication.server.di.ServerFragmentProvider import chat.rocket.android.authentication.server.di.ServerFragmentProvider
import chat.rocket.android.authentication.signup.di.SignupFragmentProvider import chat.rocket.android.authentication.signup.di.SignupFragmentProvider
import chat.rocket.android.authentication.twofactor.di.TwoFAFragmentProvider import chat.rocket.android.authentication.twofactor.di.TwoFAFragmentProvider
...@@ -33,6 +34,7 @@ abstract class ActivityBuilder { ...@@ -33,6 +34,7 @@ abstract class ActivityBuilder {
ServerFragmentProvider::class, ServerFragmentProvider::class,
LoginFragmentProvider::class, LoginFragmentProvider::class,
RegisterUsernameFragmentProvider::class, RegisterUsernameFragmentProvider::class,
ResetPasswordFragmentProvider::class,
SignupFragmentProvider::class, SignupFragmentProvider::class,
TwoFAFragmentProvider::class TwoFAFragmentProvider::class
]) ])
......
...@@ -167,6 +167,7 @@ class AppModule { ...@@ -167,6 +167,7 @@ class AppModule {
} }
@Provides @Provides
@Singleton
fun provideSharedPreferences(context: Application) = fun provideSharedPreferences(context: Application) =
context.getSharedPreferences("rocket.chat", Context.MODE_PRIVATE) context.getSharedPreferences("rocket.chat", Context.MODE_PRIVATE)
...@@ -269,9 +270,9 @@ class AppModule { ...@@ -269,9 +270,9 @@ class AppModule {
} }
@Provides @Provides
@Singleton fun provideMessageParser(context: Application, configuration: SpannableConfiguration, serverInteractor: GetCurrentServerInteractor, settingsInteractor: GetSettingsInteractor): MessageParser {
fun provideMessageParser(context: Application, configuration: SpannableConfiguration): MessageParser { val url = serverInteractor.get()!!
return MessageParser(context, configuration) return MessageParser(context, configuration, settingsInteractor.get(url))
} }
@Provides @Provides
......
package chat.rocket.android.helper package chat.rocket.android.helper
import android.app.Application import android.app.Application
import android.content.ActivityNotFoundException
import android.content.Context import android.content.Context
import android.content.Intent
import android.graphics.Canvas import android.graphics.Canvas
import android.graphics.Paint import android.graphics.Paint
import android.graphics.RectF import android.graphics.RectF
import android.net.Uri import android.net.Uri
import android.support.customtabs.CustomTabsIntent import android.support.customtabs.CustomTabsIntent
import android.provider.Browser
import android.support.v4.content.res.ResourcesCompat import android.support.v4.content.res.ResourcesCompat
import android.text.Spanned import android.text.Spanned
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
...@@ -17,6 +14,8 @@ import android.text.style.ReplacementSpan ...@@ -17,6 +14,8 @@ import android.text.style.ReplacementSpan
import android.util.Patterns import android.util.Patterns
import android.view.View import android.view.View
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.server.domain.PublicSettings
import chat.rocket.android.server.domain.useRealName
import chat.rocket.android.widget.emoji.EmojiParser import chat.rocket.android.widget.emoji.EmojiParser
import chat.rocket.android.widget.emoji.EmojiRepository import chat.rocket.android.widget.emoji.EmojiRepository
import chat.rocket.android.widget.emoji.EmojiTypefaceSpan import chat.rocket.android.widget.emoji.EmojiTypefaceSpan
...@@ -29,23 +28,34 @@ import ru.noties.markwon.Markwon ...@@ -29,23 +28,34 @@ import ru.noties.markwon.Markwon
import ru.noties.markwon.SpannableBuilder import ru.noties.markwon.SpannableBuilder
import ru.noties.markwon.SpannableConfiguration import ru.noties.markwon.SpannableConfiguration
import ru.noties.markwon.renderer.SpannableMarkdownVisitor import ru.noties.markwon.renderer.SpannableMarkdownVisitor
import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
class MessageParser @Inject constructor(val context: Application, private val configuration: SpannableConfiguration) { class MessageParser @Inject constructor(
private val context: Application,
private val configuration: SpannableConfiguration,
private val settings: PublicSettings
) {
private val parser = Markwon.createParser() private val parser = Markwon.createParser()
/** /**
* Render a markdown text message to Spannable. * Render markdown and other rules on message to rich text with spans.
* *
* @param message The [Message] object we're interested on rendering. * @param message The [Message] object we're interested on rendering.
* @param selfUsername This user username. * @param selfUsername This user username.
* *
* @return A Spannable with the parsed markdown. * @return A Spannable with the parsed markdown.
*/ */
fun renderMarkdown(message: Message, selfUsername: String? = null): CharSequence { fun render(message: Message, selfUsername: String? = null): CharSequence {
val text = message.message var text: String = message.message
val mentions = mutableListOf<String>()
message.mentions?.forEach {
val mention = getMention(it)
mentions.add(mention)
if (it.username != null) {
text = text.replace("@${it.username}", mention)
}
}
val builder = SpannableBuilder() val builder = SpannableBuilder()
val content = EmojiRepository.shortnameToUnicode(text, true) val content = EmojiRepository.shortnameToUnicode(text, true)
val parentNode = parser.parse(toLenientMarkdown(content)) val parentNode = parser.parse(toLenientMarkdown(content))
...@@ -53,7 +63,7 @@ class MessageParser @Inject constructor(val context: Application, private val co ...@@ -53,7 +63,7 @@ class MessageParser @Inject constructor(val context: Application, private val co
parentNode.accept(LinkVisitor(builder)) parentNode.accept(LinkVisitor(builder))
parentNode.accept(EmojiVisitor(configuration, builder)) parentNode.accept(EmojiVisitor(configuration, builder))
message.mentions?.let { message.mentions?.let {
parentNode.accept(MentionVisitor(context, builder, it, selfUsername)) parentNode.accept(MentionVisitor(context, builder, mentions, selfUsername))
} }
return builder.text() return builder.text()
...@@ -62,47 +72,61 @@ class MessageParser @Inject constructor(val context: Application, private val co ...@@ -62,47 +72,61 @@ class MessageParser @Inject constructor(val context: Application, private val co
// Convert to a lenient markdown consistent with Rocket.Chat web markdown instead of the official specs. // Convert to a lenient markdown consistent with Rocket.Chat web markdown instead of the official specs.
private fun toLenientMarkdown(text: String): String { private fun toLenientMarkdown(text: String): String {
return text.trim().replace("\\*(.+)\\*".toRegex()) { "**${it.groupValues[1].trim()}**" } return text.trim().replace("\\*(.+)\\*".toRegex()) { "**${it.groupValues[1].trim()}**" }
.replace("\\~(.+)\\~".toRegex()) { "~~${it.groupValues[1].trim()}~~" } .replace("\\~(.+)\\~".toRegex()) { "~~${it.groupValues[1].trim()}~~" }
.replace("\\_(.+)\\_".toRegex()) { "_${it.groupValues[1].trim()}_" } .replace("\\_(.+)\\_".toRegex()) { "_${it.groupValues[1].trim()}_" }
}
private fun getMention(user: SimpleUser): String {
return if (settings.useRealName()) {
user.name ?: "@${user.username}"
} else {
"@${user.username}"
}
} }
class MentionVisitor(context: Context, class MentionVisitor(
private val builder: SpannableBuilder, context: Context,
private val mentions: List<SimpleUser>, private val builder: SpannableBuilder,
private val currentUser: String?) : AbstractVisitor() { private val mentions: List<String>,
private val currentUser: String?
) : AbstractVisitor() {
private val othersTextColor = ResourcesCompat.getColor(context.resources, R.color.colorAccent, context.theme) private val othersTextColor = ResourcesCompat.getColor(context.resources, R.color.colorAccent, context.theme)
private val othersBackgroundColor = ResourcesCompat.getColor(context.resources, android.R.color.transparent, context.theme) private val othersBackgroundColor = ResourcesCompat.getColor(context.resources, android.R.color.transparent, context.theme)
private val myselfTextColor = ResourcesCompat.getColor(context.resources, R.color.white, context.theme) private val myselfTextColor = ResourcesCompat.getColor(context.resources, R.color.white, context.theme)
private val myselfBackgroundColor = ResourcesCompat.getColor(context.resources, R.color.colorAccent, context.theme) private val myselfBackgroundColor = ResourcesCompat.getColor(context.resources, R.color.colorAccent, context.theme)
private val mentionPadding = context.resources.getDimensionPixelSize(R.dimen.padding_mention).toFloat() private val mentionPadding = context.resources.getDimensionPixelSize(R.dimen.padding_mention).toFloat()
private val mentionRadius = context.resources.getDimensionPixelSize(R.dimen.radius_mention).toFloat() private val mentionRadius = context.resources.getDimensionPixelSize(R.dimen.radius_mention).toFloat()
override fun visit(t: Text) { override fun visit(t: Text) {
val text = t.literal val text = t.literal
val mentionsList = mentions.map { it.username }.toMutableList() val mentionsList = mentions.toMutableList().also {
mentionsList.add("all") it.add("@all")
mentionsList.add("here") it.add("@here")
}.toList()
mentionsList.toList().forEach {
if (it != null) { mentionsList.forEach {
val mentionMe = it == currentUser || it == "all" || it == "here" val mentionMe = it == currentUser || it == "@all" || it == "@here"
var offset = text.indexOf("@$it", 0, true) var offset = text.indexOf(it, 0, true)
while (offset > -1) { while (offset > -1) {
val textColor = if (mentionMe) myselfTextColor else othersTextColor val textColor = if (mentionMe) myselfTextColor else othersTextColor
val backgroundColor = if (mentionMe) myselfBackgroundColor else othersBackgroundColor val backgroundColor = if (mentionMe) myselfBackgroundColor else othersBackgroundColor
val usernameSpan = MentionSpan(backgroundColor, textColor, mentionRadius, mentionPadding, val usernameSpan = MentionSpan(backgroundColor, textColor, mentionRadius, mentionPadding,
mentionMe) mentionMe)
// Add 1 to end offset to include the @. // Add 1 to end offset to include the @.
val end = offset + it.length + 1 val end = offset + it.length + 1
builder.setSpan(usernameSpan, offset, end, 0) builder.setSpan(usernameSpan, offset, end, 0)
offset = text.indexOf("@$it", end, true) offset = text.indexOf("@$it", end, true)
}
} }
} }
} }
} }
class EmojiVisitor(configuration: SpannableConfiguration, private val builder: SpannableBuilder) class EmojiVisitor(
: SpannableMarkdownVisitor(configuration, builder) { configuration: SpannableConfiguration,
private val builder: SpannableBuilder
) : SpannableMarkdownVisitor(configuration, builder) {
override fun visit(document: Document) { override fun visit(document: Document) {
val spannable = EmojiParser.parse(builder.text()) val spannable = EmojiParser.parse(builder.text())
if (spannable is Spanned) { if (spannable is Spanned) {
...@@ -127,7 +151,7 @@ class MessageParser @Inject constructor(val context: Application, private val co ...@@ -127,7 +151,7 @@ class MessageParser @Inject constructor(val context: Application, private val co
if (!link.startsWith("@") && link !in consumed) { if (!link.startsWith("@") && link !in consumed) {
builder.setSpan(object : ClickableSpan() { builder.setSpan(object : ClickableSpan() {
override fun onClick(view: View) { override fun onClick(view: View) {
with (view) { with(view) {
val tabsbuilder = CustomTabsIntent.Builder() val tabsbuilder = CustomTabsIntent.Builder()
tabsbuilder.setToolbarColor(ResourcesCompat.getColor(context.resources, R.color.colorPrimary, context.theme)) tabsbuilder.setToolbarColor(ResourcesCompat.getColor(context.resources, R.color.colorPrimary, context.theme))
val customTabsIntent = tabsbuilder.build() val customTabsIntent = tabsbuilder.build()
...@@ -150,11 +174,14 @@ class MessageParser @Inject constructor(val context: Application, private val co ...@@ -150,11 +174,14 @@ class MessageParser @Inject constructor(val context: Application, private val co
} }
} }
class MentionSpan(private val backgroundColor: Int, class MentionSpan(
private val textColor: Int, private val backgroundColor: Int,
private val radius: Float, private val textColor: Int,
padding: Float, private val radius: Float,
referSelf: Boolean) : ReplacementSpan() { padding: Float,
referSelf: Boolean
) : ReplacementSpan() {
private val padding: Float = if (referSelf) padding else 0F private val padding: Float = if (referSelf) padding else 0F
override fun getSize(paint: Paint, override fun getSize(paint: Paint,
......
...@@ -91,4 +91,34 @@ object OauthHelper { ...@@ -91,4 +91,34 @@ object OauthHelper {
"&response_type=code" + "&response_type=code" +
"&scope=email" "&scope=email"
} }
/**
* Returns the Custom Oauth URL.
*
* @param host The custom OAuth host.
* @param authorizePath The OAuth authorization path.
* @param clientId The custom OAuth client ID.
* @param serverUrl The server URL.
* @param serviceName The service name.
* @param state An unguessable random string used to protect against forgery attacks.
* @param scope The custom OAuth scope.
* @return The Custom Oauth URL.
*/
fun getCustomOauthUrl(
host: String,
authorizePath: String,
clientId: String,
serverUrl: String,
serviceName: String,
state: String,
scope: String
): String {
return host +
authorizePath +
"?client_id=$clientId" +
"&redirect_uri=${serverUrl.removeTrailingSlash()}/_oauth/$serviceName" +
"&state=$state" +
"&scope=$scope" +
"&response_type=code"
}
} }
...@@ -7,11 +7,11 @@ interface LocalRepository { ...@@ -7,11 +7,11 @@ interface LocalRepository {
fun save(key: String, value: Int) fun save(key: String, value: Int)
fun save(key: String, value: Long) fun save(key: String, value: Long)
fun save(key: String, value: Float) fun save(key: String, value: Float)
fun get(key: String): String? fun get(key: String, defValue: String? = null): String?
fun getBoolean(key: String): Boolean fun getBoolean(key: String, defValue: Boolean = false): Boolean
fun getFloat(key: String): Float fun getFloat(key: String, defValue: Float = -1f): Float
fun getInt(key: String): Int fun getInt(key: String, defValue: Int = -1): Int
fun getLong(key: String): Long fun getLong(key: String, defValue: Long = -1L): Long
fun clear(key: String) fun clear(key: String)
fun clearAllFromServer(server: String) fun clearAllFromServer(server: String)
......
package chat.rocket.android.infrastructure package chat.rocket.android.infrastructure
import android.content.SharedPreferences import android.content.SharedPreferences
import androidx.core.content.edit
class SharedPrefsLocalRepository(private val preferences: SharedPreferences) : LocalRepository { class SharedPrefsLocalRepository(private val preferences: SharedPreferences) : LocalRepository {
override fun getBoolean(key: String) = preferences.getBoolean(key, false) override fun getBoolean(key: String, defValue: Boolean) = preferences.getBoolean(key, defValue)
override fun getFloat(key: String) = preferences.getFloat(key, -1f) override fun getFloat(key: String, defValue: Float) = preferences.getFloat(key, defValue)
override fun getInt(key: String) = preferences.getInt(key, -1) override fun getInt(key: String, defValue: Int) = preferences.getInt(key, defValue)
override fun getLong(key: String) = preferences.getLong(key, -1L) override fun getLong(key: String, defValue: Long) = preferences.getLong(key, defValue)
override fun save(key: String, value: Int) = preferences.edit().putInt(key, value).apply() override fun save(key: String, value: Int) = preferences.edit { putInt(key, value) }
override fun save(key: String, value: Float) = preferences.edit().putFloat(key, value).apply() override fun save(key: String, value: Float) = preferences.edit { putFloat(key, value) }
override fun save(key: String, value: Long) = preferences.edit().putLong(key, value).apply() override fun save(key: String, value: Long) = preferences.edit { putLong(key, value) }
override fun save(key: String, value: Boolean) = preferences.edit().putBoolean(key, value).apply() override fun save(key: String, value: Boolean) = preferences.edit { putBoolean(key, value) }
override fun save(key: String, value: String?) = preferences.edit().putString(key, value).apply() override fun save(key: String, value: String?) = preferences.edit { putString(key, value) }
override fun get(key: String): String? = preferences.getString(key, null) override fun get(key: String, defValue: String?): String? = preferences.getString(key, defValue)
override fun clear(key: String) = preferences.edit().remove(key).apply() override fun clear(key: String) = preferences.edit { remove(key) }
override fun clearAllFromServer(server: String) { override fun clearAllFromServer(server: String) {
clear(LocalRepository.KEY_PUSH_TOKEN) clear(LocalRepository.KEY_PUSH_TOKEN)
......
package chat.rocket.android.util.extensions package chat.rocket.android.util.extensions
import android.graphics.Color
import android.util.Patterns import android.util.Patterns
import timber.log.Timber
fun String.removeTrailingSlash(): String { fun String.removeTrailingSlash(): String {
return if (isNotEmpty() && this[length - 1] == '/') { return if (isNotEmpty() && this[length - 1] == '/') {
...@@ -32,4 +34,14 @@ fun String.termsOfServiceUrl() = "${removeTrailingSlash()}/terms-of-service" ...@@ -32,4 +34,14 @@ fun String.termsOfServiceUrl() = "${removeTrailingSlash()}/terms-of-service"
fun String.privacyPolicyUrl() = "${removeTrailingSlash()}/privacy-policy" fun String.privacyPolicyUrl() = "${removeTrailingSlash()}/privacy-policy"
fun String.isValidUrl(): Boolean = Patterns.WEB_URL.matcher(this).matches() fun String.isValidUrl(): Boolean = Patterns.WEB_URL.matcher(this).matches()
\ No newline at end of file
fun String.parseColor(): Int {
return try {
Color.parseColor(this)
} catch (exception: IllegalArgumentException) {
// Log the exception and get the white color.
Timber.e(exception)
Color.parseColor("white")
}
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ import android.view.inputmethod.InputMethodManager ...@@ -15,6 +15,7 @@ import android.view.inputmethod.InputMethodManager
import android.widget.Toast import android.widget.Toast
import chat.rocket.android.R import chat.rocket.android.R
// TODO: Remove. Use KTX instead.
fun View.setVisible(visible: Boolean) { fun View.setVisible(visible: Boolean) {
visibility = if (visible) { visibility = if (visible) {
View.VISIBLE View.VISIBLE
...@@ -28,30 +29,42 @@ fun View.isVisible(): Boolean { ...@@ -28,30 +29,42 @@ fun View.isVisible(): Boolean {
} }
fun ViewGroup.inflate(@LayoutRes resource: Int, attachToRoot: Boolean = false): View = fun ViewGroup.inflate(@LayoutRes resource: Int, attachToRoot: Boolean = false): View =
LayoutInflater.from(context).inflate(resource, this, attachToRoot) LayoutInflater.from(context).inflate(resource, this, attachToRoot)
fun AppCompatActivity.addFragment(tag: String, layoutId: Int, newInstance: () -> Fragment) { fun AppCompatActivity.addFragment(tag: String, layoutId: Int, newInstance: () -> Fragment) {
val fragment = supportFragmentManager.findFragmentByTag(tag) ?: newInstance() val fragment = supportFragmentManager.findFragmentByTag(tag) ?: newInstance()
supportFragmentManager.beginTransaction() supportFragmentManager.beginTransaction()
.replace(layoutId, fragment, tag) .replace(layoutId, fragment, tag)
.commit() .commit()
} }
fun AppCompatActivity.addFragmentBackStack(tag: String, layoutId: Int, fun AppCompatActivity.addFragmentBackStack(
newInstance: () -> Fragment) { tag: String,
layoutId: Int,
newInstance: () -> Fragment
) {
val fragment = supportFragmentManager.findFragmentByTag(tag) ?: newInstance() val fragment = supportFragmentManager.findFragmentByTag(tag) ?: newInstance()
supportFragmentManager.beginTransaction() supportFragmentManager.beginTransaction()
.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, .setCustomAnimations(
R.anim.enter_from_left, R.anim.exit_to_right) R.anim.enter_from_right, R.anim.exit_to_left,
.replace(layoutId, fragment, tag) R.anim.enter_from_left, R.anim.exit_to_right
.addToBackStack(tag) )
.commit() .replace(layoutId, fragment, tag)
.addToBackStack(tag)
.commit()
}
fun AppCompatActivity.toPreviousView() {
supportFragmentManager.popBackStack()
} }
fun Activity.hideKeyboard() { fun Activity.hideKeyboard() {
if (currentFocus != null) { if (currentFocus != null) {
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(currentFocus.windowToken, InputMethodManager.RESULT_UNCHANGED_SHOWN) imm.hideSoftInputFromWindow(
currentFocus.windowToken,
InputMethodManager.RESULT_UNCHANGED_SHOWN
)
} }
} }
...@@ -61,16 +74,16 @@ fun Activity.showKeyboard(view: View) { ...@@ -61,16 +74,16 @@ fun Activity.showKeyboard(view: View) {
} }
fun Activity.showToast(@StringRes resource: Int, duration: Int = Toast.LENGTH_SHORT) = fun Activity.showToast(@StringRes resource: Int, duration: Int = Toast.LENGTH_SHORT) =
showToast(getString(resource), duration) showToast(getString(resource), duration)
fun Activity.showToast(message: String, duration: Int = Toast.LENGTH_SHORT) = fun Activity.showToast(message: String, duration: Int = Toast.LENGTH_SHORT) =
Toast.makeText(this, message, duration).show() Toast.makeText(this, message, duration).show()
fun Fragment.showToast(@StringRes resource: Int, duration: Int = Toast.LENGTH_SHORT) = fun Fragment.showToast(@StringRes resource: Int, duration: Int = Toast.LENGTH_SHORT) =
showToast(getString(resource), duration) showToast(getString(resource), duration)
fun Fragment.showToast(message: String, duration: Int = Toast.LENGTH_SHORT) = fun Fragment.showToast(message: String, duration: Int = Toast.LENGTH_SHORT) =
activity?.showToast(message, duration) activity?.showToast(message, duration)
fun RecyclerView.isAtBottom(): Boolean { fun RecyclerView.isAtBottom(): Boolean {
val manager: RecyclerView.LayoutManager? = layoutManager val manager: RecyclerView.LayoutManager? = layoutManager
......
...@@ -78,6 +78,7 @@ class OauthWebViewActivity : AppCompatActivity() { ...@@ -78,6 +78,7 @@ class OauthWebViewActivity : AppCompatActivity() {
private fun setupWebView() { private fun setupWebView() {
with(web_view.settings) { with(web_view.settings) {
javaScriptEnabled = true javaScriptEnabled = true
domStorageEnabled = true
// TODO Remove this workaround that is required to make Google OAuth to work. We should use Custom Tabs instead. See https://github.com/RocketChat/Rocket.Chat.Android/issues/968 // TODO Remove this workaround that is required to make Google OAuth to work. We should use Custom Tabs instead. See https://github.com/RocketChat/Rocket.Chat.Android/issues/968
if (webPageUrl.contains("google")) { if (webPageUrl.contains("google")) {
userAgentString = "Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/43.0.2357.65 Mobile Safari/535.19" userAgentString = "Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/43.0.2357.65 Mobile Safari/535.19"
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM6,9h12v2L6,11L6,9zM14,14L6,14v-2h8v2zM18,8L6,8L6,6h12v2z"/>
</vector>
...@@ -72,6 +72,21 @@ ...@@ -72,6 +72,21 @@
app:layout_constraintTop_toBottomOf="@+id/button_cas" app:layout_constraintTop_toBottomOf="@+id/button_cas"
tools:visibility="visible" /> tools:visibility="visible" />
<TextView
android:id="@+id/text_forgot_your_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/screen_edge_left_and_right_margins"
android:layout_marginStart="@dimen/screen_edge_left_and_right_margins"
android:layout_marginTop="8dp"
android:gravity="center"
android:textColorLink="@color/colorAccent"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_new_to_rocket_chat"
tools:visibility="visible" />
<com.wang.avi.AVLoadingIndicatorView <com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading" android:id="@+id/view_loading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -99,7 +114,7 @@ ...@@ -99,7 +114,7 @@
android:visibility="gone" android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_new_to_rocket_chat" app:layout_constraintTop_toBottomOf="@+id/text_forgot_your_password"
tools:visibility="visible"> tools:visibility="visible">
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:layout_height="match_parent"
tools:context=".authentication.resetpassword.ui.ResetPasswordFragment">
<TextView
android:id="@+id/text_headline"
style="@style/Authentication.Headline.TextView"
android:layout_centerHorizontal="true"
android:text="@string/title_reset_password" />
<EditText
android:id="@+id/text_email"
style="@style/Authentication.EditText"
android:layout_below="@id/text_headline"
android:layout_marginTop="32dp"
android:drawableStart="@drawable/ic_email_black_24dp"
android:hint="@string/msg_email"
android:imeOptions="actionDone"
android:inputType="textEmailAddress" />
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/view_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
app:indicatorName="BallPulseIndicator"
tools:visibility="visible" />
<Button
android:id="@+id/button_reset_password"
style="@style/Authentication.Button"
android:layout_alignParentBottom="true"
android:text="@string/title_reset_password" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root_layout" android:id="@+id/root_layout"
...@@ -11,7 +12,10 @@ ...@@ -11,7 +12,10 @@
android:id="@+id/view_loading" android:id="@+id/view_loading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone" android:visibility="gone"
app:indicatorColor="@color/black" app:indicatorColor="@color/black"
app:indicatorName="BallPulseIndicator" app:indicatorName="BallPulseIndicator"
...@@ -19,9 +23,12 @@ ...@@ -19,9 +23,12 @@
<FrameLayout <FrameLayout
android:id="@+id/message_list_container" android:id="@+id/message_list_container"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="0dp"
android:layout_above="@+id/layout_message_composer"> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/layout_message_composer">
<include <include
android:id="@+id/layout_message_list" android:id="@+id/layout_message_list"
...@@ -31,11 +38,57 @@ ...@@ -31,11 +38,57 @@
</FrameLayout> </FrameLayout>
<ImageView
android:id="@+id/image_chat_icon"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/ic_chat_black_24dp"
android:tint="@color/icon_grey"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/text_chat_title"
app:layout_constraintVertical_chainStyle="packed"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/text_chat_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/msg_no_chat_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/image_chat_icon"
app:layout_constraintBottom_toTopOf="@id/text_chat_description"
android:textSize="20sp"
android:layout_marginTop="24dp"
android:textStyle="bold"
android:textColor="@color/colorSecondaryText"
android:visibility="gone"
tools:visibility="visible"/>
<TextView
android:id="@+id/text_chat_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/msg_no_chat_description"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_chat_title"
app:layout_constraintBottom_toTopOf="@id/layout_message_composer"
android:layout_marginTop="16dp"
android:textAlignment="center"
android:textSize="16sp"
android:textColor="@color/colorSecondaryTextLight"
android:visibility="gone"
tools:visibility="visible"/>
<chat.rocket.android.widget.autocompletion.ui.SuggestionsView <chat.rocket.android.widget.autocompletion.ui.SuggestionsView
android:id="@+id/suggestions_view" android:id="@+id/suggestions_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/layout_message_composer" app:layout_constraintBottom_toTopOf="@id/layout_message_composer"
android:background="@color/suggestion_background_color" /> android:background="@color/suggestion_background_color" />
<include <include
...@@ -43,13 +96,13 @@ ...@@ -43,13 +96,13 @@
layout="@layout/message_composer" layout="@layout/message_composer"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" /> app:layout_constraintBottom_toBottomOf="parent" />
<View <View
android:id="@+id/view_dim" android:id="@+id/view_dim"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_above="@+id/layout_message_composer" app:layout_constraintBottom_toTopOf="@id/layout_message_composer"
android:background="@color/colorDim" android:background="@color/colorDim"
android:visibility="gone" /> android:visibility="gone" />
...@@ -58,7 +111,7 @@ ...@@ -58,7 +111,7 @@
layout="@layout/message_attachment_options" layout="@layout/message_attachment_options"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@+id/layout_message_composer" app:layout_constraintBottom_toTopOf="@id/layout_message_composer"
android:layout_margin="5dp" android:layout_margin="5dp"
android:visibility="gone" /> android:visibility="gone" />
...@@ -77,4 +130,4 @@ ...@@ -77,4 +130,4 @@
tools:text="connected" tools:text="connected"
tools:visibility="visible" /> tools:visibility="visible" />
</RelativeLayout> </android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -53,8 +53,7 @@ ...@@ -53,8 +53,7 @@
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
app:layout_constraintTop_toBottomOf="@id/text_author_name" app:layout_constraintTop_toBottomOf="@id/text_author_name"
app:layout_constraintStart_toStartOf="@id/text_author_name" app:layout_constraintStart_toStartOf="@id/text_author_name"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent" />
tools:visibility="visible" />
<include <include
layout="@layout/layout_reactions" layout="@layout/layout_reactions"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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:id="@+id/file_attachment_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingBottom="@dimen/message_item_top_and_bottom_padding"
android:paddingEnd="@dimen/screen_edge_left_and_right_padding"
android:paddingStart="@dimen/screen_edge_left_and_right_padding">
<TextView
android:id="@+id/text_file_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="56dp"
android:textColor="@color/colorAccent"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:drawableStart="@drawable/ic_files_24dp"
android:drawablePadding="6dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="This is a very, very, very long filename, to test how the layout will work on very very very long filenames.pdf" />
<include
layout="@layout/layout_reactions"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/text_file_name"
app:layout_constraintTop_toBottomOf="@id/text_file_name" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:background="@color/default_background">
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/composer" android:id="@+id/composer"
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<string name="title_sign_in_your_server">Inicia sesión en tu servidor</string> <string name="title_sign_in_your_server">Inicia sesión en tu servidor</string>
<string name="title_log_in">Iniciar sesión</string> <string name="title_log_in">Iniciar sesión</string>
<string name="title_register_username">Registrar nombre de usuario</string> <string name="title_register_username">Registrar nombre de usuario</string>
// TODO: Add proper translation.
<string name="title_reset_password">Reset Password</string>
<string name="title_sign_up">Regístrate</string> <string name="title_sign_up">Regístrate</string>
<string name="title_authentication">Autenticación</string> <string name="title_authentication">Autenticación</string>
<string name="title_legal_terms">Términos legales</string> <string name="title_legal_terms">Términos legales</string>
...@@ -51,6 +53,14 @@ ...@@ -51,6 +53,14 @@
<string name="msg_avatar_url">URL del avatar</string> <string name="msg_avatar_url">URL del avatar</string>
<string name="msg_or_continue_using_social_accounts">O continuar usando cuentas sociales</string> <string name="msg_or_continue_using_social_accounts">O continuar usando cuentas sociales</string>
<string name="msg_new_user">Nuevo usuario? %1$s</string> <string name="msg_new_user">Nuevo usuario? %1$s</string>
// TODO: Add proper translation.
<string name="msg_forgot_password">Forgot password? %1$s</string>
// TODO: Add proper translation.
<string name="msg_reset">Reset</string>
// TODO: Add proper translation.
<string name="msg_check_your_email_to_reset_your_password">Email sent! Check your inbox to reset your password.</string>
// TODO: Add proper translation.
<string name="msg_invalid_email">Please type a valid e-mail</string>
<string name="msg_new_user_agreement">Al continuar estás aceptando nuestra\n%1$s y %2$s</string> <string name="msg_new_user_agreement">Al continuar estás aceptando nuestra\n%1$s y %2$s</string>
<string name="msg_2fa_code">Código 2FA</string> <string name="msg_2fa_code">Código 2FA</string>
<string name="msg_yesterday">Ayer</string> <string name="msg_yesterday">Ayer</string>
...@@ -78,10 +88,13 @@ ...@@ -78,10 +88,13 @@
<string name="msg_preview_video">Vídeo</string> <string name="msg_preview_video">Vídeo</string>
<string name="msg_preview_audio">Audio</string> <string name="msg_preview_audio">Audio</string>
<string name="msg_preview_photo">Foto</string> <string name="msg_preview_photo">Foto</string>
<string name="msg_preview_file">Fichero</string>
<string name="msg_no_messages_yet">Aún no hay mensajes</string> <string name="msg_no_messages_yet">Aún no hay mensajes</string>
<string name="msg_version">Versión %1$s</string> <string name="msg_version">Versión %1$s</string>
<string name="msg_build">Build %1$d</string> <string name="msg_build">Build %1$d</string>
<string name="msg_ok">OK</string> <string name="msg_ok">OK</string>
// TODO: Add proper translation.
<string name="msg_update_app_version_in_order_to_continue">Out to date server version. Please contact the server admin to update the server version in order to continue.</string>
<string name="msg_ver_not_recommended"> <string name="msg_ver_not_recommended">
Parece que la versión de tu servidor está por debajo de la versión recomendada %1$s.\nAún puede iniciar sesión, pero puede experimentar comportamientos inesperados.</string> Parece que la versión de tu servidor está por debajo de la versión recomendada %1$s.\nAún puede iniciar sesión, pero puede experimentar comportamientos inesperados.</string>
<string name="msg_ver_not_minimum"> <string name="msg_ver_not_minimum">
...@@ -96,6 +109,8 @@ ...@@ -96,6 +109,8 @@
<string name="msg_invalid_server_protocol">El protocolo seleccionado no es aceptado por este servidor, intente usar HTTPS</string> <string name="msg_invalid_server_protocol">El protocolo seleccionado no es aceptado por este servidor, intente usar HTTPS</string>
<string name="msg_image_saved_successfully">La imagen se ha guardado en la galería</string> <string name="msg_image_saved_successfully">La imagen se ha guardado en la galería</string>
<string name="msg_image_saved_failed">Error al guardar la imagen</string> <string name="msg_image_saved_failed">Error al guardar la imagen</string>
<string name="msg_no_chat_title">Sin mensajes de chat</string>
<string name="msg_no_chat_description">Comience a conversar para ver\nsus mensajes aquí.</string>
<!-- System messages --> <!-- System messages -->
<string name="message_room_name_changed">Nombre de la sala cambiado para: %1$s por %2$s</string> <string name="message_room_name_changed">Nombre de la sala cambiado para: %1$s por %2$s</string>
......
<resources> <resources>
<!-- Titles --> <!-- Titles -->
<string name="title_sign_in_your_server">Sign in your server</string> <string name="title_sign_in_your_server">Connectez-vous sur votre serveur</string>
<string name="title_log_in">Log in</string> <string name="title_log_in">S\'identifier</string>
<string name="title_register_username">Register username</string> <string name="title_register_username">Enregistrer le nom d\'utilisateur</string>
<string name="title_sign_up">Sign up</string> // TODO: Add proper translation.
<string name="title_authentication">Authentication</string> <string name="title_reset_password">Reset password</string>
<string name="title_legal_terms">Legal Terms</string> <string name="title_sign_up">S\'inscrire</string>
<string name="title_authentication">Authentification</string>
<string name="title_legal_terms">Termes légaux</string>
<string name="title_chats">Chats</string> <string name="title_chats">Chats</string>
<string name="title_profile">Profile</string> <string name="title_profile">Profil</string>
<string name="title_members">Members (%d)</string> <string name="title_members">Membres (%d)</string>
<string name="title_settings">Settings</string> <string name="title_settings">Paramètres</string>
<string name="title_password">Change Password</string> <string name="title_password">Changer le mot de passe</string>
<string name="title_update_profile">Update profile</string> <string name="title_update_profile">Update profile</string>
<string name="title_about">About</string> <string name="title_about">Sur</string>
<!-- Actions --> <!-- Actions -->
<string name="action_connect">Connect</string> <string name="action_connect">Se connecter</string>
<string name="action_use_this_username">Use this username</string> <string name="action_use_this_username">Utilisez ce nom d\'utilisateur</string>
<string name="action_login_or_sign_up">Tap this button to log in or create an account</string> <string name="action_login_or_sign_up">Touchez ce bouton pour vous connecter ou créer un compte</string>
<string name="action_terms_of_service">Terms of Service</string> <string name="action_terms_of_service">Conditions d\'utilisation</string>
<string name="action_privacy_policy">Privacy Policy</string> <string name="action_privacy_policy">Politique de confidentialité</string>
<string name="action_search">Search</string> <string name="action_search">Chercher</string>
<string name="action_update">Update</string> <string name="action_update">Mettre à jour</string>
<string name="action_settings">Settings</string> <string name="action_settings">Paramètres</string>
<string name="action_logout">Logout</string> <string name="action_logout">Se déconnecter</string>
<string name="action_files">Files</string> <string name="action_files">Fichiers</string>
<string name="action_confirm_password">Confirm Password Change</string> <string name="action_confirm_password">Confirmer le mot de passe</string>
<string name="action_join_chat">Join Chat</string> <string name="action_join_chat">Rejoignez le chat</string>
<string name="action_add_account">Add account</string> <string name="action_add_account">Ajouter un compte</string>
<string name="action_online">Online</string> <string name="action_online">En ligne</string>
<string name="action_away">Away</string> <string name="action_away">Loin</string>
<string name="action_busy">Busy</string> <string name="action_busy">Occupé</string>
<string name="action_invisible">Invisible</string> <string name="action_invisible">Invisible</string>
<!-- Settings List --> <!-- Settings List -->
<string-array name="settings_actions"> <string-array name="settings_actions">
<item name="item_password">Change Password</item> <item name="item_password">Changer le mot de passe</item>
<item name="item_password">About</item> <item name="item_password">Sur</item>
</string-array> </string-array>
<!-- Regular information messages --> <!-- Regular information messages -->
<string name="msg_generic_error">Sorry, an error has occurred, please try again</string> <string name="msg_generic_error">Désolé, une erreur s\'est produite. Veuillez réessayer</string>
<string name="msg_no_data_to_display">No data to display</string> <string name="msg_no_data_to_display">Aucune donnée à afficher</string>
<string name="msg_profile_update_successfully">Profile update successfully</string> <string name="msg_profile_update_successfully">Mise à jour du profil avec succès</string>
<string name="msg_username">username</string> <string name="msg_username">nom d\'utilisateur</string>
<string name="msg_username_or_email">username or email</string> <string name="msg_username_or_email">nom d\'utilisateur ou email</string>
<string name="msg_password">password</string> <string name="msg_password">mot de passe</string>
<string name="msg_name">name</string> <string name="msg_name">prénom</string>
<string name="msg_email">email</string> <string name="msg_email">email</string>
<string name="msg_avatar_url">avatar URL</string> <string name="msg_avatar_url">URL de l\'avatar</string>
<string name="msg_or_continue_using_social_accounts">Or continue using social accounts</string> <string name="msg_or_continue_using_social_accounts">Ou continuer en utilisant les comptes sociaux</string>
<string name="msg_new_user">New user? %1$s</string> <string name="msg_new_user">Nouvel utilisateur? %1$s</string>
<string name="msg_new_user_agreement">By proceeding you are agreeing to our\n%1$s and %2$s</string> // TODO: Add proper translation.
<string name="msg_2fa_code">2FA Code</string> <string name="msg_forgot_password">Forgot password? %1$s</string>
<string name="msg_yesterday">Yesterday</string> // TODO: Add proper translation.
<string name="msg_reset">Reset</string>
// TODO: Add proper translation.
<string name="msg_check_your_email_to_reset_your_password">Email sent! Check your inbox to reset your password.</string>
// TODO: Add proper translation.
<string name="msg_invalid_email">Please type a valid e-mail</string>
<string name="msg_new_user_agreement">En procédant, vous acceptez notre\n%1$s et %2$s</string>
<string name="msg_2fa_code">Code 2FA</string>
<string name="msg_yesterday">Hier</string>
<string name="msg_message">Message</string> <string name="msg_message">Message</string>
<string name="msg_this_room_is_read_only">This room is read only</string> <string name="msg_this_room_is_read_only">Cette salle est seulement de lecture</string>
<string name="msg_invalid_2fa_code">Invalid 2FA Code</string> <string name="msg_invalid_2fa_code">Code 2FA non valide</string>
<string name="msg_invalid_file">Invalid file</string> <string name="msg_invalid_file">Fichier non valide</string>
<string name="msg_invalid_server_url">Invalid server URL</string> <string name="msg_invalid_server_url">URL de serveur non valide</string>
<string name="msg_content_description_log_in_using_facebook">Login using Facebook</string> <string name="msg_content_description_log_in_using_facebook">Connectez-vous en utilisant Facebook</string>
<string name="msg_content_description_log_in_using_github">Login using Github</string> <string name="msg_content_description_log_in_using_github">Connectez-vous en utilisant Github</string>
<string name="msg_content_description_log_in_using_google">Login using Google</string> <string name="msg_content_description_log_in_using_google">Connectez-vous en utilisant Google</string>
<string name="msg_content_description_log_in_using_linkedin">Login using Linkedin</string> <string name="msg_content_description_log_in_using_linkedin">Connectez-vous en utilisant Linkedin</string>
<string name="msg_content_description_log_in_using_meteor">Login using Meteor</string> <string name="msg_content_description_log_in_using_meteor">Connectez-vous en utilisant Meteor</string>
<string name="msg_content_description_log_in_using_twitter">Login using Twitter</string> <string name="msg_content_description_log_in_using_twitter">Connectez-vous en utilisant Twitter</string>
<string name="msg_content_description_log_in_using_gitlab">Login using Gitlab</string> <string name="msg_content_description_log_in_using_gitlab">Connectez-vous en utilisant Gitlab</string>
<string name="msg_content_description_send_message">Send message</string> <string name="msg_content_description_send_message">Envoyer message</string>
<string name="msg_content_description_show_attachment_options">Show attachment options</string> <string name="msg_content_description_show_attachment_options">Afficher les options de fichiers</string>
<string name="msg_you">You</string> <string name="msg_you">Toi</string>
<string name="msg_unknown">Unknown</string> <string name="msg_unknown">Inconnu</string>
<string name="msg_email_address">E-mail address</string> <string name="msg_email_address">Adresse e-mail</string>
<string name="msg_utc_offset">UTC offset</string> <string name="msg_utc_offset">Décalage UTC</string>
<string name="msg_new_password">Enter New Password</string> <string name="msg_new_password">Entrez un nouveau mot de passe</string>
<string name="msg_confirm_password">Confirm New Password</string> <string name="msg_confirm_password">Confirmer le nouveau mot de passe</string>
<string name="msg_unread_messages">Unread messages</string> <string name="msg_unread_messages">Messages non lus</string>
<string name="msg_preview_video">Video</string> <string name="msg_preview_video">Vidéo</string>
<string name="msg_preview_audio">Audio</string> <string name="msg_preview_audio">Audio</string>
<string name="msg_preview_photo">Photo</string> <string name="msg_preview_photo">Photo</string>
<string name="msg_no_messages_yet">No messages yet</string> <string name="msg_preview_file">File</string>
<string name="msg_no_messages_yet">Aucun message pour le moment</string>
<string name="msg_version">Version %1$s</string> <string name="msg_version">Version %1$s</string>
<string name="msg_build">Build %1$d</string> <string name="msg_build">Build %1$d</string>
<string name="msg_ok">OK</string> <string name="msg_ok">OK</string>
// TODO: Add proper translation.
<string name="msg_update_app_version_in_order_to_continue">Out to date server version. Please contact the server admin to update the server version in order to continue.</string>
<string name="msg_ver_not_recommended"> <string name="msg_ver_not_recommended">
Looks like your server version is below the recommended version %1$s.\nYou can still login but you may experience unexpected behaviors.</string> On dirait que la version de votre serveur est en dessous de la version recommandée %1$s.\nVous pouvez toujours vous connecter mais vous pouvez rencontrer des comportements inattendus.</string>
<string name="msg_ver_not_minimum"> <string name="msg_ver_not_minimum">
Looks like your server version is below the minimum required version %1$s.\nPlease upgrade your server to login! On dirait que la version de votre serveur est inférieure à la version minimale requise %1$s.\nVeuillez mettre à jour votre serveur pour vous connecter!
</string> </string>
<string name="msg_proceed">PROCEED</string> <string name="msg_proceed">PROCÉDER</string>
<string name="msg_cancel">CANCEL</string> <string name="msg_cancel">ANNULER</string>
<string name="msg_warning">WARNING</string> <string name="msg_warning">ATTENTION</string>
<string name="msg_http_insecure">When using HTTP, you\'re connecting to an insecure server. We don\'t recommend you doing that.</string> <string name="msg_http_insecure">Lorsque vous utilisez HTTP, vous vous connectez à un serveur non sécurisé. Nous ne vous recommandons pas de le faire.</string>
<string name="msg_error_checking_server_version">An error has occurred while checking your server version, please try again</string> <string name="msg_error_checking_server_version">Une erreur est survenue lors de la vérification de la version de votre serveur, veuillez réessayer</string>
<string name="msg_invalid_server_protocol">The selected protocol is not accepted by this server, try using HTTPS</string> <string name="msg_invalid_server_protocol">Le protocole sélectionné n\'est pas accepté par ce serveur, essayez d\'utiliser HTTPS</string>
<string name="msg_image_saved_successfully">L\'image a été enregistrée dans la galerie</string> <string name="msg_image_saved_successfully">L\'image a été enregistrée dans la galerie</string>
<string name="msg_image_saved_failed">Échec de l\'enregistrement de l\'image</string> <string name="msg_image_saved_failed">Échec de l\'enregistrement de l\'image</string>
<string name="msg_no_chat_title">Aucun message de discussion</string>
<string name="msg_no_chat_description">Commencez à converser pour voir\nvos messages ici.</string>
<!-- System messages --> <!-- System messages -->
<string name="message_room_name_changed">Room name changed to: %1$s by %2$s</string> <string name="message_room_name_changed">Le nom de le salle a changé à: %1$s par %2$s</string>
<string name="message_user_added_by">User %1$s added by %2$s</string> <string name="message_user_added_by">Utilisateur %1$s ajouté par %2$s</string>
<string name="message_user_removed_by">User %1$s removed by %2$s</string> <string name="message_user_removed_by">Utilisateur %1$s enlevé par %2$s</string>
<string name="message_user_left">Has left the channel.</string> <string name="message_user_left">A quitté de la salle.</string>
<string name="message_user_joined_channel">Has joined the channel.</string> <string name="message_user_joined_channel">A rejoint la salle.</string>
<string name="message_welcome">Welcome %s</string> <string name="message_welcome">Bienvenue %s</string>
<string name="message_removed">Message removed</string> <string name="message_removed">Message supprimé</string>
<string name="message_pinned">Pinned a message:</string> <string name="message_pinned">Épinglé un message:</string>
<!-- Message actions --> <!-- Message actions -->
<string name="action_msg_reply">Reply</string> <string name="action_msg_reply">Répondre</string>
<string name="action_msg_edit">Edit</string> <string name="action_msg_edit">Modifier</string>
<string name="action_msg_copy">Copy</string> <string name="action_msg_copy">Copier</string>
<string name="action_msg_quote">Quote</string> <string name="action_msg_quote">Citation</string>
<string name="action_msg_delete">Delete</string> <string name="action_msg_delete">Effacer</string>
<string name="action_msg_pin">Pin Message</string> <string name="action_msg_pin">Épingle message</string>
<string name="action_msg_unpin">Unpin Message</string> <string name="action_msg_unpin">Enlever message</string>
<string name="action_msg_star">Star Message</string> <string name="action_msg_star">Star message</string>
<string name="action_msg_share">Share</string> <string name="action_msg_share">Partager</string>
<string name="action_title_editing">Editing Message</string> <string name="action_title_editing">Modification du message</string>
<string name="action_msg_add_reaction">Add reaction</string> <string name="action_msg_add_reaction">Ajouter une réaction</string>
<!-- Permission messages --> <!-- Permission messages -->
<string name="permission_editing_not_allowed">Editing is not allowed</string> <string name="permission_editing_not_allowed">L\'édition n\'est pas autorisée</string>
<string name="permission_deleting_not_allowed">Deleting is not allowed</string> <string name="permission_deleting_not_allowed">La suppression n\'est pas autorisée</string>
<string name="permission_pinning_not_allowed">Pinning is not allowed</string> <string name="permission_pinning_not_allowed">L\'épinglage n\'est pas autorisé</string>
<!-- Members List --> <!-- Members List -->
<string name="title_members_list">Members List</string> <string name="title_members_list">Liste des membres</string>
<!-- Pinned Messages --> <!-- Pinned Messages -->
<string name="title_pinned_messages">Pinned Messages</string> <string name="title_pinned_messages">Messages épinglés</string>
<string name="no_pinned_messages">No pinned messages</string> <string name="no_pinned_messages">Aucun message épinglé</string>
<string name="no_pinned_description">All the pinned messages\nappear here.</string> <string name="no_pinned_description">Tous les messages épinglés\napparaissent ici.</string>
<!-- Upload Messages --> <!-- Upload Messages -->
<string name="max_file_size_exceeded">File size %1$d bytes exceeded max upload size of %2$d bytes</string> <string name="max_file_size_exceeded">Taille du fichier (%1$d bytes) dépassé la taille de téléchargement maximale de %2$d bytes</string>
<!-- Socket status --> <!-- Socket status -->
<string name="status_connected">Connected</string> <string name="status_connected">Connecté</string>
<string name="status_disconnected">Disconnected</string> <string name="status_disconnected">Détaché</string>
<string name="status_connecting">Connecting</string> <string name="status_connecting">Connexion</string>
<string name="status_authenticating">Authenticating</string> <string name="status_authenticating">Authentification</string>
<string name="status_disconnecting">Disconnecting</string> <string name="status_disconnecting">Déconnexion</string>
<string name="status_waiting">Connecting in %d seconds</string> <string name="status_waiting">Connexion en %d secondes</string>
<!--Suggestions--> <!--Suggestions-->
<string name="suggest_all_description">Notify all in this room</string> <string name="suggest_all_description">Notifier tout dans cette salle</string>
<string name="suggest_here_description">Notify active users in this room</string> <string name="suggest_here_description">Notifier les utilisateurs actifs dans cette salle</string>
<!-- Slash Commands --> <!-- Slash Commands -->
<string name="Slash_Gimme_Description">Displays ༼ つ ◕_◕ ༽つ before your message</string> <string name="Slash_Gimme_Description">Affiche ༼ つ ◕_◕ ༽つ avant votre message</string>
<string name="Slash_LennyFace_Description">Displays ( ͡° ͜ʖ ͡°) after your message</string> <string name="Slash_LennyFace_Description">Affiche ( ͡° ͜ʖ ͡°) après votre message</string>
<string name="Slash_Shrug_Description">Displays ¯\_(ツ)_/¯ after your message</string> <string name="Slash_Shrug_Description">Affiche ¯\_(ツ)_/¯ après votre message</string>
<string name="Slash_Tableflip_Description">Displays (╯°□°)╯︵ ┻━┻</string> <string name="Slash_Tableflip_Description">Affiche (╯°□°)╯︵ ┻━┻</string>
<string name="Slash_TableUnflip_Description">Displays ┬─┬ ノ( ゜-゜ノ)</string> <string name="Slash_TableUnflip_Description">Affiche ┬─┬ ノ( ゜-゜ノ)</string>
<string name="Create_A_New_Channel">Create a new channel</string> <string name="Create_A_New_Channel">Créer une nouvelle salle</string>
<string name="Show_the_keyboard_shortcut_list">Show the keyboard shortcut list</string> <string name="Show_the_keyboard_shortcut_list">Afficher la liste des raccourcis clavier</string>
<string name="Invite_user_to_join_channel_all_from">Invite all users from [#channel] to join this channel</string> <string name="Invite_user_to_join_channel_all_from">Inviter tous les utilisateurs de [#salle] à rejoindre cette salle</string>
<string name="Invite_user_to_join_channel_all_to">Invite all users from this channel to join [#channel]</string> <string name="Invite_user_to_join_channel_all_to">Inviter tous les utilisateurs de cette salle à rejoindre [#salle]</string>
<string name="Archive">Archive</string> <string name="Archive">Archiver</string>
<string name="Remove_someone_from_room">Remove someone from the room</string> <string name="Remove_someone_from_room">Retirer quelqu\'un de la salle</string>
<string name="Leave_the_current_channel">Leave the current channel</string> <string name="Leave_the_current_channel">Sortir de la salle actuelle</string>
<string name="Displays_action_text">Displays action text</string> <string name="Displays_action_text">Affiche le texte d\'action</string>
<string name="Direct_message_someone">Direct message someone</string> <string name="Direct_message_someone">Message direct avec quelqu\'un</string>
<string name="Mute_someone_in_room">Mute someone in the room</string> <string name="Mute_someone_in_room">Mettre en sourdine une personne dans la salle</string>
<string name="Unmute_someone_in_room">Unmute someone in the room</string> <string name="Unmute_someone_in_room">Retirer la sourdine d\'une personne dans la salle</string>
<string name="Invite_user_to_join_channel">Invite one user to join this channel</string> <string name="Invite_user_to_join_channel">Inviter un utilisateur à rejoindre cette salle</string>
<string name="Unarchive">Unarchive</string> <string name="Unarchive">Désarchiver</string>
<string name="Join_the_given_channel">Join the given channel</string> <string name="Join_the_given_channel">Rejoignez la salle fourni</string>
<string name="Guggy_Command_Description">Generates a gif based upon the provided text</string> <string name="Guggy_Command_Description">Génère un gif basé sur le texte fourni</string>
<string name="Slash_Topic_Description">Set topic</string> <string name="Slash_Topic_Description">Définir le sujet</string>
<!-- Emoji message--> <!-- Emoji message-->
<string name="msg_no_recent_emoji">No recent emoji</string> <string name="msg_no_recent_emoji">Aucun emoji récent</string>
<!-- Sorting and grouping--> <!-- Sorting and grouping-->
<string name="menu_chatroom_sort">Sort</string> <string name="menu_chatroom_sort">Trier</string>
<string name="dialog_sort_title">Sort by</string> <string name="dialog_sort_title">Trier par</string>
<string name="dialog_sort_by_alphabet">Alphabetical</string> <string name="dialog_sort_by_alphabet">Alphabétique</string>
<string name="dialog_sort_by_activity">Activity</string> <string name="dialog_sort_by_activity">Activité</string>
<string name="dialog_group_by_type">Group by type</string> <string name="dialog_group_by_type">Grouper par type</string>
<string name="dialog_group_favourites">Group favourites</string> <string name="dialog_group_favourites">Grouper favoris</string>
<string name="chatroom_header">Header</string> <string name="chatroom_header">Entête</string>
<!--ChatRooms Headers--> <!--ChatRooms Headers-->
<string name="header_channel">Channels</string> <string name="header_channel">Salles</string>
<string name="header_private_groups">Private Groups</string> <string name="header_private_groups">Groupes privés</string>
<string name="header_direct_messages">Direct Messages</string> <string name="header_direct_messages">Messages directs</string>
<string name="header_live_chats">Live Chats</string> <string name="header_live_chats">Chats en direct</string>
<string name="header_unknown">Unknown</string> <string name="header_unknown">Inconnu</string>
<!--Notifications--> <!--Notifications-->
<string name="notif_action_reply_hint">REPLY</string> <string name="notif_action_reply_hint">RÉPONDRE</string>
<string name="notif_error_sending">Reply has failed. Please try again.</string> <string name="notif_error_sending">La réponse a échoué. Veuillez réessayer.</string>
<string name="notif_success_sending">Message sent to %1$s!</string> <string name="notif_success_sending">Message envoyé à %1$s!</string>
</resources> </resources>
\ No newline at end of file
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<string name="title_sign_in_your_server">अपने सर्वर में साइन इन करें</string> <string name="title_sign_in_your_server">अपने सर्वर में साइन इन करें</string>
<string name="title_log_in">लॉग इन करें</string> <string name="title_log_in">लॉग इन करें</string>
<string name="title_register_username">रजिस्टर उपयोगकर्ता नाम</string> <string name="title_register_username">रजिस्टर उपयोगकर्ता नाम</string>
// TODO: Add proper translation.
<string name="title_reset_password">Reset password</string>
<string name="title_sign_up">साइन अप करें</string> <string name="title_sign_up">साइन अप करें</string>
<string name="title_authentication">प्रमाणीकरण</string> <string name="title_authentication">प्रमाणीकरण</string>
<string name="title_legal_terms">कानूनी शर्तें</string> <string name="title_legal_terms">कानूनी शर्तें</string>
...@@ -52,6 +54,14 @@ ...@@ -52,6 +54,14 @@
<string name="msg_avatar_url">अवतार यूआरएल</string> <string name="msg_avatar_url">अवतार यूआरएल</string>
<string name="msg_or_continue_using_social_accounts">या सामाजिक खाते का उपयोग करना जारी रखें</string> <string name="msg_or_continue_using_social_accounts">या सामाजिक खाते का उपयोग करना जारी रखें</string>
<string name="msg_new_user">नया उपयोगकर्ता? %1$s</string> <string name="msg_new_user">नया उपयोगकर्ता? %1$s</string>
// TODO: Add proper translation.
<string name="msg_forgot_password">Forgot password? %1$s</string>
// TODO: Add proper translation.
<string name="msg_reset">Reset</string>
// TODO: Add proper translation.
<string name="msg_check_your_email_to_reset_your_password">Email sent! Check your inbox to reset your password.</string>
// TODO: Add proper translation.
<string name="msg_invalid_email">Please type a valid e-mail</string>
<string name="msg_new_user_agreement">आगे बढ़कर आप हमारे %1$s और %2$s से सहमत हो रहे हैं</string> <string name="msg_new_user_agreement">आगे बढ़कर आप हमारे %1$s और %2$s से सहमत हो रहे हैं</string>
<string name="msg_2fa_code">कोड 2FA</string> <string name="msg_2fa_code">कोड 2FA</string>
<string name="msg_yesterday">कल</string> <string name="msg_yesterday">कल</string>
...@@ -78,10 +88,13 @@ ...@@ -78,10 +88,13 @@
<string name="msg_preview_video">वीडियो</string> <string name="msg_preview_video">वीडियो</string>
<string name="msg_preview_audio">ऑडियो</string> <string name="msg_preview_audio">ऑडियो</string>
<string name="msg_preview_photo">तस्वीरें</string> <string name="msg_preview_photo">तस्वीरें</string>
<string name="msg_preview_file">File</string>
<string name="msg_unread_messages">अपठित संदेश</string> <string name="msg_unread_messages">अपठित संदेश</string>
<string name="msg_no_messages_yet">अभी तक कोई पोस्ट नहीं</string> <string name="msg_no_messages_yet">अभी तक कोई पोस्ट नहीं</string>
<string name="msg_version">वर्शन %1$s</string> <string name="msg_version">वर्शन %1$s</string>
<string name="msg_build">बिल्ड %1$d</string> <string name="msg_build">बिल्ड %1$d</string>
// TODO: Add proper translation.
<string name="msg_update_app_version_in_order_to_continue">Out to date server version. Please contact the server admin to update the server version in order to continue.</string>
<string name="msg_ok">OK</string> <string name="msg_ok">OK</string>
<string name="msg_ver_not_recommended"> <string name="msg_ver_not_recommended">
ऐसा लगता है कि आपका सर्वर संस्करण अनुशंसित संस्करण %1$s के नीचे है।\nआप अभी भी लॉगिन कर सकते हैं लेकिन आप अप्रत्याशित व्यवहार का अनुभव कर सकते हैं ऐसा लगता है कि आपका सर्वर संस्करण अनुशंसित संस्करण %1$s के नीचे है।\nआप अभी भी लॉगिन कर सकते हैं लेकिन आप अप्रत्याशित व्यवहार का अनुभव कर सकते हैं
...@@ -97,6 +110,8 @@ ...@@ -97,6 +110,8 @@
<string name="msg_invalid_server_protocol">चयनित प्रोटोकॉल इस सर्वर द्वारा स्वीकार नहीं किया गया है, HTTPS का उपयोग करने का प्रयास करें</string> <string name="msg_invalid_server_protocol">चयनित प्रोटोकॉल इस सर्वर द्वारा स्वीकार नहीं किया गया है, HTTPS का उपयोग करने का प्रयास करें</string>
<string name="msg_image_saved_successfully">छवि गैलरी में सहेजा गया है</string> <string name="msg_image_saved_successfully">छवि गैलरी में सहेजा गया है</string>
<string name="msg_image_saved_failed">छवि को सहेजने में विफल</string> <string name="msg_image_saved_failed">छवि को सहेजने में विफल</string>
<string name="msg_no_chat_title">कोई चैट संदेश नहीं</string>
<string name="msg_no_chat_description">यहां अपने संदेश देखने के लिए\nबातचीत शुरू करें।</string>
<!-- System messages --> <!-- System messages -->
<string name="message_room_name_changed">%2$s ने रूम का नाम बदलकर %1$s किया</string> <string name="message_room_name_changed">%2$s ने रूम का नाम बदलकर %1$s किया</string>
...@@ -195,4 +210,4 @@ ...@@ -195,4 +210,4 @@
<string name="notif_action_reply_hint">जवाब</string> <string name="notif_action_reply_hint">जवाब</string>
<string name="notif_error_sending">उत्तर विफल हुआ है। कृपया फिर से प्रयास करें।</string> <string name="notif_error_sending">उत्तर विफल हुआ है। कृपया फिर से प्रयास करें।</string>
<string name="notif_success_sending">संदेश भेजा गया %1$s!</string> <string name="notif_success_sending">संदेश भेजा गया %1$s!</string>
</resources> </resources>
\ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<string name="title_sign_in_your_server">Faça login no seu servidor</string> <string name="title_sign_in_your_server">Faça login no seu servidor</string>
<string name="title_log_in">Entrar</string> <string name="title_log_in">Entrar</string>
<string name="title_register_username">Registre o nome de usuário</string> <string name="title_register_username">Registre o nome de usuário</string>
<string name="title_reset_password">Redefinir senha</string>
<string name="title_sign_up">Inscreva-se</string> <string name="title_sign_up">Inscreva-se</string>
<string name="title_authentication">Autenticação</string> <string name="title_authentication">Autenticação</string>
<string name="title_legal_terms">Termos Legais</string> <string name="title_legal_terms">Termos Legais</string>
...@@ -52,6 +53,10 @@ ...@@ -52,6 +53,10 @@
<string name="msg_avatar_url">URL do avatar</string> <string name="msg_avatar_url">URL do avatar</string>
<string name="msg_or_continue_using_social_accounts">Ou continue através de contas sociais</string> <string name="msg_or_continue_using_social_accounts">Ou continue através de contas sociais</string>
<string name="msg_new_user">Novo usuário? %1$s</string> <string name="msg_new_user">Novo usuário? %1$s</string>
<string name="msg_forgot_password">Esqueceu a senha? %1$s</string>
<string name="msg_reset">Redefinir</string>
<string name="msg_check_your_email_to_reset_your_password">Email enviado! Verifique sua caixa de entrada para redefinir sua senha.</string>
<string name="msg_invalid_email">Por favor informe um e-mail válido</string>
<string name="msg_new_user_agreement">Ao proceder você concorda com nossos %1$s e %2$s</string> <string name="msg_new_user_agreement">Ao proceder você concorda com nossos %1$s e %2$s</string>
<string name="msg_2fa_code">Código 2FA</string> <string name="msg_2fa_code">Código 2FA</string>
<string name="msg_yesterday">ontem</string> <string name="msg_yesterday">ontem</string>
...@@ -79,16 +84,20 @@ ...@@ -79,16 +84,20 @@
<string name="msg_preview_video">Vídeo</string> <string name="msg_preview_video">Vídeo</string>
<string name="msg_preview_audio">Audio</string> <string name="msg_preview_audio">Audio</string>
<string name="msg_preview_photo">Foto</string> <string name="msg_preview_photo">Foto</string>
<string name="msg_preview_file">Arquivo</string>
<string name="msg_no_messages_yet">Nenhuma mensagem ainda</string> <string name="msg_no_messages_yet">Nenhuma mensagem ainda</string>
<string name="msg_version">Versão %1$s</string> <string name="msg_version">Versão %1$s</string>
<string name="msg_build">Build %1$d</string> <string name="msg_build">Build %1$d</string>
<string name="msg_ok">OK</string> <string name="msg_ok">OK</string>
<string name="msg_update_app_version_in_order_to_continue">Versão do servidor desatualizada. Por favor, entre em contato com o administrador do sistema para continuar.</string>
<string name="msg_ver_not_recommended"> <string name="msg_ver_not_recommended">
Parece que a versão do seu servidor está abaixo da recomendada %1$s.\nVocê ainda assim pode logar e continuar mas podem ocorrer alguns problemas inesperados. Parece que a versão do seu servidor está abaixo da recomendada %1$s.\nVocê ainda assim pode logar e continuar mas podem ocorrer alguns problemas inesperados.
</string> </string>
<string name="msg_ver_not_minimum"> <string name="msg_ver_not_minimum">
Parece que a versão do seu servidor está abaixo da mínima requerida %1$s.\nPor favor, atualize seus servidores antes de continuar! Parece que a versão do seu servidor está abaixo da mínima requerida %1$s.\nPor favor, atualize seus servidores antes de continuar!
</string> </string>
<string name="msg_no_chat_title">Nenhuma mensagem de chat</string>
<string name="msg_no_chat_description">Comece a conversar para ver suas\nmensagens aqui.</string>
<string name="msg_proceed">CONTINUAR</string> <string name="msg_proceed">CONTINUAR</string>
<string name="msg_cancel">CANCELAR</string> <string name="msg_cancel">CANCELAR</string>
<string name="msg_warning">AVISO</string> <string name="msg_warning">AVISO</string>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<!-- Text colors --> <!-- Text colors -->
<color name="colorPrimaryText">#DE000000</color> <color name="colorPrimaryText">#DE000000</color>
<color name="colorSecondaryText">#787878</color> <color name="colorSecondaryText">#787878</color>
<color name="colorSecondaryTextLight">#c1c1c1</color>
<!-- User status colors --> <!-- User status colors -->
<color name="colorUserStatusOnline">#2FE1A8</color> <color name="colorUserStatusOnline">#2FE1A8</color>
...@@ -44,4 +45,8 @@ ...@@ -44,4 +45,8 @@
<!-- Suggestions --> <!-- Suggestions -->
<color name="suggestion_background_color">@android:color/white</color> <color name="suggestion_background_color">@android:color/white</color>
<color name="icon_grey">#AFADAF</color>
<!-- Default Background Color -->
<color name="default_background">#FAFAFA</color>
</resources> </resources>
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<string name="title_sign_in_your_server">Sign in your server</string> <string name="title_sign_in_your_server">Sign in your server</string>
<string name="title_log_in">Log in</string> <string name="title_log_in">Log in</string>
<string name="title_register_username">Register username</string> <string name="title_register_username">Register username</string>
<string name="title_reset_password">Reset password</string>
<string name="title_sign_up">Sign up</string> <string name="title_sign_up">Sign up</string>
<string name="title_authentication">Authentication</string> <string name="title_authentication">Authentication</string>
<string name="title_legal_terms">Legal Terms</string> <string name="title_legal_terms">Legal Terms</string>
...@@ -53,6 +54,10 @@ ...@@ -53,6 +54,10 @@
<string name="msg_avatar_url">avatar URL</string> <string name="msg_avatar_url">avatar URL</string>
<string name="msg_or_continue_using_social_accounts">Or continue using social accounts</string> <string name="msg_or_continue_using_social_accounts">Or continue using social accounts</string>
<string name="msg_new_user">New user? %1$s</string> <string name="msg_new_user">New user? %1$s</string>
<string name="msg_forgot_password">Forgot password? %1$s</string>
<string name="msg_reset">Reset</string>
<string name="msg_check_your_email_to_reset_your_password">Email sent! Check your inbox to reset your password.</string>
<string name="msg_invalid_email">Please type a valid e-mail</string>
<string name="msg_new_user_agreement">By proceeding you are agreeing to our\n%1$s and %2$s</string> <string name="msg_new_user_agreement">By proceeding you are agreeing to our\n%1$s and %2$s</string>
<string name="msg_2fa_code">2FA Code</string> <string name="msg_2fa_code">2FA Code</string>
<string name="msg_more_than_ninety_nine_unread_messages" translatable="false">99+</string> <string name="msg_more_than_ninety_nine_unread_messages" translatable="false">99+</string>
...@@ -81,15 +86,19 @@ ...@@ -81,15 +86,19 @@
<string name="msg_preview_video">Video</string> <string name="msg_preview_video">Video</string>
<string name="msg_preview_audio">Audio</string> <string name="msg_preview_audio">Audio</string>
<string name="msg_preview_photo">Photo</string> <string name="msg_preview_photo">Photo</string>
<string name="msg_preview_file">File</string>
<string name="msg_no_messages_yet">No messages yet</string> <string name="msg_no_messages_yet">No messages yet</string>
<string name="msg_version">Version %1$s</string> <string name="msg_version">Version %1$s</string>
<string name="msg_build">Build %1$d</string> <string name="msg_build">Build %1$d</string>
<string name="msg_ok">OK</string> <string name="msg_ok">OK</string>
<string name="msg_update_app_version_in_order_to_continue">Out to date server version. Please contact the server admin to update the server version in order to continue.</string>
<string name="msg_ver_not_recommended"> <string name="msg_ver_not_recommended">
Looks like your server version is below the recommended version %1$s.\nYou can still login but you may experience unexpected behaviors.</string> Looks like your server version is below the recommended version %1$s.\nYou can still login but you may experience unexpected behaviors.</string>
<string name="msg_ver_not_minimum"> <string name="msg_ver_not_minimum">
Looks like your server version is below the minimum required version %1$s.\nPlease upgrade your server to login! Looks like your server version is below the minimum required version %1$s.\nPlease upgrade your server to login!
</string> </string>
<string name="msg_no_chat_title">No chat messages</string>
<string name="msg_no_chat_description">Start conversing to see your\nmessages here.</string>
<string name="msg_proceed">PROCEED</string> <string name="msg_proceed">PROCEED</string>
<string name="msg_cancel">CANCEL</string> <string name="msg_cancel">CANCEL</string>
<string name="msg_warning">WARNING</string> <string name="msg_warning">WARNING</string>
......
...@@ -10,7 +10,7 @@ buildscript { ...@@ -10,7 +10,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.1' classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}"
classpath 'com.google.gms:google-services:3.2.0' classpath 'com.google.gms:google-services:3.2.0'
......
...@@ -4,7 +4,7 @@ ext { ...@@ -4,7 +4,7 @@ ext {
compileSdk : 27, compileSdk : 27,
targetSdk : 27, targetSdk : 27,
buildTools : '27.0.3', buildTools : '27.0.3',
kotlin : '1.2.31', kotlin : '1.2.40',
coroutine : '0.22.5', coroutine : '0.22.5',
dokka : '0.9.16', dokka : '0.9.16',
...@@ -91,7 +91,6 @@ ext { ...@@ -91,7 +91,6 @@ ext {
frescoImageViewer : "com.github.luciofm:FrescoImageViewer:${versions.frescoImageViewer}", frescoImageViewer : "com.github.luciofm:FrescoImageViewer:${versions.frescoImageViewer}",
markwon : "ru.noties:markwon:${versions.markwon}", markwon : "ru.noties:markwon:${versions.markwon}",
markwonImageLoader : "ru.noties:markwon-image-loader:${versions.markwon}",
sheetMenu : "com.github.whalemare:sheetmenu:${versions.sheetMenu}", sheetMenu : "com.github.whalemare:sheetmenu:${versions.sheetMenu}",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment