|
|
@@ -1,8 +1,17 @@
|
|
|
package com.pan_american.android.ui.group_management.department_process
|
|
|
|
|
|
+import android.Manifest
|
|
|
+import android.content.ActivityNotFoundException
|
|
|
import android.content.Intent
|
|
|
+import android.content.pm.PackageManager
|
|
|
import android.graphics.Color
|
|
|
+import android.net.Uri
|
|
|
+import android.os.Build
|
|
|
import android.os.Bundle
|
|
|
+import android.os.Handler
|
|
|
+import android.os.Looper
|
|
|
+import android.provider.OpenableColumns
|
|
|
+import android.provider.Settings
|
|
|
import android.view.Gravity
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
|
@@ -12,6 +21,11 @@ import android.widget.LinearLayout
|
|
|
import android.widget.PopupWindow
|
|
|
import android.widget.RadioButton
|
|
|
import android.widget.TextView
|
|
|
+import androidx.activity.result.ActivityResultLauncher
|
|
|
+import androidx.activity.result.contract.ActivityResultContracts
|
|
|
+import androidx.core.app.ActivityCompat
|
|
|
+import androidx.core.content.ContextCompat
|
|
|
+import androidx.core.content.res.ResourcesCompat
|
|
|
import androidx.core.net.toUri
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
@@ -19,6 +33,7 @@ import com.pan_american.android.OASystem
|
|
|
import com.pan_american.android.R
|
|
|
import com.pan_american.android.base.BaseFragment
|
|
|
import com.pan_american.android.base.BaseResponse
|
|
|
+import com.pan_american.android.base.CardAdapter
|
|
|
import com.pan_american.android.base.CustomAlertDialog
|
|
|
import com.pan_american.android.base.ListAdapter
|
|
|
import com.pan_american.android.data.model.common.entity.FileListItem
|
|
|
@@ -29,6 +44,10 @@ import com.pan_american.android.data.model.group_management.department_process.n
|
|
|
import com.pan_american.android.data.model.group_management.department_process.network.VerifyMissionRequest
|
|
|
import com.pan_american.android.databinding.FragmentMissionProcessHistoryBinding
|
|
|
import com.pan_american.android.util.ScrollEditText
|
|
|
+import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
|
|
+import okhttp3.MultipartBody
|
|
|
+import okhttp3.RequestBody
|
|
|
+import okhttp3.RequestBody.Companion.toRequestBody
|
|
|
import retrofit2.Call
|
|
|
import retrofit2.Callback
|
|
|
import retrofit2.Response
|
|
|
@@ -43,6 +62,21 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
|
|
|
private var receiptList = ArrayList<MissionReceipt>()
|
|
|
|
|
|
+ // Activity Result Launcher for file selection
|
|
|
+ private lateinit var filePickerLauncher: ActivityResultLauncher<Intent>
|
|
|
+
|
|
|
+ // Permission launcher
|
|
|
+ private lateinit var permissionLauncher: ActivityResultLauncher<String>
|
|
|
+
|
|
|
+ // Selected files list
|
|
|
+ private val selectedFilesList = ArrayList<FileListItem>()
|
|
|
+
|
|
|
+ // Annex list RecyclerView reference
|
|
|
+ private lateinit var annexListRecyclerView: RecyclerView
|
|
|
+
|
|
|
+ // Annex list adapter reference
|
|
|
+ private lateinit var annexListAdapter: CardAdapter<FileListItem>
|
|
|
+
|
|
|
override fun getViewBinding(
|
|
|
inflater: LayoutInflater,
|
|
|
container: ViewGroup?,
|
|
|
@@ -58,6 +92,44 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
canProcess = getBoolean("can_process")
|
|
|
}
|
|
|
|
|
|
+ // 注册文件选择器 ActivityResultLauncher(支持多选)
|
|
|
+ filePickerLauncher = registerForActivityResult(
|
|
|
+ ActivityResultContracts.StartActivityForResult()
|
|
|
+ ) { result ->
|
|
|
+ if (result.resultCode == android.app.Activity.RESULT_OK && result.data != null) {
|
|
|
+ // 处理选中的文件(支持多选)
|
|
|
+ val clipData = result.data?.clipData
|
|
|
+ if (clipData != null) {
|
|
|
+ // 多选文件
|
|
|
+ val selectedFiles = mutableListOf<Uri>()
|
|
|
+ for (i in 0 until clipData.itemCount) {
|
|
|
+ val uri = clipData.getItemAt(i).uri
|
|
|
+ selectedFiles.add(uri)
|
|
|
+ }
|
|
|
+ processSelectedFiles(selectedFiles)
|
|
|
+ } else {
|
|
|
+ // 单选文件
|
|
|
+ val selectedFileUri = result.data?.data
|
|
|
+ selectedFileUri?.let { uri ->
|
|
|
+ processSelectedFile(uri)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 注册权限请求 Launcher
|
|
|
+ permissionLauncher = registerForActivityResult(
|
|
|
+ ActivityResultContracts.RequestPermission()
|
|
|
+ ) { isGranted ->
|
|
|
+ if (isGranted) {
|
|
|
+ // 权限被授予,打开文件选择器
|
|
|
+ openFilePicker()
|
|
|
+ } else {
|
|
|
+ // 权限被拒绝,显示提示信息
|
|
|
+ onFileReadPermissionDenied()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
initViews()
|
|
|
initEvents()
|
|
|
}
|
|
|
@@ -90,7 +162,79 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
}
|
|
|
|
|
|
binding.submit.setOnClickListener {
|
|
|
-
|
|
|
+
|
|
|
+ val popView = View.inflate(OASystem.context, R.layout.popup_add_mission_history, null)
|
|
|
+
|
|
|
+ popupWindow = PopupWindow(
|
|
|
+ popView,
|
|
|
+ ViewGroup.LayoutParams.WRAP_CONTENT,
|
|
|
+ ViewGroup.LayoutParams.WRAP_CONTENT
|
|
|
+ )
|
|
|
+
|
|
|
+ showPopupWindow {
|
|
|
+ // 每次打开弹窗时,重置文件列表
|
|
|
+ selectedFilesList.clear()
|
|
|
+
|
|
|
+ val isMissionFinishedYes: RadioButton =
|
|
|
+ popView.findViewById(R.id.is_mission_finished_yes)
|
|
|
+ val isMissionFinishedNo: RadioButton =
|
|
|
+ popView.findViewById(R.id.is_mission_finished_no)
|
|
|
+ val relatedContent: ScrollEditText =
|
|
|
+ popView.findViewById(R.id.related_content_commit)
|
|
|
+ val selectAnnex: TextView = popView.findViewById(R.id.select_annex)
|
|
|
+ val annexList: RecyclerView = popView.findViewById(R.id.annex_list)
|
|
|
+ val cancel: TextView = popView.findViewById(R.id.cancel)
|
|
|
+ val submit: TextView = popView.findViewById(R.id.submit)
|
|
|
+
|
|
|
+ // 保存 annexList 的引用,以便后续更新
|
|
|
+ annexListRecyclerView = annexList
|
|
|
+
|
|
|
+ // 初始化附件列表(初始为空列表)
|
|
|
+ updateAnnexList()
|
|
|
+
|
|
|
+ selectAnnex.setOnClickListener {
|
|
|
+ // 检查文件读取权限
|
|
|
+ checkFileReadPermission()
|
|
|
+ }
|
|
|
+
|
|
|
+ cancel.setOnClickListener {
|
|
|
+ popupWindow.dismiss()
|
|
|
+ }
|
|
|
+
|
|
|
+ submit.setOnClickListener {
|
|
|
+ val requestBody = MultipartBody.Builder().setType(MultipartBody.FORM).apply {
|
|
|
+ addFormDataPart("WorkOrderId", missionId.toString())
|
|
|
+ addFormDataPart("WorkTaskId", stepId.toString())
|
|
|
+ if (isMissionFinishedYes.isChecked) {
|
|
|
+ addFormDataPart("IsCompleted", 1.toString())
|
|
|
+ } else if (isMissionFinishedNo.isChecked) {
|
|
|
+ addFormDataPart("IsCompleted", 0.toString())
|
|
|
+ }
|
|
|
+ addFormDataPart("Content", relatedContent.getText())
|
|
|
+
|
|
|
+ // 使用 requireContext().contentResolver 来读取文件
|
|
|
+ for (item in selectedFilesList) {
|
|
|
+ requireContext().contentResolver.openInputStream(item.uri)
|
|
|
+ ?.use { inputStream ->
|
|
|
+ val content = inputStream.readBytes()
|
|
|
+ val fileRequestBody =
|
|
|
+ content.toRequestBody(
|
|
|
+ "multipart/form-data".toMediaTypeOrNull(),
|
|
|
+ 0,
|
|
|
+ content.size
|
|
|
+ )
|
|
|
+ addFormDataPart("Files", item.fileName, fileRequestBody)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ addFormDataPart("UserId", OASystem.userInfo.userId.toString())
|
|
|
+ }.build()
|
|
|
+
|
|
|
+ uploadMissionReceipt(requestBody)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ popupWindow.showAtLocation(binding.root, Gravity.CENTER, 0, 0)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -145,7 +289,7 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
when (data.isApproved) {
|
|
|
-1 -> {
|
|
|
text = resources.getString(R.string.verify_rejected)
|
|
|
- setTextColor(R.color.color_caution)
|
|
|
+ setTextColor(ResourcesCompat.getColor(resources, R.color.color_caution, null))
|
|
|
}
|
|
|
|
|
|
0 -> {
|
|
|
@@ -207,7 +351,13 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
}
|
|
|
|
|
|
itemView.findViewById<RecyclerView>(R.id.annex_list).apply {
|
|
|
+ // 设置 layoutManager
|
|
|
this.layoutManager = LinearLayoutManager(OASystem.context)
|
|
|
+
|
|
|
+ // 禁用嵌套滚动,避免与外层 RecyclerView 滚动冲突
|
|
|
+ isNestedScrollingEnabled = false
|
|
|
+
|
|
|
+ // 创建 adapter
|
|
|
val listAdapter = ListAdapter.Builder<FileListItem>().apply {
|
|
|
setData(data.files)
|
|
|
setLayoutId(R.layout.item_selector)
|
|
|
@@ -217,6 +367,7 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
}
|
|
|
}.create()
|
|
|
|
|
|
+ // 设置点击事件
|
|
|
listAdapter.onRecyclerViewItemClick =
|
|
|
object : ListAdapter.OnRecyclerViewItemClick {
|
|
|
override fun onItemClick(position: Int) {
|
|
|
@@ -224,7 +375,7 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
setTitle(resources.getString(R.string.hint))
|
|
|
setMessage(
|
|
|
String.format(
|
|
|
- resources.getString(R.string.document_download),
|
|
|
+ resources.getString(R.string.document_file_download_hint),
|
|
|
data.files[position].fileName,
|
|
|
data.files[position].fileName.substringAfter('.')
|
|
|
)
|
|
|
@@ -241,6 +392,9 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
}.show()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 关键:将 adapter 设置到 RecyclerView
|
|
|
+ this.adapter = listAdapter
|
|
|
}
|
|
|
|
|
|
itemView.findViewById<LinearLayout>(R.id.button_group).apply {
|
|
|
@@ -381,4 +535,240 @@ class MissionProcessHistoryFragment : BaseFragment<FragmentMissionProcessHistory
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ // 检查文件读取权限
|
|
|
+ private fun checkFileReadPermission() {
|
|
|
+ // Android 13+ 使用 ACTION_GET_CONTENT 不需要存储权限
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
|
+ // 直接打开文件选择器
|
|
|
+ openFilePicker()
|
|
|
+ } else {
|
|
|
+ // Android 12 及以下需要 READ_EXTERNAL_STORAGE 权限
|
|
|
+ val permission = Manifest.permission.READ_EXTERNAL_STORAGE
|
|
|
+ if (ContextCompat.checkSelfPermission(
|
|
|
+ requireContext(),
|
|
|
+ permission
|
|
|
+ ) == PackageManager.PERMISSION_GRANTED
|
|
|
+ ) {
|
|
|
+ // 已经有权限,打开文件选择器
|
|
|
+ openFilePicker()
|
|
|
+ } else {
|
|
|
+ // 申请文件读取权限
|
|
|
+ permissionLauncher.launch(permission)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 文件读取权限被拒绝后的处理
|
|
|
+ private fun onFileReadPermissionDenied() {
|
|
|
+ // 只在 Android 12 及以下版本需要处理权限拒绝
|
|
|
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
|
|
+ val permission = Manifest.permission.READ_EXTERNAL_STORAGE
|
|
|
+ // 解释为什么需要这个权限
|
|
|
+ if (ActivityCompat.shouldShowRequestPermissionRationale(
|
|
|
+ requireActivity(),
|
|
|
+ permission
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ // 用户拒绝了权限,但没有选择"不再询问"
|
|
|
+ showPermissionExplanationDialog()
|
|
|
+ } else {
|
|
|
+ // 用户拒绝了权限,并选择了"不再询问"
|
|
|
+ showGoToSettingsDialog()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 显示权限解释对话框
|
|
|
+ private fun showPermissionExplanationDialog() {
|
|
|
+ CustomAlertDialog.Builder(requireContext())
|
|
|
+ .setTitle(resources.getString(R.string.need_read_extra_strange))
|
|
|
+ .setMessage(resources.getString(R.string.request_strange_permission))
|
|
|
+ .setPositiveButton(resources.getString(R.string.confirm)) { _, _ ->
|
|
|
+ // 再次请求权限(只在 Android 12 及以下)
|
|
|
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
|
|
+ permissionLauncher.launch(Manifest.permission.READ_EXTERNAL_STORAGE)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .setNegativeButton(resources.getString(R.string.cancel), null)
|
|
|
+ .show()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 显示前往设置对话框
|
|
|
+ private fun showGoToSettingsDialog() {
|
|
|
+ CustomAlertDialog.Builder(requireContext())
|
|
|
+ .setTitle(resources.getString(R.string.need_read_extra_strange))
|
|
|
+ .setMessage(resources.getString(R.string.reject_permission_hint))
|
|
|
+ .setPositiveButton(resources.getString(R.string.go_to_setting)) { _, _ ->
|
|
|
+ // 打开应用设置页面
|
|
|
+ val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
|
|
|
+ val uri = Uri.fromParts("package", requireContext().packageName, null)
|
|
|
+ intent.data = uri
|
|
|
+ startActivity(intent)
|
|
|
+ }
|
|
|
+ .setNegativeButton(resources.getString(R.string.confirm), null)
|
|
|
+ .show()
|
|
|
+ }
|
|
|
+
|
|
|
+ // 打开文件选择器(支持多选)
|
|
|
+ private fun openFilePicker() {
|
|
|
+ val intent = Intent(Intent.ACTION_GET_CONTENT)
|
|
|
+ intent.type = "*/*" // 所有文件类型
|
|
|
+ intent.addCategory(Intent.CATEGORY_OPENABLE)
|
|
|
+ intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true) // 启用多选
|
|
|
+
|
|
|
+ try {
|
|
|
+ filePickerLauncher.launch(Intent.createChooser(intent, "选择文件(可多选)"))
|
|
|
+ } catch (_: ActivityNotFoundException) {
|
|
|
+// Log.e("file_operation", "未找到文件管理器")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理选中的文件(单选)
|
|
|
+ private fun processSelectedFile(fileUri: Uri) {
|
|
|
+ try {
|
|
|
+ val fileName = getFileName(fileUri)
|
|
|
+ val fileItem = FileListItem().apply {
|
|
|
+ this.fileName = fileName
|
|
|
+ this.uri = fileUri // 保存 Uri 对象,用于后续读取文件
|
|
|
+ this.url = fileUri.toString() // 保存 Uri 字符串,用于显示
|
|
|
+ }
|
|
|
+ selectedFilesList.add(fileItem)
|
|
|
+ updateAnnexList()
|
|
|
+ } catch (_: Exception) {
|
|
|
+// Log.e("file_operation", "读取文件失败: ${e.message}")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理选中的多个文件
|
|
|
+ private fun processSelectedFiles(fileUris: List<Uri>) {
|
|
|
+ try {
|
|
|
+ fileUris.forEach { uri ->
|
|
|
+ val fileName = getFileName(uri)
|
|
|
+ val fileItem = FileListItem().apply {
|
|
|
+ this.fileName = fileName
|
|
|
+ this.uri = uri // 保存 Uri 对象,用于后续读取文件
|
|
|
+ this.url = uri.toString() // 保存 Uri 字符串,用于显示
|
|
|
+ }
|
|
|
+ selectedFilesList.add(fileItem)
|
|
|
+ }
|
|
|
+ updateAnnexList()
|
|
|
+ } catch (_: Exception) {
|
|
|
+// Log.e("file_operation", "处理文件失败: ${e.message}")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取文件名
|
|
|
+ private fun getFileName(uri: Uri): String {
|
|
|
+ var fileName = ""
|
|
|
+ val projection = arrayOf(OpenableColumns.DISPLAY_NAME)
|
|
|
+ requireContext().contentResolver.query(uri, projection, null, null, null)?.use { cursor ->
|
|
|
+ if (cursor.moveToFirst()) {
|
|
|
+ val columnIndex = cursor.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME)
|
|
|
+ fileName = cursor.getString(columnIndex)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fileName
|
|
|
+ }
|
|
|
+
|
|
|
+ // 初始化或更新附件列表显示(合并初始化和更新逻辑)
|
|
|
+ private fun updateAnnexList() {
|
|
|
+ // 如果 RecyclerView 还没有初始化,直接返回
|
|
|
+ if (!::annexListRecyclerView.isInitialized) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ val recyclerView = annexListRecyclerView
|
|
|
+
|
|
|
+ // 如果 layoutManager 还没有设置,先设置
|
|
|
+ if (recyclerView.layoutManager == null) {
|
|
|
+ recyclerView.layoutManager = LinearLayoutManager(requireContext())
|
|
|
+ }
|
|
|
+
|
|
|
+ // 创建或更新 adapter
|
|
|
+ annexListAdapter = CardAdapter.Builder<FileListItem>().apply {
|
|
|
+ setData(selectedFilesList)
|
|
|
+ setLayoutId(R.layout.item_delete_button_selector)
|
|
|
+ setCanDelete(true)
|
|
|
+ addBindView { itemView, data ->
|
|
|
+ itemView.findViewById<TextView>(R.id.left_text).text = data.fileName
|
|
|
+ }
|
|
|
+ }.create()
|
|
|
+
|
|
|
+ // 设置删除按钮的点击事件
|
|
|
+ annexListAdapter.onRecyclerViewItemClick = object : CardAdapter.OnRecyclerViewItemClick {
|
|
|
+ override fun onItemClick(position: Int) {
|
|
|
+ // 点击文件项的处理(如果需要)
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onItemDelete(position: Int) {
|
|
|
+ // 删除文件
|
|
|
+ if (position >= 0 && position < selectedFilesList.size) {
|
|
|
+ selectedFilesList.removeAt(position)
|
|
|
+ // 使用 Handler 延迟更新,避免在 RecyclerView 布局过程中更新导致数据不一致
|
|
|
+ Handler(Looper.getMainLooper()).post {
|
|
|
+ updateAnnexList() // 重新更新列表
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ recyclerView.adapter = annexListAdapter
|
|
|
+
|
|
|
+// Log.e("file_operation", "已选择 ${selectedFilesList.size} 个文件")
|
|
|
+// for (file in selectedFilesList) {
|
|
|
+// Log.e("file_operation", "文件: ${file.fileName}")
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun uploadMissionReceipt(requestBody: RequestBody) {
|
|
|
+ OASystem.apiService.uploadMissionReceipt(requestBody)
|
|
|
+ .enqueue(object : Callback<BaseResponse> {
|
|
|
+ override fun onResponse(
|
|
|
+ call: Call<BaseResponse?>,
|
|
|
+ response: Response<BaseResponse?>
|
|
|
+ ) {
|
|
|
+ val uploadResponse = response.body()
|
|
|
+
|
|
|
+ if (uploadResponse != null) {
|
|
|
+
|
|
|
+ if (uploadResponse.code == 200) {
|
|
|
+ showMessage(resources.getString(R.string.upload_success))
|
|
|
+
|
|
|
+ // 1. 关闭 popupWindow
|
|
|
+ popupWindow.dismiss()
|
|
|
+
|
|
|
+ // 2. 清空 RecyclerView 的数据展示(先清空 receiptList,然后重新创建 adapter)
|
|
|
+ receiptList.clear()
|
|
|
+
|
|
|
+ // 重新创建 adapter 并设置空列表,清空显示
|
|
|
+ val emptyAdapter = ListAdapter.Builder<MissionReceipt>().apply {
|
|
|
+ setData(receiptList) // receiptList 已经清空
|
|
|
+ setLayoutId(R.layout.item_mission_receipt)
|
|
|
+ addBindView { _, _ ->
|
|
|
+ // 空实现,因为列表为空,不会调用
|
|
|
+ }
|
|
|
+ }.create()
|
|
|
+ binding.historyList.adapter = emptyAdapter
|
|
|
+
|
|
|
+ // 3. 执行 getMissionProcessHistory() 重新获取数据
|
|
|
+ getMissionProcessHistory()
|
|
|
+
|
|
|
+ } else {
|
|
|
+ showMessage(resources.getString(R.string.upload_failed))
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ showErrorInfo(R.string.interface_request_error)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun onFailure(
|
|
|
+ call: Call<BaseResponse?>,
|
|
|
+ t: Throwable
|
|
|
+ ) {
|
|
|
+ showErrorInfo(R.string.network_error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|