Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
circles-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Circles
circles-android
Commits
865394cf
Commit
865394cf
authored
1 year ago
by
Taras
Browse files
Options
Downloads
Patches
Plain Diff
Create adapter
parent
a3b33c7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/java/org/futo/circles/core/feature/room/invites/list/InvitesAdapter.kt
+59
-0
59 additions, 0 deletions
.../circles/core/feature/room/invites/list/InvitesAdapter.kt
with
59 additions
and
0 deletions
core/src/main/java/org/futo/circles/core/feature/room/invites/list/InvitesAdapter.kt
0 → 100644
+
59
−
0
View file @
865394cf
package
org.futo.circles.core.feature.room.invites.list
import
android.view.ViewGroup
import
org.futo.circles.core.base.list.BaseRvAdapter
import
org.futo.circles.core.model.InviteListItem
import
org.futo.circles.core.model.InviteTypeArg
class
InvitesAdapter
(
private
val
onInviteClicked
:
(
InviteListItem
,
Boolean
)
->
Unit
,
private
val
onUnblurProfileIconClicked
:
(
InviteListItem
)
->
Unit
)
:
BaseRvAdapter
<
InviteListItem
,
InviteViewHolder
>(
DefaultIdEntityCallback
())
{
override
fun
getItemViewType
(
position
:
Int
):
Int
=
getItem
(
position
).
inviteType
.
ordinal
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
)
=
when
(
InviteTypeArg
.
entries
[
viewType
])
{
InviteTypeArg
.
Circle
->
InvitedCircleViewHolder
(
parent
=
parent
,
onInviteClicked
=
{
position
,
isAccepted
->
onInviteClicked
(
getItem
(
position
),
isAccepted
)
},
onShowProfileIconClicked
=
{
position
->
onUnblurProfileIconClicked
(
getItem
(
position
))
})
InviteTypeArg
.
Group
->
InvitedGroupViewHolder
(
parent
=
parent
,
onInviteClicked
=
{
position
,
isAccepted
->
onInviteClicked
(
getItem
(
position
),
isAccepted
)
},
onShowProfileIconClicked
=
{
position
->
onUnblurProfileIconClicked
(
getItem
(
position
))
})
InviteTypeArg
.
Photo
->
InvitedGalleryViewHolder
(
parent
=
parent
,
onInviteClicked
=
{
position
,
isAccepted
->
onInviteClicked
(
getItem
(
position
),
isAccepted
)
},
onShowProfileIconClicked
=
{
position
->
onUnblurProfileIconClicked
(
getItem
(
position
))
})
InviteTypeArg
.
People
->
FollowRequestViewHolder
(
parent
=
parent
,
onRequestClicked
=
{
position
,
isAccepted
->
onInviteClicked
(
getItem
(
position
),
isAccepted
)
})
}
override
fun
onBindViewHolder
(
holder
:
InviteViewHolder
,
position
:
Int
)
{
holder
.
bind
(
getItem
(
position
))
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment