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
2e563131
Commit
2e563131
authored
Feb 20, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add swapping icons between emoji and keyboard
parent
1e4ac51e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+7
-1
EmojiFragment.kt
...in/java/chat/rocket/android/widget/emoji/EmojiFragment.kt
+0
-1
ic_keyboard_black_24px.xml
app/src/main/res/drawable/ic_keyboard_black_24px.xml
+19
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
2e563131
...
...
@@ -14,6 +14,7 @@ import android.support.v7.widget.LinearLayoutManager
import
android.support.v7.widget.RecyclerView
import
android.text.method.ScrollingMovementMethod
import
android.view.*
import
android.widget.ImageButton
import
chat.rocket.android.R
import
chat.rocket.android.chatroom.presentation.ChatRoomPresenter
import
chat.rocket.android.chatroom.presentation.ChatRoomView
...
...
@@ -278,7 +279,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.OnEmojiClickCal
},
600
)
}
button_add_reaction
.
setOnClickListener
{
button_add_reaction
.
setOnClickListener
{
view
->
activity
?.
let
{
val
editor
=
text_message
val
emojiFragment
=
EmojiFragment
.
getOrAttach
(
it
,
R
.
id
.
emoji_fragment_placeholder
,
composer
)
...
...
@@ -286,11 +287,16 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.OnEmojiClickCal
if
(!
isShown
())
{
show
()
}
else
{
val
button
=
view
as
ImageButton
val
resourceId
:
Int
if
(
softKeyboardVisible
)
{
resourceId
=
R
.
drawable
.
ic_keyboard_black_24px
KeyboardHelper
.
hideSoftKeyboard
(
it
)
}
else
{
resourceId
=
R
.
drawable
.
ic_reaction_24dp
KeyboardHelper
.
showSoftKeyboard
(
editor
)
}
button
.
setImageResource
(
resourceId
)
}
}
}
...
...
app/src/main/java/chat/rocket/android/widget/emoji/EmojiFragment.kt
View file @
2e563131
...
...
@@ -93,7 +93,6 @@ class EmojiFragment : Fragment() {
}
else
if
(
lastVisibleDecorViewHeight
+
150
<
visibleDecorViewHeight
)
{
// Notify listener about keyboard being hidden.
softKeyboardVisible
=
false
hide
()
}
}
// Save current decor view height for the next call.
...
...
app/src/main/res/drawable/ic_keyboard_black_24px.xml
0 → 100644
View file @
2e563131
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<path
android:fillColor=
"#000000"
android:pathData=
"M20,5 L4,5 C2.9,5,2.01,5.9,2.01,7 L2,17 C2,18.1,2.9,19,4,19 L20,19
C21.1,19,22,18.1,22,17 L22,7 C22,5.9,21.1,5,20,5 Z M11,8 L13,8 L13,10 L11,10
L11,8 Z M11,11 L13,11 L13,13 L11,13 L11,11 Z M8,8 L10,8 L10,10 L8,10 L8,8 Z
M8,11 L10,11 L10,13 L8,13 L8,11 Z M7,13 L5,13 L5,11 L7,11 L7,13 Z M7,10 L5,10
L5,8 L7,8 L7,10 Z M16,17 L8,17 L8,15 L16,15 L16,17 Z M16,13 L14,13 L14,11 L16,11
L16,13 Z M16,10 L14,10 L14,8 L16,8 L16,10 Z M19,13 L17,13 L17,11 L19,11 L19,13 Z
M19,10 L17,10 L17,8 L19,8 L19,10 Z"
/>
<path
android:pathData=
"M0,0 L24,0 L24,24 L0,24 Z M-24,0 L0,0 L0,24 L0,24 Z"
/>
</vector>
\ 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