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
65ed323a
Commit
65ed323a
authored
Jan 04, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove CustomDividerItemDecoration class inside ChatRoomsFragment file.
parent
ffa4c33d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
34 deletions
+2
-34
ChatRoomsFragment.kt
...ava/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
+2
-34
No files found.
app/src/main/java/chat/rocket/android/chatrooms/ui/ChatRoomsFragment.kt
View file @
65ed323a
package
chat.rocket.android.chatrooms.ui
import
android.content.Context
import
android.graphics.Canvas
import
android.graphics.drawable.Drawable
import
android.os.Bundle
import
android.support.v4.app.Fragment
import
android.support.v7.widget.LinearLayoutManager
import
android.support.v7.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -14,6 +10,7 @@ import android.widget.Toast
import
chat.rocket.android.R
import
chat.rocket.android.chatrooms.presentation.ChatRoomsPresenter
import
chat.rocket.android.chatrooms.presentation.ChatRoomsView
import
chat.rocket.android.widget.DividerItemDecoration
import
chat.rocket.core.model.ChatRoom
import
dagger.android.support.AndroidSupportInjection
import
kotlinx.android.synthetic.main.fragment_chat_rooms.*
...
...
@@ -41,7 +38,7 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
override
fun
showChatRooms
(
dataSet
:
MutableList
<
ChatRoom
>)
{
activity
?.
apply
{
recycler_view
.
layoutManager
=
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
)
recycler_view
.
addItemDecoration
(
Custom
DividerItemDecoration
(
this
,
144
,
32
))
recycler_view
.
addItemDecoration
(
DividerItemDecoration
(
this
,
144
,
32
))
recycler_view
.
adapter
=
ChatRoomsAdapter
(
dataSet
,
this
)
}
}
...
...
@@ -51,33 +48,4 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
override
fun
hideLoading
()
=
view_loading
.
hide
()
override
fun
showMessage
(
message
:
String
)
=
Toast
.
makeText
(
activity
,
message
,
Toast
.
LENGTH_SHORT
).
show
()
}
class
CustomDividerItemDecoration
(
context
:
Context
,
private
var
boundStart
:
Int
=
0
,
private
var
boundRight
:
Int
=
0
)
:
RecyclerView
.
ItemDecoration
()
{
private
val
attrs
=
intArrayOf
(
android
.
R
.
attr
.
listDivider
)
private
var
divider
:
Drawable
init
{
val
styledAttributes
=
context
.
obtainStyledAttributes
(
attrs
)
divider
=
styledAttributes
.
getDrawable
(
0
)
styledAttributes
.
recycle
()
}
override
fun
onDraw
(
c
:
Canvas
,
parent
:
RecyclerView
,
state
:
RecyclerView
.
State
)
{
val
left
=
parent
.
paddingLeft
+
boundStart
val
right
=
(
parent
.
width
-
parent
.
paddingRight
)
-
boundRight
val
childCount
=
parent
.
childCount
for
(
i
in
0
until
childCount
)
{
val
child
=
parent
.
getChildAt
(
i
)
val
params
=
child
.
layoutParams
as
RecyclerView
.
LayoutParams
val
top
=
child
.
bottom
+
params
.
bottomMargin
val
bottom
=
top
+
divider
.
intrinsicHeight
divider
.
setBounds
(
left
,
top
,
right
,
bottom
)
divider
.
draw
(
c
)
}
}
}
\ 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