Bring back Swipe refresh

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2020-01-21 00:25:10 +01:00
parent 95d548f941
commit 7a24b111a0
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0
2 changed files with 10 additions and 4 deletions

View File

@ -27,7 +27,6 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.lifecycle.observe
import butterknife.OnClick
import com.afollestad.materialdialogs.LayoutMode
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.bottomsheets.BottomSheet
@ -95,12 +94,12 @@ class ConversationsListView : BaseView() {
view.apply {
recyclerView.initRecyclerView(SmoothScrollLinearLayoutManager(activity), adapter, false)
/*swipeRefreshLayoutView.setOnRefreshListener {
swipeRefreshLayoutView.setOnRefreshListener {
view.swipeRefreshLayoutView.isRefreshing = false
viewModel.loadConversations()
}
swipeRefreshLayoutView.setColorSchemeResources(R.color.colorPrimary)*/
swipeRefreshLayoutView.setColorSchemeResources(R.color.colorPrimary)
}
activity?.inputEditText?.addTextChangedListener(DebouncingTextWatcher(lifecycle, ::setSearchQuery))

View File

@ -25,12 +25,19 @@
android:layout_height="match_parent"
android:animateLayoutChanges="true">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayoutView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="64dp"
android:layout_height="match_parent"
tools:listitem="@layout/rv_item_conversation_with_last_message" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>