Commit 117ed7de authored by Konstantin Tskhovrebov's avatar Konstantin Tskhovrebov 🤖

added refresh for mr notes list

parent 02125872
......@@ -29,6 +29,10 @@ class MergeRequestNotesPresenter @Inject constructor(
override fun onFirstViewAttach() {
super.onFirstViewAttach()
requestNotes()
}
private fun requestNotes() {
mrInteractor.getMergeRequestNotes(projectId, mrId)
.toObservable()
.flatMapIterable { it }
......@@ -46,4 +50,6 @@ class MergeRequestNotesPresenter @Inject constructor(
)
.connect()
}
fun refresh() = requestNotes()
}
\ No newline at end of file
......@@ -7,7 +7,6 @@ import com.arellomobile.mvp.presenter.ProvidePresenter
import com.hannesdorfmann.adapterdelegates3.ListDelegationAdapter
import kotlinx.android.synthetic.main.layout_base_list.*
import ru.terrakok.gitlabclient.R
import ru.terrakok.gitlabclient.extension.visible
import ru.terrakok.gitlabclient.presentation.global.NoteWithFormattedBody
import ru.terrakok.gitlabclient.presentation.mergerequest.notes.MergeRequestNotesPresenter
import ru.terrakok.gitlabclient.presentation.mergerequest.notes.MergeRequestNotesView
......@@ -43,6 +42,8 @@ class MergeRequestNotesFragment : BaseFragment(), MergeRequestNotesView {
addItemDecoration(SimpleDividerDecorator(context))
adapter = this@MergeRequestNotesFragment.adapter
}
swipeToRefresh.setOnRefreshListener { presenter.refresh() }
}
override fun showNotes(notes: List<NoteWithFormattedBody>) {
......@@ -50,7 +51,7 @@ class MergeRequestNotesFragment : BaseFragment(), MergeRequestNotesView {
}
override fun showProgress(show: Boolean) {
fullscreenProgressView.visible(show)
swipeToRefresh.isRefreshing = show
}
override fun showMessage(message: String) {
......
......@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha02'
classpath 'com.android.tools.build:gradle:3.2.0-alpha03'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment