Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BinService.instance.postWorkingReportList(SharePref.getInstance().getToken(activity)
- ?: "", currentPage, dateFormatter?.format(fromCalendar?.time)?:"", dateFormatter?.format(toCalendar?.time) ?: "", currentCustomerId?:"","", object : BinService.OnListServiceBaseListener<ArrayList<WorkingReportBean>> {
- override fun onSuccess(record: ArrayList<WorkingReportBean>?, message: String?, code: Int) {
- }
- override fun onSuccess(record: ArrayList<WorkingReportBean>?, message: String?, code: Int, totalPage1: Int, totalItem: Int) {
- if (isDestroyedView || tv_nodata_found == null) {
- // Ignore when view destroyed
- return
- }
- record?.let {
- try {
- totalPage = totalPage1 ?: -1
- if (totalPage == 0) {
- listWorkingReport.clear()
- }
- tv_nodata_found.visibility = View.VISIBLE
- if (it.size > 0) {
- listWorkingReport.addAll(it)
- currentPage++
- tv_nodata_found.visibility = View.GONE
- } else {
- listWorkingReport.clear()// Anh Dung add Now 22, 2015
- }
- adapter?.notifyDataSetChanged()
- } catch (e: Exception) {
- BaseActivity.handleException(e)
- }
- }
- isRequesting = false
- parentActivity.showLoadingView(false)
- }
- override fun onError(exception: BinService.BinServiceException) {
- BaseActivity.handleException(exception)
- }
- override fun onFinished(isSuccess: Boolean) {
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement