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
49fecc78
Commit
49fecc78
authored
Dec 20, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug that keeps the emoji keyboard open when changing the screen while it is open.
parent
39defb0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
31 deletions
+29
-31
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+25
-19
ic_keyboard_black_24dp.xml
app/src/main/res/drawable/ic_keyboard_black_24dp.xml
+3
-9
message_composer.xml
app/src/main/res/layout/message_composer.xml
+1
-2
OverKeyboardPopupWindow.kt
...java/chat/rocket/android/emoji/OverKeyboardPopupWindow.kt
+0
-1
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
49fecc78
...
...
@@ -6,7 +6,6 @@ import android.content.ClipData
import
android.content.ClipboardManager
import
android.content.Context
import
android.content.Intent
import
android.content.res.Configuration
import
android.graphics.drawable.Drawable
import
android.net.Uri
import
android.os.Bundle
...
...
@@ -723,8 +722,8 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
private
fun
setReactionButtonIcon
(
@DrawableRes
drawableId
:
Int
)
{
button_add_reaction
.
setImageResource
(
drawableId
)
button_add_reaction
.
tag
=
drawableId
button_add_reaction
_or_show_keyboard
.
setImageResource
(
drawableId
)
button_add_reaction
_or_show_keyboard
.
tag
=
drawableId
}
override
fun
showFileSelection
(
filter
:
Array
<
String
>?)
{
...
...
@@ -841,9 +840,13 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
subscribeComposeTextMessage
()
emojiKeyboardPopup
=
EmojiKeyboardPopup
(
activity
!!
,
activity
!!
.
findViewById
(
R
.
id
.
fragment_container
))
emojiKeyboardPopup
.
listener
=
this
text_message
.
listener
=
object
:
ComposerEditText
.
ComposerEditTextListener
{
override
fun
onKeyboardOpened
()
{}
override
fun
onKeyboardOpened
()
{
KeyboardHelper
.
showSoftKeyboard
(
text_message
)
}
override
fun
onKeyboardClosed
()
{
activity
?.
let
{
...
...
@@ -875,9 +878,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
hideAttachmentOptions
()
}
button_add_reaction
.
setOnClickListener
{
_
->
openEmojiKeyboardPopup
()
}
button_add_reaction_or_show_keyboard
.
setOnClickListener
{
toggleKeyboard
()
}
button_take_a_photo
.
setOnClickListener
{
dispatchTakePictureIntent
()
...
...
@@ -969,19 +970,10 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
presenter
.
loadCommands
()
}
private
fun
openEmojiKeyboardPopup
()
{
// Shows the emoji or the system keyboard.
private
fun
toggleKeyboard
()
{
if
(!
emojiKeyboardPopup
.
isShowing
)
{
// If keyboard is visible, simply show the popup
if
(
emojiKeyboardPopup
.
isKeyboardOpen
)
{
emojiKeyboardPopup
.
showAtBottom
()
}
else
{
// Open the text keyboard first and immediately after that show the emoji popup
text_message
.
isFocusableInTouchMode
=
true
text_message
.
requestFocus
()
emojiKeyboardPopup
.
showAtBottomPending
()
KeyboardHelper
.
showSoftKeyboard
(
text_message
)
}
setReactionButtonIcon
(
R
.
drawable
.
ic_keyboard_black_24dp
)
openEmojiKeyboard
()
}
else
{
// If popup is showing, simply dismiss it to show the underlying text keyboard
dismissEmojiKeyboard
()
...
...
@@ -1149,6 +1141,20 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
description
=
"This message was reported by a user from the Android app"
)
}
fun
openEmojiKeyboard
()
{
// If keyboard is visible, simply show the popup
if
(
emojiKeyboardPopup
.
isKeyboardOpen
)
{
emojiKeyboardPopup
.
showAtBottom
()
}
else
{
// Open the text keyboard first and immediately after that show the emoji popup
text_message
.
isFocusableInTouchMode
=
true
text_message
.
requestFocus
()
emojiKeyboardPopup
.
showAtBottomPending
()
KeyboardHelper
.
showSoftKeyboard
(
text_message
)
}
setReactionButtonIcon
(
R
.
drawable
.
ic_keyboard_black_24dp
)
}
fun
dismissEmojiKeyboard
()
{
// Check if the keyboard was ever initialized.
// It may be the case when you are looking a not joined room
...
...
app/src/main/res/drawable/ic_keyboard_black_24dp.xml
View file @
49fecc78
...
...
@@ -7,13 +7,7 @@
<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"
/>
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
app/src/main/res/layout/message_composer.xml
View file @
49fecc78
...
...
@@ -59,13 +59,12 @@
app:layout_constraintTop_toBottomOf=
"@+id/divider"
>
<ImageButton
android:id=
"@+id/button_add_reaction"
android:id=
"@+id/button_add_reaction
_or_show_keyboard
"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_gravity=
"bottom"
android:layout_marginEnd=
"16dp"
android:background=
"?attr/selectableItemBackgroundBorderless"
android:contentDescription=
"@string/msg_content_description_show_attachment_options"
android:src=
"@drawable/ic_reaction_24dp"
/>
<chat.rocket.android.emoji.ComposerEditText
...
...
emoji/src/main/java/chat/rocket/android/emoji/OverKeyboardPopupWindow.kt
View file @
49fecc78
...
...
@@ -21,7 +21,6 @@ package chat.rocket.android.emoji
import
android.content.Context
import
android.graphics.Point
import
android.graphics.Rect
import
android.os.Build
import
android.view.Gravity
import
android.view.LayoutInflater
import
android.view.View
...
...
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