made list refresh working

This commit is contained in:
Mariotaku Lee 2017-04-06 19:37:21 +08:00
parent 3180a9c516
commit 399494ec5b
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 11 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import android.support.v7.widget.RecyclerView
import android.view.KeyEvent
import com.bumptech.glide.Glide
import kotlinx.android.synthetic.main.fragment_content_recyclerview.*
import org.mariotaku.ktextension.set
import org.mariotaku.twidere.adapter.ParcelableUserListsAdapter
import org.mariotaku.twidere.adapter.iface.ILoadMoreSupportAdapter
import org.mariotaku.twidere.adapter.iface.ILoadMoreSupportAdapter.IndicatorPosition
@ -160,5 +161,15 @@ abstract class ParcelableUserListsFragment : AbsContentListRecyclerViewFragment<
return true
}
override fun triggerRefresh(): Boolean {
adapter.setData(null)
val loaderArgs = Bundle(arguments).apply {
this[EXTRA_FROM_USER] = true
}
loaderManager.restartLoader(0, loaderArgs, this)
showProgress()
return true
}
protected abstract fun onCreateUserListsLoader(context: Context, args: Bundle, fromUser: Boolean): Loader<List<ParcelableUserList>>
}