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
63243b18
Unverified
Commit
63243b18
authored
Mar 27, 2018
by
Rafael Kellermann Streit
Committed by
GitHub
Mar 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop-2.x' into feature/migration
parents
4bfb9b10
5505e764
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
0 deletions
+22
-0
CategoryPagerAdapter.kt
.../chat/rocket/android/widget/emoji/CategoryPagerAdapter.kt
+8
-0
emoji_category_layout.xml
app/src/main/res/layout/emoji_category_layout.xml
+10
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/src/main/java/chat/rocket/android/widget/emoji/CategoryPagerAdapter.kt
View file @
63243b18
...
@@ -9,6 +9,7 @@ import android.view.View
...
@@ -9,6 +9,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.TextView
import
android.widget.TextView
import
chat.rocket.android.R
import
chat.rocket.android.R
import
chat.rocket.android.util.extensions.setVisible
import
java.util.*
import
java.util.*
class
CategoryPagerAdapter
(
val
listener
:
EmojiKeyboardListener
)
:
PagerAdapter
()
{
class
CategoryPagerAdapter
(
val
listener
:
EmojiKeyboardListener
)
:
PagerAdapter
()
{
...
@@ -24,11 +25,18 @@ class CategoryPagerAdapter(val listener: EmojiKeyboardListener) : PagerAdapter()
...
@@ -24,11 +25,18 @@ class CategoryPagerAdapter(val listener: EmojiKeyboardListener) : PagerAdapter()
val
recycler
=
view
.
findViewById
(
R
.
id
.
emojiRecyclerView
)
as
RecyclerView
val
recycler
=
view
.
findViewById
(
R
.
id
.
emojiRecyclerView
)
as
RecyclerView
val
adapter
=
EmojiAdapter
(
layoutManager
.
spanCount
,
listener
)
val
adapter
=
EmojiAdapter
(
layoutManager
.
spanCount
,
listener
)
val
category
=
EmojiCategory
.
values
().
get
(
position
)
val
category
=
EmojiCategory
.
values
().
get
(
position
)
val
emojiNoRecentText
:
TextView
=
view
.
findViewById
(
R
.
id
.
text_no_recent_emoji
)
val
emojis
=
if
(
category
!=
EmojiCategory
.
RECENTS
)
{
val
emojis
=
if
(
category
!=
EmojiCategory
.
RECENTS
)
{
EmojiRepository
.
getEmojisByCategory
(
category
)
EmojiRepository
.
getEmojisByCategory
(
category
)
}
else
{
}
else
{
EmojiRepository
.
getRecents
()
EmojiRepository
.
getRecents
()
}
}
val
recentEmojiSize
=
EmojiRepository
.
getRecents
().
size
if
(
category
==
EmojiCategory
.
RECENTS
&&
recentEmojiSize
==
0
){
emojiNoRecentText
.
setVisible
(
true
)
}
else
{
emojiNoRecentText
.
setVisible
(
false
)
}
adapter
.
addEmojis
(
emojis
)
adapter
.
addEmojis
(
emojis
)
recycler
.
layoutManager
=
layoutManager
recycler
.
layoutManager
=
layoutManager
recycler
.
itemAnimator
=
DefaultItemAnimator
()
recycler
.
itemAnimator
=
DefaultItemAnimator
()
...
...
app/src/main/res/layout/emoji_category_layout.xml
View file @
63243b18
...
@@ -15,4 +15,14 @@
...
@@ -15,4 +15,14 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/text_no_recent_emoji"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/msg_no_recent_emoji"
android:layout_gravity=
"center"
android:elevation=
"10dp"
android:textSize=
"16sp"
android:visibility=
"gone"
/>
</android.support.design.widget.CoordinatorLayout>
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
app/src/main/res/values-pt-rBR/strings.xml
View file @
63243b18
...
@@ -139,4 +139,6 @@
...
@@ -139,4 +139,6 @@
<string
name=
"Guggy_Command_Description"
>
Gera um gif baseado no texto dado
</string>
<string
name=
"Guggy_Command_Description"
>
Gera um gif baseado no texto dado
</string>
<string
name=
"Slash_Topic_Description"
>
Definir tópico
</string>
<string
name=
"Slash_Topic_Description"
>
Definir tópico
</string>
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
Nenhum emoji recente
</string>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
63243b18
...
@@ -140,4 +140,6 @@
...
@@ -140,4 +140,6 @@
<string
name=
"Guggy_Command_Description"
>
Generates a gif based upon the provided text
</string>
<string
name=
"Guggy_Command_Description"
>
Generates a gif based upon the provided text
</string>
<string
name=
"Slash_Topic_Description"
>
Set topic
</string>
<string
name=
"Slash_Topic_Description"
>
Set topic
</string>
<!-- Emoji message-->
<string
name=
"msg_no_recent_emoji"
>
No recent emoji
</string>
</resources>
</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