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
f5a9ad41
Commit
f5a9ad41
authored
Jul 06, 2018
by
shubhsherl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change in layout and Fragment as requested
parent
464896d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
22 deletions
+17
-22
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+6
-6
round_textview.xml
app/src/main/res/drawable/round_textview.xml
+6
-6
message_list.xml
app/src/main/res/layout/message_list.xml
+5
-10
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
f5a9ad41
...
...
@@ -426,13 +426,13 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
private
val
fabScrollListener
=
object
:
RecyclerView
.
OnScrollListener
()
{
override
fun
onScrolled
(
recyclerView
:
RecyclerView
,
dx
:
Int
,
dy
:
Int
)
{
if
(!
recyclerView
.
canScrollVertically
(
1
))
{
text_count
.
visibility
=
View
.
INVISIBLE
text_count
.
isVisible
=
false
button_fab
.
hide
()
newMessageCount
=
0
}
else
{
if
(
dy
<
0
&&
!
button_fab
.
isVisible
)
{
button_fab
.
show
()
if
(
newMessageCount
!=
0
)
text_count
.
visibility
=
View
.
VISIBLE
if
(
newMessageCount
!=
0
)
text_count
.
isVisible
=
true
}
}
}
...
...
@@ -493,7 +493,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
override
fun
showNewMessage
(
message
:
List
<
BaseUiModel
<*
>>,
isMessageReceived
:
Boolean
)
{
ui
{
adapter
.
prependData
(
message
)
if
(
isMessageReceived
&&
button_fab
.
visibility
==
View
.
VISIBLE
)
{
if
(
isMessageReceived
&&
button_fab
.
isVisible
)
{
newMessageCount
++
if
(
newMessageCount
<=
99
)
...
...
@@ -501,9 +501,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
else
text_count
.
text
=
"99+"
text_count
.
visibility
=
View
.
VISIBLE
text_count
.
isVisible
=
true
}
else
if
(
button_fab
.
visibility
==
View
.
GONE
)
else
if
(
!
button_fab
.
isVisible
)
recycler_view
.
scrollToPosition
(
0
)
verticalScrollOffset
.
set
(
0
)
empty_chat_view
.
isVisible
=
adapter
.
itemCount
==
0
...
...
@@ -739,7 +739,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
button_fab
.
setOnClickListener
{
recycler_view
.
scrollToPosition
(
0
)
verticalScrollOffset
.
set
(
0
)
text_count
.
visibility
=
View
.
INVISIBLE
text_count
.
isVisible
=
false
button_fab
.
hide
()
newMessageCount
=
0
}
...
...
app/src/main/res/drawable/round_textview.xml
View file @
f5a9ad41
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
android:shape=
"oval"
>
<solid
android:color=
"#30a7fe
"
/>
<solid
android:color=
"@color/colorAccent
"
/>
<size
android:height
=
"20dp"
android:width
=
"20dp"
/>
<size
android:width
=
"20dp"
android:height
=
"20dp"
/>
</shape>
\ No newline at end of file
</shape>
\ No newline at end of file
app/src/main/res/layout/message_list.xml
View file @
f5a9ad41
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_view"
...
...
@@ -11,15 +10,13 @@
android:layout_height=
"match_parent"
android:scrollbars=
"vertical"
/>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_alignParentBottom=
"true"
app:layout_anchor=
"@id/recycler_view"
app:layout_anchorGravity=
"bottom|end"
>
app:layout_anchorGravity=
"bottom|end"
>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/button_fab"
...
...
@@ -34,7 +31,6 @@
app:backgroundTint=
"@color/colorWhite"
app:fabSize=
"mini"
/>
<TextView
android:id=
"@+id/text_count"
android:layout_width=
"wrap_content"
...
...
@@ -45,10 +41,9 @@
android:layout_margin=
"10dp"
android:textColor=
"@color/colorWhite"
android:visibility=
"invisible"
android:layout_alignParent
Right
=
"true"
android:layout_alignParent
End
=
"true"
android:textSize=
"@dimen/message_time_text_size"
android:background=
"@drawable/round_textview"
/>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ 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