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
c0c0d08a
Commit
c0c0d08a
authored
May 14, 2019
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve code.
parent
3eaba537
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
20 additions
and
47 deletions
+20
-47
UserDetailsPresenter.kt
.../android/userdetails/presentation/UserDetailsPresenter.kt
+12
-22
UserDetailsView.kt
...ocket/android/userdetails/presentation/UserDetailsView.kt
+1
-1
UserDetailsFragment.kt
...chat/rocket/android/userdetails/ui/UserDetailsFragment.kt
+7
-8
strings.xml
app/src/main/res/values-ar/strings.xml
+0
-1
strings.xml
app/src/main/res/values-de/strings.xml
+0
-1
strings.xml
app/src/main/res/values-es/strings.xml
+0
-1
strings.xml
app/src/main/res/values-fa/strings.xml
+0
-1
strings.xml
app/src/main/res/values-fr/strings.xml
+0
-1
strings.xml
app/src/main/res/values-hi-rIN/strings.xml
+0
-1
strings.xml
app/src/main/res/values-it/strings.xml
+0
-1
strings.xml
app/src/main/res/values-ja/strings.xml
+0
-1
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+0
-1
strings.xml
app/src/main/res/values-pt-rPT/strings.xml
+0
-1
strings.xml
app/src/main/res/values-ru-rRU/strings.xml
+0
-1
strings.xml
app/src/main/res/values-tr/strings.xml
+0
-1
strings.xml
app/src/main/res/values-uk/strings.xml
+0
-1
strings.xml
app/src/main/res/values-zh-rCN/strings.xml
+0
-1
strings.xml
app/src/main/res/values-zh-rTW/strings.xml
+0
-1
strings.xml
app/src/main/res/values/strings.xml
+0
-1
No files found.
app/src/main/java/chat/rocket/android/userdetails/presentation/UserDetailsPresenter.kt
View file @
c0c0d08a
...
...
@@ -47,31 +47,21 @@ class UserDetailsPresenter @Inject constructor(
view
.
showLoading
()
dbManager
.
getUser
(
userId
)
?.
let
{
userEntity
=
it
val
avatarUrl
=
userEntity
.
username
?.
let
{
username
->
currentServer
.
avatarUrl
(
username
,
token
?.
userId
,
token
?.
authToken
)
val
avatarUrl
=
userEntity
.
username
?.
let
{
username
->
currentServer
.
avatarUrl
(
username
,
token
?.
userId
,
token
?.
authToken
)
}
val
username
=
userEntity
.
username
val
name
=
userEntity
.
name
val
utcOffset
=
userEntity
.
utcOffset
// TODO Convert UTC and display like the mockup
val
utcOffset
=
userEntity
.
utcOffset
// FIXME Convert UTC
if
(
avatarUrl
!=
null
||
username
!=
null
||
name
!=
null
||
utcOffset
!=
null
)
{
view
.
showUserDetailsAndActions
(
avatarUrl
=
avatarUrl
.
toString
()
,
avatarUrl
=
avatarUrl
,
name
=
name
,
username
=
username
,
status
=
userEntity
.
status
,
utcOffset
=
utcOffset
.
toString
(),
isVideoCallAllowed
=
settings
.
isJitsiEnabled
()
)
}
else
{
throw
Exception
()
}
}
}
catch
(
ex
:
Exception
)
{
Timber
.
e
(
ex
)
...
...
app/src/main/java/chat/rocket/android/userdetails/presentation/UserDetailsView.kt
View file @
c0c0d08a
...
...
@@ -16,7 +16,7 @@ interface UserDetailsView : LoadingView, MessageView {
* @param isVideoCallAllowed True if the video call is allowed, false otherwise.
*/
fun
showUserDetailsAndActions
(
avatarUrl
:
String
,
avatarUrl
:
String
?
,
name
:
String
?,
username
:
String
?,
status
:
String
?,
...
...
app/src/main/java/chat/rocket/android/userdetails/ui/UserDetailsFragment.kt
View file @
c0c0d08a
...
...
@@ -79,14 +79,15 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
}
override
fun
showUserDetailsAndActions
(
avatarUrl
:
String
,
avatarUrl
:
String
?
,
name
:
String
?,
username
:
String
?,
status
:
String
?,
utcOffset
:
String
?,
isVideoCallAllowed
:
Boolean
)
{
val
requestBuilder
=
Glide
.
with
(
this
).
load
(
avatarUrl
)
val
requestBuilder
=
Glide
.
with
(
this
)
.
load
(
avatarUrl
)
.
apply
(
RequestOptions
.
skipMemoryCacheOf
(
true
))
.
apply
(
RequestOptions
.
diskCacheStrategyOf
(
DiskCacheStrategy
.
NONE
))
...
...
@@ -97,14 +98,12 @@ class UserDetailsFragment : Fragment(), UserDetailsView {
requestBuilder
.
apply
(
RequestOptions
.
bitmapTransform
(
RoundedCorners
(
14
)))
.
into
(
image_avatar
)
text_name
.
text
=
name
?:
""
text_username
.
text
=
username
?:
""
text_name
.
text
=
name
?:
getString
(
R
.
string
.
msg_unknown
)
text_username
.
text
=
username
?:
getString
(
R
.
string
.
msg_unknown
)
val
userStatus
=
if
(
status
!=
null
)
status
.
substring
(
0
,
1
).
toUpperCase
()
+
status
.
substring
(
1
)
else
""
text_description_status
.
text
=
userStatus
text_description_status
.
text
=
status
?.
capitalize
()
?:
getString
(
R
.
string
.
msg_unknown
)
val
userUtcOffset
=
if
(
utcOffset
.
equals
(
"null"
))
getString
(
R
.
string
.
user_timezone_none
)
else
utcOffset
text_description_timezone
.
text
=
userUtcOffset
text_description_timezone
.
text
=
utcOffset
?:
getString
(
R
.
string
.
msg_unknown
)
text_video_call
.
isVisible
=
isVideoCallAllowed
...
...
app/src/main/res/values-ar/strings.xml
View file @
c0c0d08a
...
...
@@ -366,7 +366,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
المنظقة الزمنية
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
تأكيد
</string>
...
...
app/src/main/res/values-de/strings.xml
View file @
c0c0d08a
...
...
@@ -364,7 +364,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Zeitzone
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Senden
</string>
...
...
app/src/main/res/values-es/strings.xml
View file @
c0c0d08a
...
...
@@ -366,7 +366,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Timezone
</string>
<!-- TODO - Add proper translation -->
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Submit
</string>
<!--TODO - Add proper translation-->
...
...
app/src/main/res/values-fa/strings.xml
View file @
c0c0d08a
...
...
@@ -364,7 +364,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
منطقهی زمانی
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
واگذاری
</string>
...
...
app/src/main/res/values-fr/strings.xml
View file @
c0c0d08a
...
...
@@ -365,7 +365,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Fuseau horaire
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Soumettre
</string>
...
...
app/src/main/res/values-hi-rIN/strings.xml
View file @
c0c0d08a
...
...
@@ -366,7 +366,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
समय क्षेत्र
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
जमा करें
</string>
...
...
app/src/main/res/values-it/strings.xml
View file @
c0c0d08a
...
...
@@ -361,7 +361,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Fuso Orario
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Invia
</string>
...
...
app/src/main/res/values-ja/strings.xml
View file @
c0c0d08a
...
...
@@ -365,7 +365,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Timezone
</string>
<!--TODO - Add proper translation-->
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Submit
</string>
<!--TODO - Add proper translation-->
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
c0c0d08a
...
...
@@ -365,7 +365,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Fuso horário
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Enviar
</string>
...
...
app/src/main/res/values-pt-rPT/strings.xml
View file @
c0c0d08a
...
...
@@ -363,7 +363,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Fuso Horário
</string>
<string
name=
"status"
>
Estado: %1$s
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Enviar
</string>
...
...
app/src/main/res/values-ru-rRU/strings.xml
View file @
c0c0d08a
...
...
@@ -362,7 +362,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Часовой пояс
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Отправить
</string>
...
...
app/src/main/res/values-tr/strings.xml
View file @
c0c0d08a
...
...
@@ -365,7 +365,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Timezone
</string>
<!--TODO - Add proper translation-->
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Submit
</string>
<!--TODO - Add proper translation-->
...
...
app/src/main/res/values-uk/strings.xml
View file @
c0c0d08a
...
...
@@ -362,7 +362,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
Timezone
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
Submit
</string>
<!-- TODO - Add proper translation -->
...
...
app/src/main/res/values-zh-rCN/strings.xml
View file @
c0c0d08a
...
...
@@ -364,7 +364,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
时区
</string>
<string
name=
"status"
translatable=
"false"
>
状态: %1$s
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
提交
</string>
...
...
app/src/main/res/values-zh-rTW/strings.xml
View file @
c0c0d08a
...
...
@@ -344,7 +344,6 @@
<!-- User Details -->
<string
name=
"timezone"
>
時區
</string>
<string
name=
"status"
translatable=
"false"
>
狀態: %1$s
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- TODO Add translation -->
<!-- Report -->
<string
name=
"submit"
>
提交
</string>
...
...
app/src/main/res/values/strings.xml
View file @
c0c0d08a
...
...
@@ -381,7 +381,6 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string
name=
"timezone"
>
Timezone
</string>
<string
name=
"status"
translatable=
"false"
>
Status: %1$s
</string>
<string
name=
"user_detail_status"
translatable=
"false"
>
Status
</string>
<string
name=
"user_timezone_none"
>
None
</string>
<!-- Report -->
<string
name=
"submit"
>
Submit
</string>
...
...
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