Advertisement
Guest User

Untitled

a guest
May 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. BinService.instance.postWorkingReportList(SharePref.getInstance().getToken(activity)
  2. ?: "", currentPage, dateFormatter?.format(fromCalendar?.time)?:"", dateFormatter?.format(toCalendar?.time) ?: "", currentCustomerId?:"","", object : BinService.OnListServiceBaseListener<ArrayList<WorkingReportBean>> {
  3. override fun onSuccess(record: ArrayList<WorkingReportBean>?, message: String?, code: Int) {
  4.  
  5. }
  6. override fun onSuccess(record: ArrayList<WorkingReportBean>?, message: String?, code: Int, totalPage1: Int, totalItem: Int) {
  7. if (isDestroyedView || tv_nodata_found == null) {
  8. // Ignore when view destroyed
  9. return
  10. }
  11. record?.let {
  12. try {
  13. totalPage = totalPage1 ?: -1
  14. if (totalPage == 0) {
  15. listWorkingReport.clear()
  16. }
  17. tv_nodata_found.visibility = View.VISIBLE
  18.  
  19. if (it.size > 0) {
  20. listWorkingReport.addAll(it)
  21. currentPage++
  22. tv_nodata_found.visibility = View.GONE
  23. } else {
  24. listWorkingReport.clear()// Anh Dung add Now 22, 2015
  25. }
  26. adapter?.notifyDataSetChanged()
  27.  
  28. } catch (e: Exception) {
  29. BaseActivity.handleException(e)
  30. }
  31. }
  32. isRequesting = false
  33. parentActivity.showLoadingView(false)
  34. }
  35.  
  36. override fun onError(exception: BinService.BinServiceException) {
  37. BaseActivity.handleException(exception)
  38. }
  39.  
  40. override fun onFinished(isSuccess: Boolean) {
  41.  
  42. }
  43.  
  44. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement