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
0d49577b
Commit
0d49577b
authored
Mar 14, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get command description from strings
parent
530a49e9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
8 deletions
+57
-8
CommandSuggestionsAdapter.kt
...ket/android/chatroom/adapter/CommandSuggestionsAdapter.kt
+5
-2
ChatRoomPresenter.kt
...rocket/android/chatroom/presentation/ChatRoomPresenter.kt
+1
-0
suggestion_command_item.xml
app/src/main/res/layout/suggestion_command_item.xml
+4
-6
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+24
-0
strings.xml
app/src/main/res/values/strings.xml
+23
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/adapter/CommandSuggestionsAdapter.kt
View file @
0d49577b
...
...
@@ -27,8 +27,11 @@ class CommandSuggestionsAdapter : SuggestionsAdapter<CommandSuggestionsViewHolde
with
(
itemView
)
{
val
nameTextView
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
text_command_name
)
val
descriptionTextView
=
itemView
.
findViewById
<
TextView
>(
R
.
id
.
text_command_description
)
nameTextView
.
text
=
item
.
text
descriptionTextView
.
text
=
item
.
description
.
replace
(
"_"
,
" "
)
nameTextView
.
text
=
"/${item.text}"
val
res
=
context
.
resources
val
id
=
res
.
getIdentifier
(
item
.
description
,
"string"
,
context
.
packageName
)
val
description
=
if
(
id
>
0
)
res
.
getString
(
id
)
else
""
descriptionTextView
.
text
=
description
setOnClickListener
{
itemClickListener
?.
onClick
(
item
)
}
...
...
app/src/main/java/chat/rocket/android/chatroom/presentation/ChatRoomPresenter.kt
View file @
0d49577b
...
...
@@ -495,6 +495,7 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
//TODO: cache the commands
val
commands
=
client
.
commands
(
0
,
100
).
result
view
.
populateCommandSuggestions
(
commands
.
map
{
println
(
"${it.command} - ${it.description}"
)
CommandSuggestionViewModel
(
it
.
command
,
it
.
description
?:
""
,
listOf
(
it
.
command
))
})
}
catch
(
ex
:
RocketChatException
)
{
...
...
app/src/main/res/layout/suggestion_command_item.xml
View file @
0d49577b
...
...
@@ -13,7 +13,6 @@
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_centerVertical=
"true"
android:layout_marginStart=
"16dp"
android:ellipsize=
"end"
android:maxLines=
"1"
...
...
@@ -23,14 +22,13 @@
<TextView
android:id=
"@+id/text_command_description"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginStart=
"16dp"
android:layout_toEndOf=
"@id/text_command_name"
android:ellipsize=
"end"
android:maxLines=
"1"
android:layout_toRightOf=
"@id/text_command_name"
android:gravity=
"end"
android:textColor=
"@color/gray_material"
android:layout_marginEnd=
"16dp"
android:textSize=
"16sp"
tools:text=
"Leave a channel"
/>
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
0d49577b
...
...
@@ -114,4 +114,28 @@
<string
name=
"status_authenticating"
>
autenticando
</string>
<string
name=
"status_disconnecting"
>
desconectando
</string>
<string
name=
"status_waiting"
>
conectando em %d segundos
</string>
<!-- Slash Commands -->
<string
name=
"Slash_Gimme_Description"
>
Exibir ༼ つ ◕_◕ ༽つ antes de sua mensagem
</string>
<string
name=
"Slash_LennyFace_Description"
>
Exibir ( ͡° ͜ʖ ͡°) depois de sua mensagem
</string>
<string
name=
"Slash_Shrug_Description"
>
Exibir ¯\_(ツ)_/¯ depois de sua mensagem
</string>
<string
name=
"Slash_Tableflip_Description"
>
Exibir (╯°□°)╯︵ ┻━┻
</string>
<string
name=
"Slash_TableUnflip_Description"
>
Exibir ┬─┬ ノ( ゜-゜ノ)
</string>
<string
name=
"Create_A_New_Channel"
>
Criar um novo canal
</string>
<string
name=
"Show_the_keyboard_shortcut_list"
>
Show the keyboard shortcut list
</string>
<string
name=
"Invite_user_to_join_channel_all_from"
>
do [#canal] para entrar neste
</string>
<string
name=
"Invite_user_to_join_channel_all_to"
>
Convidar todos os usuários deste canal para entrar no [#canal]
</string>
<string
name=
"Archive"
>
Arquivar
</string>
<string
name=
"Remove_someone_from_room"
>
Remover alguém do canal
</string>
<string
name=
"Leave_the_current_channel"
>
Sair do canal atual
</string>
<string
name=
"Displays_action_text"
>
Exibir texto de ação
</string>
<string
name=
"Direct_message_someone"
>
Enviar DM para alguém
</string>
<string
name=
"Mute_someone_in_room"
>
Mutar alguém
</string>
<string
name=
"Unmute_someone_in_room"
>
Desmutar alguém na sala
</string>
<string
name=
"Invite_user_to_join_channel"
>
Convidar algum usuário para entrar neste canal
</string>
<string
name=
"Unarchive"
>
Desarquivar
</string>
<string
name=
"Join_the_given_channel"
>
Entrar no canal especificado
</string>
<string
name=
"Guggy_Command_Description"
>
Gera um gif baseado no texto dado
</string>
<string
name=
"Slash_Topic_Description"
>
Definir tópico
</string>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
0d49577b
...
...
@@ -116,4 +116,27 @@
<string
name=
"status_disconnecting"
>
disconnecting
</string>
<string
name=
"status_waiting"
>
connecting in %d seconds
</string>
<!-- Slash Commands -->
<string
name=
"Slash_Gimme_Description"
>
Displays ༼ つ ◕_◕ ༽つ before your message
</string>
<string
name=
"Slash_LennyFace_Description"
>
Displays ( ͡° ͜ʖ ͡°) after your message
</string>
<string
name=
"Slash_Shrug_Description"
>
Displays ¯\_(ツ)_/¯ after your message
</string>
<string
name=
"Slash_Tableflip_Description"
>
Displays (╯°□°)╯︵ ┻━┻
</string>
<string
name=
"Slash_TableUnflip_Description"
>
Displays ┬─┬ ノ( ゜-゜ノ)
</string>
<string
name=
"Create_A_New_Channel"
>
Create a new channel
</string>
<string
name=
"Show_the_keyboard_shortcut_list"
>
Show the keyboard shortcut list
</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_to"
>
Invite all users from this channel to join [#channel]
</string>
<string
name=
"Archive"
>
Archive
</string>
<string
name=
"Remove_someone_from_room"
>
Remove someone from the room
</string>
<string
name=
"Leave_the_current_channel"
>
Leave the current channel
</string>
<string
name=
"Displays_action_text"
>
Displays action text
</string>
<string
name=
"Direct_message_someone"
>
Direct message someone
</string>
<string
name=
"Mute_someone_in_room"
>
Mute someone in the room
</string>
<string
name=
"Unmute_someone_in_room"
>
Unmute someone in the room
</string>
<string
name=
"Invite_user_to_join_channel"
>
Invite one user to join this channel
</string>
<string
name=
"Unarchive"
>
Unarchive
</string>
<string
name=
"Join_the_given_channel"
>
Join the given channel
</string>
<string
name=
"Guggy_Command_Description"
>
Generates a gif based upon the provided text
</string>
<string
name=
"Slash_Topic_Description"
>
Set topic
</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