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
f28d2b39
Commit
f28d2b39
authored
Jul 06, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix load and skin tone on reactions
parent
e02df06c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
EmojiKeyboardPopup.kt
...main/java/chat/rocket/android/emoji/EmojiKeyboardPopup.kt
+4
-1
EmojiPickerPopup.kt
...c/main/java/chat/rocket/android/emoji/EmojiPickerPopup.kt
+22
-2
No files found.
emoji/src/main/java/chat/rocket/android/emoji/EmojiKeyboardPopup.kt
View file @
f28d2b39
...
@@ -165,8 +165,11 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
...
@@ -165,8 +165,11 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
textView
.
setImageResource
(
category
.
resourceIcon
())
textView
.
setImageResource
(
category
.
resourceIcon
())
}
}
val
currentTab
=
if
(
EmojiRepository
.
getRecents
().
isEmpty
())
EmojiCategory
.
PEOPLE
.
ordinal
else
val
currentTab
=
if
(
EmojiRepository
.
getRecents
().
isEmpty
())
{
EmojiCategory
.
PEOPLE
.
ordinal
}
else
{
EmojiCategory
.
RECENTS
.
ordinal
EmojiCategory
.
RECENTS
.
ordinal
}
viewPager
.
currentItem
=
currentTab
viewPager
.
currentItem
=
currentTab
}
}
}
}
...
...
emoji/src/main/java/chat/rocket/android/emoji/EmojiPickerPopup.kt
View file @
f28d2b39
...
@@ -7,14 +7,19 @@ import android.view.LayoutInflater
...
@@ -7,14 +7,19 @@ import android.view.LayoutInflater
import
android.view.Window
import
android.view.Window
import
android.view.WindowManager
import
android.view.WindowManager
import
android.widget.ImageView
import
android.widget.ImageView
import
androidx.annotation.ColorInt
import
androidx.core.content.ContextCompat
import
androidx.core.content.edit
import
chat.rocket.android.emoji.internal.EmojiCategory
import
chat.rocket.android.emoji.internal.EmojiCategory
import
chat.rocket.android.emoji.internal.EmojiPagerAdapter
import
chat.rocket.android.emoji.internal.EmojiPagerAdapter
import
chat.rocket.android.emoji.internal.PREF_EMOJI_SKIN_TONE
import
kotlinx.android.synthetic.main.emoji_picker.*
import
kotlinx.android.synthetic.main.emoji_picker.*
class
EmojiPickerPopup
(
context
:
Context
)
:
Dialog
(
context
)
{
class
EmojiPickerPopup
(
context
:
Context
)
:
Dialog
(
context
)
{
var
listener
:
EmojiKeyboardListener
?
=
null
var
listener
:
EmojiKeyboardListener
?
=
null
private
lateinit
var
adapter
:
EmojiPagerAdapter
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
...
@@ -35,7 +40,7 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
...
@@ -35,7 +40,7 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
}
}
private
fun
setupViewPager
()
{
private
fun
setupViewPager
()
{
pager_categories
.
adapter
=
EmojiPagerAdapter
(
object
:
EmojiKeyboardListener
{
adapter
=
EmojiPagerAdapter
(
object
:
EmojiKeyboardListener
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
override
fun
onEmojiAdded
(
emoji
:
Emoji
)
{
EmojiRepository
.
addToRecents
(
emoji
)
EmojiRepository
.
addToRecents
(
emoji
)
dismiss
()
dismiss
()
...
@@ -43,6 +48,14 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
...
@@ -43,6 +48,14 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
}
}
})
})
val
sharedPreferences
=
context
.
getSharedPreferences
(
"emoji"
,
Context
.
MODE_PRIVATE
)
sharedPreferences
.
getString
(
PREF_EMOJI_SKIN_TONE
,
""
)
?.
let
{
changeSkinTone
(
Fitzpatrick
.
valueOf
(
it
))
}
pager_categories
.
adapter
=
adapter
pager_categories
.
offscreenPageLimit
=
EmojiCategory
.
values
().
size
for
(
category
in
EmojiCategory
.
values
())
{
for
(
category
in
EmojiCategory
.
values
())
{
val
tab
=
tabs
.
getTabAt
(
category
.
ordinal
)
val
tab
=
tabs
.
getTabAt
(
category
.
ordinal
)
val
tabView
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
emoji_picker_tab
,
null
)
val
tabView
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
emoji_picker_tab
,
null
)
...
@@ -51,8 +64,15 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
...
@@ -51,8 +64,15 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
textView
.
setImageResource
(
category
.
resourceIcon
())
textView
.
setImageResource
(
category
.
resourceIcon
())
}
}
val
currentTab
=
if
(
EmojiRepository
.
getRecents
().
isEmpty
())
EmojiCategory
.
PEOPLE
.
ordinal
else
val
currentTab
=
if
(
EmojiRepository
.
getRecents
().
isEmpty
())
{
EmojiCategory
.
PEOPLE
.
ordinal
}
else
{
EmojiCategory
.
RECENTS
.
ordinal
EmojiCategory
.
RECENTS
.
ordinal
}
pager_categories
.
currentItem
=
currentTab
pager_categories
.
currentItem
=
currentTab
}
}
private
fun
changeSkinTone
(
tone
:
Fitzpatrick
)
{
adapter
.
setFitzpatrick
(
tone
)
}
}
}
\ 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