Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
8c0916b1
Commit
8c0916b1
authored
Nov 25, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add localization strings and do not create a new conversation if already opend
parent
a7409d78
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
103 additions
and
34 deletions
+103
-34
MessageViewHolder.kt
...chat/rocket/android/chatroom/adapter/MessageViewHolder.kt
+5
-4
MessageUiModel.kt
...va/chat/rocket/android/chatroom/uimodel/MessageUiModel.kt
+2
-1
UiModelMapper.kt
...ava/chat/rocket/android/chatroom/uimodel/UiModelMapper.kt
+2
-1
UserDetailsPresenter.kt
.../android/userdetails/presentation/UserDetailsPresenter.kt
+7
-3
UserDetailsActivity.kt
...chat/rocket/android/userdetails/ui/UserDetailsActivity.kt
+21
-12
activity_user_details.xml
app/src/main/res/layout/activity_user_details.xml
+3
-4
strings.xml
app/src/main/res/values-de/strings.xml
+6
-3
strings.xml
app/src/main/res/values-es/strings.xml
+5
-2
strings.xml
app/src/main/res/values-fr/strings.xml
+6
-0
strings.xml
app/src/main/res/values-hi-rIN/strings.xml
+6
-0
strings.xml
app/src/main/res/values-it/strings.xml
+5
-0
strings.xml
app/src/main/res/values-ja/strings.xml
+5
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+6
-0
strings.xml
app/src/main/res/values-ru-rRU/strings.xml
+6
-0
strings.xml
app/src/main/res/values-tr/strings.xml
+5
-2
strings.xml
app/src/main/res/values-uk/strings.xml
+6
-0
strings.xml
app/src/main/res/values/strings.xml
+7
-2
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/MessageViewHolder.kt
View file @
8c0916b1
...
...
@@ -74,19 +74,20 @@ class MessageViewHolder(
}
val
senderId
=
data
.
message
.
sender
?.
id
val
subscriptionId
=
data
.
subscriptionId
text_sender
.
setOnClickListener
{
toUserDetails
(
context
,
senderId
)
toUserDetails
(
context
,
senderId
,
subscriptionId
)
}
image_avatar
.
setOnClickListener
{
toUserDetails
(
context
,
senderId
)
toUserDetails
(
context
,
senderId
,
subscriptionId
)
}
}
}
private
fun
toUserDetails
(
context
:
Context
,
userId
:
String
?)
{
userId
?.
let
{
context
.
startActivity
(
context
.
userDetailsIntent
(
it
))
}
private
fun
toUserDetails
(
context
:
Context
,
userId
:
String
?
,
subscriptionId
:
String
)
{
userId
?.
let
{
context
.
startActivity
(
context
.
userDetailsIntent
(
it
,
subscriptionId
))
}
}
override
fun
unscheduleDrawable
(
who
:
Drawable
?,
what
:
Runnable
?)
{
...
...
app/src/main/java/chat/rocket/android/chatroom/uimodel/MessageUiModel.kt
View file @
8c0916b1
...
...
@@ -21,7 +21,8 @@ data class MessageUiModel(
var
isFirstUnread
:
Boolean
,
override
var
isTemporary
:
Boolean
=
false
,
override
var
menuItemsToHide
:
MutableList
<
Int
>
=
mutableListOf
(),
override
var
permalink
:
String
override
var
permalink
:
String
,
val
subscriptionId
:
String
)
:
BaseMessageUiModel
<
Message
>
{
override
val
viewType
:
Int
get
()
=
BaseUiModel
.
ViewType
.
MESSAGE
.
viewType
...
...
app/src/main/java/chat/rocket/android/chatroom/uimodel/UiModelMapper.kt
View file @
8c0916b1
...
...
@@ -456,7 +456,8 @@ class UiModelMapper @Inject constructor(
messageId
=
message
.
id
,
avatar
=
avatar
!!
,
time
=
time
,
senderName
=
sender
,
content
=
content
,
isPinned
=
message
.
pinned
,
currentDayMarkerText
=
dayMarkerText
,
showDayMarker
=
false
,
reactions
=
getReactions
(
message
),
isFirstUnread
=
false
,
preview
=
preview
,
isTemporary
=
!
synced
,
unread
=
unread
,
permalink
=
permalink
)
preview
=
preview
,
isTemporary
=
!
synced
,
unread
=
unread
,
permalink
=
permalink
,
subscriptionId
=
chatRoom
.
subscriptionId
)
}
private
fun
mapMessagePreview
(
message
:
Message
):
Message
{
...
...
app/src/main/java/chat/rocket/android/userdetails/presentation/UserDetailsPresenter.kt
View file @
8c0916b1
package
chat.rocket.android.userdetails.presentation
import
androidx.core.text.toSpannable
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.db.DatabaseManager
import
chat.rocket.android.helper.UserHelper
import
chat.rocket.android.server.domain.GetConnectingServerInteractor
import
chat.rocket.android.server.infraestructure.ConnectionManagerFactory
import
chat.rocket.android.util.extension.launchUI
...
...
@@ -22,11 +24,13 @@ class UserDetailsPresenter @Inject constructor(
private
val
dbManager
:
DatabaseManager
,
private
val
strategy
:
CancelStrategy
,
serverInteractor
:
GetConnectingServerInteractor
,
factory
:
ConnectionManagerFactory
factory
:
ConnectionManagerFactory
,
userHelper
:
UserHelper
)
{
private
var
currentServer
=
serverInteractor
.
get
()
!!
private
val
manager
=
factory
.
create
(
currentServer
)
private
val
client
=
manager
.
client
private
val
userId
=
userHelper
.
user
()
?.
id
fun
loadUserDetails
(
userId
:
String
)
{
launchUI
(
strategy
)
{
...
...
@@ -50,7 +54,7 @@ class UserDetailsPresenter @Inject constructor(
if
(
matchFromSpotlight
!=
null
)
{
with
(
matchFromSpotlight
)
{
ChatRoom
(
id
=
id
,
id
=
"$id$userId"
,
type
=
roomTypeOf
(
RoomType
.
DIRECT_MESSAGE
),
name
=
u
.
username
?:
u
.
name
.
orEmpty
(),
fullName
=
u
.
name
,
...
...
@@ -76,7 +80,7 @@ class UserDetailsPresenter @Inject constructor(
subscriptionId
=
""
,
timestamp
=
null
,
updatedAt
=
null
,
user
=
SimpleUser
(
id
,
username
)
user
=
null
)
}
}
else
null
...
...
app/src/main/java/chat/rocket/android/userdetails/ui/UserDetailsActivity.kt
View file @
8c0916b1
...
...
@@ -17,6 +17,7 @@ import chat.rocket.android.util.extension.orFalse
import
chat.rocket.android.util.extensions.showToast
import
chat.rocket.common.model.roomTypeOf
import
chat.rocket.core.model.ChatRoom
import
chat.rocket.core.model.userId
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Priority
import
com.bumptech.glide.load.resource.bitmap.CenterCrop
...
...
@@ -38,16 +39,19 @@ import org.threeten.bp.ZoneId
import
org.threeten.bp.ZoneOffset
import
org.threeten.bp.ZonedDateTime
import
org.threeten.bp.format.DateTimeFormatter
import
timber.log.Timber
import
javax.inject.Inject
import
kotlin.math.roundToLong
fun
Context
.
userDetailsIntent
(
userId
:
String
):
Intent
{
fun
Context
.
userDetailsIntent
(
userId
:
String
,
subscriptionId
:
String
):
Intent
{
return
Intent
(
this
,
UserDetailsActivity
::
class
.
java
).
apply
{
putExtra
(
EXTRA_USER_ID
,
userId
)
putExtra
(
EXTRA_SUBSCRIPTION_ID
,
subscriptionId
)
}
}
const
val
EXTRA_USER_ID
=
"EXTRA_USER_ID"
const
val
EXTRA_SUBSCRIPTION_ID
=
"EXTRA_USERNAME"
class
UserDetailsActivity
:
AppCompatActivity
(),
UserDetailsView
,
HasSupportFragmentInjector
{
...
...
@@ -56,6 +60,8 @@ class UserDetailsActivity : AppCompatActivity(), UserDetailsView, HasSupportFrag
@Inject
lateinit
var
presenter
:
UserDetailsPresenter
private
lateinit
var
subscriptionId
:
String
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
AndroidInjection
.
inject
(
this
)
super
.
onCreate
(
savedInstanceState
)
...
...
@@ -63,6 +69,7 @@ class UserDetailsActivity : AppCompatActivity(), UserDetailsView, HasSupportFrag
setupToolbar
()
val
userId
=
intent
.
getStringExtra
(
EXTRA_USER_ID
)
subscriptionId
=
intent
.
getStringExtra
(
EXTRA_SUBSCRIPTION_ID
)
presenter
.
loadUserDetails
(
userId
=
userId
)
}
...
...
@@ -129,18 +136,20 @@ class UserDetailsActivity : AppCompatActivity(), UserDetailsView, HasSupportFrag
private
fun
toDirectMessage
(
chatRoom
:
ChatRoom
?)
{
chatRoom
?.
let
{
c
->
finish
()
startActivity
(
chatRoomIntent
(
chatRoomId
=
c
.
id
,
chatRoomName
=
c
.
name
,
chatRoomType
=
c
.
type
.
toString
(),
isReadOnly
=
c
.
readonly
.
orFalse
(),
chatRoomLastSeen
=
c
.
lastSeen
?:
0
,
isSubscribed
=
c
.
open
,
isCreator
=
false
,
isFavorite
=
c
.
favorite
if
(
c
.
subscriptionId
.
isEmpty
()
||
c
.
subscriptionId
!=
subscriptionId
)
{
startActivity
(
chatRoomIntent
(
chatRoomId
=
c
.
id
,
chatRoomName
=
c
.
name
,
chatRoomType
=
c
.
type
.
toString
(),
isReadOnly
=
c
.
readonly
.
orFalse
(),
chatRoomLastSeen
=
c
.
lastSeen
?:
0
,
isSubscribed
=
c
.
open
,
isCreator
=
false
,
isFavorite
=
c
.
favorite
)
)
)
}
}
}
}
app/src/main/res/layout/activity_user_details.xml
View file @
8c0916b1
...
...
@@ -32,7 +32,7 @@
android:id=
"@+id/text_view_message"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
M
essage"
android:text=
"
@string/m
essage"
android:textColor=
"#1d74f5"
android:textSize=
"18sp"
app:layout_constraintEnd_toEndOf=
"@+id/image_view_message"
...
...
@@ -72,7 +72,7 @@
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"24dp"
android:text=
"
S
tatus"
android:text=
"
@string/s
tatus"
android:textColor=
"@color/darkGray"
android:textSize=
"14sp"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -95,7 +95,7 @@
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:text=
"
T
imezone"
android:text=
"
@string/t
imezone"
android:textColor=
"@color/darkGray"
android:textSize=
"14sp"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -152,7 +152,6 @@
android:layout_marginEnd=
"16dp"
android:background=
"@drawable/bg_round_bounds_white"
tools:srcCompat=
"@tools:sample/avatars[6]"
/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
app/src/main/res/values-de/strings.xml
View file @
8c0916b1
...
...
@@ -329,6 +329,9 @@
<string
name=
"notif_success_sending"
>
Nachricht gesendet nach %1$s!
</string>
<string
name=
"read_by"
>
Gelesen von
</string>
<string
name=
"message_information_title"
>
Nachricht Information
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
</resources>
\ No newline at end of file
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<!--TODO - Add proper translation-->
<!-- User Details -->
<string
name=
"message"
>
Message
</string>
<!--TODO - Add proper translation-->
<string
name=
"timezone"
>
Timezone
</string>
<!--TODO - Add proper translation-->
</resources>
app/src/main/res/values-es/strings.xml
View file @
8c0916b1
...
...
@@ -330,6 +330,9 @@
<string
name=
"msg_file_description"
>
Descripción del archivo
</string>
<string
name=
"msg_send"
>
Enviar
</string>
<string
name=
"msg_sent_attachment"
>
Envió un archivo
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<!--TODO - Add proper translation-->
<!-- User Details -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
<!-- TODO - Add proper translation -->
</resources>
app/src/main/res/values-fr/strings.xml
View file @
8c0916b1
...
...
@@ -334,4 +334,10 @@
<string
name=
"msg_sent_attachment"
>
Envoyé un fichier
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
</resources>
\ No newline at end of file
app/src/main/res/values-hi-rIN/strings.xml
View file @
8c0916b1
...
...
@@ -334,4 +334,10 @@
<string
name=
"message_information_title"
>
संदेश की जानकारी
</string>
<string
name=
"msg_log_out"
>
लॉग आउट कर रहा हूं…
</string>
<string
name=
"message_room_changed_privacy"
>
%2$s ने रूम का प्रकार बदलकर %1$s किया
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
</resources>
app/src/main/res/values-it/strings.xml
View file @
8c0916b1
...
...
@@ -329,4 +329,9 @@
<string
name=
"message_information_title"
>
Informazioni Messaggio
</string>
<string
name=
"message_room_changed_privacy"
>
Il tipo di stanza è cambiato in: %1$s da %2$s
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
</resources>
app/src/main/res/values-ja/strings.xml
View file @
8c0916b1
...
...
@@ -336,4 +336,9 @@
<string
name=
"message_room_changed_privacy"
>
ルームタイプを %2$s から %1$s に変更しました
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
</resources>
\ No newline at end of file
app/src/main/res/values-pt-rBR/strings.xml
View file @
8c0916b1
...
...
@@ -332,4 +332,10 @@
<string
name=
"msg_log_out"
>
Deslogando…
</string>
<string
name=
"msg_sent_attachment"
>
Enviou um arquivo
</string>
<string
name=
"message_room_changed_privacy"
>
O tipo da sala mudou para: %1$s por %2$s
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Mensagem
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Fuso Horário
</string>
</resources>
app/src/main/res/values-ru-rRU/strings.xml
View file @
8c0916b1
...
...
@@ -330,4 +330,10 @@
<string
name=
"message_information_title"
>
Информация о прочтении
</string>
<string
name=
"msg_log_out"
>
Выходим…
</string>
<string
name=
"message_room_changed_privacy"
>
Тип канала изменен на: %1$s пользователем %2$s
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
</resources>
app/src/main/res/values-tr/strings.xml
View file @
8c0916b1
...
...
@@ -332,6 +332,9 @@
<string
name=
"notif_success_sending"
>
Mesaj %1$s\'a gönderildi!
</string>
<string
name=
"read_by"
>
ile oku
</string>
<string
name=
"message_information_title"
>
Mesaj bilgisi
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<!--TODO - Add proper translation-->
<!-- User Details -->
<string
name=
"message"
>
Message
</string>
<!--TODO - Add proper translation-->
<string
name=
"timezone"
>
Timezone
</string>
<!--TODO - Add proper translation-->
</resources>
app/src/main/res/values-uk/strings.xml
View file @
8c0916b1
...
...
@@ -332,4 +332,10 @@
<string
name=
"msg_sent_attachment"
>
Долучення відправлено
</string>
<!--TODO - Add proper translation-->
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<!-- User Details -->
<!-- TODO - Add proper translation -->
<string
name=
"message"
>
Message
</string>
<!-- TODO - Add proper translation -->
<string
name=
"timezone"
>
Timezone
</string>
</resources>
app/src/main/res/values/strings.xml
View file @
8c0916b1
...
...
@@ -203,7 +203,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string
name=
"msg_view_more"
>
view more
</string>
<string
name=
"msg_view_less"
>
view less
</string>
<string
name=
"msg_muted_on_this_channel"
>
You are muted on this channel
</string>
<!-- Preferences messages -->
<string
name=
"msg_analytics_tracking"
>
Analytics tracking
</string>
<string
name=
"msg_send_analytics_tracking"
>
Send anonymous statics to help improving this app
</string>
...
...
@@ -346,5 +346,10 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string
name=
"message_information_title"
>
Message information
</string>
<string
name=
"message_room_changed_privacy"
>
Room type changed to: %1$s by %2$s
</string>
<string
name=
"foss"
tools:ignore=
"MissingTranslation"
>
(FOSS)
</string>
<string
name=
"foss"
translatable=
"false"
>
(FOSS)
</string>
<!-- User Details -->
<string
name=
"message"
>
Message
</string>
<string
name=
"timezone"
>
Timezone
</string>
<string
name=
"status"
translatable=
"false"
>
Status
</string>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment