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
421106c4
Commit
421106c4
authored
Aug 31, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some layout fine-grain adjustments on the emoji picker
parent
8c7da0f8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
22 deletions
+21
-22
EmojiKeyboardPopup.kt
...main/java/chat/rocket/android/emoji/EmojiKeyboardPopup.kt
+4
-1
EmojiPickerPopup.kt
...c/main/java/chat/rocket/android/emoji/EmojiPickerPopup.kt
+6
-4
OverKeyboardPopupWindow.kt
...java/chat/rocket/android/emoji/OverKeyboardPopupWindow.kt
+1
-4
EmojiPagerAdapter.kt
...a/chat/rocket/android/emoji/internal/EmojiPagerAdapter.kt
+3
-2
emoji_category_layout.xml
emoji/src/main/res/layout/emoji_category_layout.xml
+4
-6
emoji_picker.xml
emoji/src/main/res/layout/emoji_picker.xml
+1
-3
emoji_row_item.xml
emoji/src/main/res/layout/emoji_row_item.xml
+2
-2
No files found.
emoji/src/main/java/chat/rocket/android/emoji/EmojiKeyboardPopup.kt
View file @
421106c4
...
...
@@ -139,9 +139,11 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
@ColorInt
private
fun
getFitzpatrickColor
(
tone
:
Fitzpatrick
):
Int
{
val
sharedPreferences
=
context
.
getSharedPreferences
(
"emoji"
,
Context
.
MODE_PRIVATE
)
sharedPreferences
.
edit
{
putString
(
PREF_EMOJI_SKIN_TONE
,
tone
.
type
)
}
return
when
(
tone
)
{
Fitzpatrick
.
Default
->
ContextCompat
.
getColor
(
context
,
R
.
color
.
tone_default
)
Fitzpatrick
.
LightTone
->
ContextCompat
.
getColor
(
context
,
R
.
color
.
tone_light
)
...
...
@@ -194,6 +196,7 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
}
class
EmojiTextWatcher
(
private
val
editor
:
EditText
)
:
TextWatcher
{
@Volatile
private
var
emojiToRemove
=
mutableListOf
<
EmojiTypefaceSpan
>()
...
...
@@ -237,4 +240,4 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
override
fun
onTextChanged
(
s
:
CharSequence
,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
}
}
}
\ No newline at end of file
}
emoji/src/main/java/chat/rocket/android/emoji/EmojiPickerPopup.kt
View file @
421106c4
...
...
@@ -37,10 +37,12 @@ class EmojiPickerPopup(context: Context) : Dialog(context) {
private
fun
setSize
()
{
val
lp
=
WindowManager
.
LayoutParams
()
lp
.
copyFrom
(
window
.
attributes
)
val
dialogWidth
=
lp
.
width
val
dialogHeight
=
context
.
resources
.
getDimensionPixelSize
(
R
.
dimen
.
picker_popup_height
)
window
.
setLayout
(
dialogWidth
,
dialogHeight
)
window
?.
let
{
lp
.
copyFrom
(
it
.
attributes
)
val
dialogWidth
=
lp
.
width
val
dialogHeight
=
context
.
resources
.
getDimensionPixelSize
(
R
.
dimen
.
picker_popup_height
)
it
.
setLayout
(
dialogWidth
,
dialogHeight
)
}
}
private
suspend
fun
setupViewPager
()
{
...
...
emoji/src/main/java/chat/rocket/android/emoji/OverKeyboardPopupWindow.kt
View file @
421106c4
...
...
@@ -57,9 +57,6 @@ abstract class OverKeyboardPopupWindow(
init
{
setBackgroundDrawable
(
null
)
if
(
BuildConfig
.
VERSION_CODE
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
elevation
=
0f
}
val
view
=
onCreateView
(
LayoutInflater
.
from
(
context
))
onViewCreated
(
view
)
contentView
=
view
...
...
@@ -89,7 +86,7 @@ abstract class OverKeyboardPopupWindow(
/**
* Call this function to resize the emoji popup according to your soft keyboard size
*/
fun
setSizeForSoftKeyboard
()
{
private
fun
setSizeForSoftKeyboard
()
{
val
viewTreeObserver
=
rootView
.
viewTreeObserver
viewTreeObserver
.
addOnGlobalLayoutListener
(
this
)
}
...
...
emoji/src/main/java/chat/rocket/android/emoji/internal/EmojiPagerAdapter.kt
View file @
421106c4
...
...
@@ -147,10 +147,11 @@ internal class EmojiPagerAdapter(private val listener: EmojiKeyboardListener) :
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
EmojiRowViewHolder
{
val
inflater
=
LayoutInflater
.
from
(
parent
.
context
)
val
view
=
if
(
viewType
==
CUSTOM
)
{
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
emoji_image_row_item
,
parent
,
false
)
inflater
.
inflate
(
R
.
layout
.
emoji_image_row_item
,
parent
,
false
)
}
else
{
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
emoji_row_item
,
parent
,
false
)
inflater
.
inflate
(
R
.
layout
.
emoji_row_item
,
parent
,
false
)
}
return
EmojiRowViewHolder
(
view
,
listener
)
}
...
...
emoji/src/main/res/layout/emoji_category_layout.xml
View file @
421106c4
...
...
@@ -6,18 +6,16 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/emoji_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginEnd=
"8dp"
android:layout_marginStart=
"8dp"
/>
android:layout_height=
"match_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:text=
"@string/msg_no_recent_emoji"
android:textSize=
"16sp"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
</androidx.coordinatorlayout.widget.CoordinatorLayout>
emoji/src/main/res/layout/emoji_picker.xml
View file @
421106c4
...
...
@@ -20,8 +20,6 @@
android:id=
"@+id/pager_categories"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginEnd=
"8dp"
android:layout_marginStart=
"8dp"
android:background=
"@color/colorWhite"
/>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
emoji/src/main/res/layout/emoji_row_item.xml
View file @
421106c4
...
...
@@ -2,11 +2,11 @@
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/emoji_view"
style=
"@style/TextAppearance.AppCompat.Title"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:foreground=
"?selectableItemBackground"
android:layout_gravity=
"center"
android:gravity=
"center"
android:textColor=
"#000000"
android:textSize=
"2
6
sp"
android:textSize=
"2
4
sp"
tools:text=
"😀"
/>
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