diff --git a/app/src/main/java/com/futo/circles/feature/group_invite/InviteMembersDialogFragment.kt b/app/src/main/java/com/futo/circles/feature/group_invite/InviteMembersDialogFragment.kt index 0cbede081c8aae10502f613df3d074e5603fd442..22853086f350afbbfb8354cc1e0a4910c1adfce1 100644 --- a/app/src/main/java/com/futo/circles/feature/group_invite/InviteMembersDialogFragment.kt +++ b/app/src/main/java/com/futo/circles/feature/group_invite/InviteMembersDialogFragment.kt @@ -7,6 +7,8 @@ import com.futo.circles.R import com.futo.circles.base.BaseFullscreenDialogFragment import com.futo.circles.databinding.InviteMembersDialogFragmentBinding import com.futo.circles.extensions.observeData +import com.futo.circles.feature.group_invite.list.InviteMembersListAdapter +import com.futo.circles.model.RoomMemberListItem import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.core.parameter.parametersOf @@ -17,6 +19,8 @@ class InviteMembersDialogFragment : private val args: InviteMembersDialogFragmentArgs by navArgs() private val viewModel by viewModel<InviteMembersViewModel> { parametersOf(args.roomId) } + private val listAdapter by lazy { InviteMembersListAdapter() } + private val binding by lazy { getBinding() as InviteMembersDialogFragmentBinding } @@ -30,6 +34,7 @@ class InviteMembersDialogFragment : override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) binding.toolbar.setNavigationOnClickListener { activity?.onBackPressed() } + binding.rvUsers.adapter = listAdapter setupObservers() } @@ -39,4 +44,8 @@ class InviteMembersDialogFragment : } } + private fun setUserList(users: List<RoomMemberListItem>) { + listAdapter.submitList(users) + } + } \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_border.xml b/app/src/main/res/drawable/bg_border.xml new file mode 100644 index 0000000000000000000000000000000000000000..85ac63c58bca7468f70b9d55e1fc4332038726e5 --- /dev/null +++ b/app/src/main/res/drawable/bg_border.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <corners android:radius="5dp" /> + <stroke + android:width="1dp" + android:color="@color/gray" /> +</shape> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_search.xml b/app/src/main/res/drawable/ic_search.xml deleted file mode 100644 index e2dd96c6d09e7ae715cc7c53558ac33f3a490613..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_search.xml +++ /dev/null @@ -1,5 +0,0 @@ -<vector android:height="24dp" android:tint="#FFFFFF" - android:viewportHeight="24" android:viewportWidth="24" - android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> - <path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> -</vector> diff --git a/app/src/main/res/layout/invite_member_list_item.xml b/app/src/main/res/layout/invite_member_list_item.xml new file mode 100644 index 0000000000000000000000000000000000000000..132aefc28e127e3cd8d9bb6581c7b6d158f0a81e --- /dev/null +++ b/app/src/main/res/layout/invite_member_list_item.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content"> + + <TextView + android:id="@+id/tvText" + android:layout_width="0dp" + android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/invite_members_dialog_fragment.xml b/app/src/main/res/layout/invite_members_dialog_fragment.xml index 9fd0e0819d6389fa255baeef8123bae69ed6897a..6f4c00da1b9a0bf44e754b8a1f42f655f3e86256 100644 --- a/app/src/main/res/layout/invite_members_dialog_fragment.xml +++ b/app/src/main/res/layout/invite_members_dialog_fragment.xml @@ -24,27 +24,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/toolbar" /> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/tilSearch" - style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" + <androidx.appcompat.widget.SearchView + android:id="@+id/searchView" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="8dp" - app:startIconDrawable="@drawable/ic_search" - android:hint="@string/search_by_name_or_id" + android:background="@drawable/bg_border" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/toolbarDivider"> + app:layout_constraintTop_toBottomOf="@id/toolbarDivider" + app:queryHint="@string/search_by_name_or_id" /> - <com.google.android.material.textfield.TextInputEditText - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:imeOptions="actionDone" - android:inputType="text" - android:maxLines="1" - android:padding="12dp" /> - - </com.google.android.material.textfield.TextInputLayout> <androidx.recyclerview.widget.RecyclerView android:id="@+id/rvUsers" @@ -55,7 +45,7 @@ app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@id/tilSearch" /> + app:layout_constraintTop_toBottomOf="@id/searchView" /> </androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file