1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
package cn.flightfeather.thirdappmodule.module.inspectioninfo
 
import android.app.Dialog
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Matrix
import android.os.Build
import android.os.Bundle
import android.os.Environment
import android.support.annotation.RequiresApi
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.transition.Explode
import android.view.View
import android.widget.ImageView
import android.widget.Toast
import butterknife.ButterKnife
import butterknife.Unbinder
import cn.flightfeather.thirdappmodule.CommonApplication
import cn.flightfeather.thirdappmodule.R
import cn.flightfeather.thirdappmodule.activity.PhotoViewerActivity
import cn.flightfeather.thirdappmodule.bean.entity.Mediafile
import cn.flightfeather.thirdappmodule.bean.vo.MediafileVo
import cn.flightfeather.thirdappmodule.bean.vo.ProblemlistVo
import cn.flightfeather.thirdappmodule.httpservice.ProblemListService
import cn.flightfeather.thirdappmodule.module.base.BaseTakePicActivity
import cn.flightfeather.thirdappmodule.util.*
import cn.flightfeather.thirdappmodule.util.file.FileUtil
import cn.flightfeather.thirdappmodule.util.photo.OnUpLoadListener
import cn.flightfeather.thirdappmodule.util.photo.PhotoUtil
import com.amap.api.maps.CameraUpdateFactory
import com.amap.api.maps.model.BitmapDescriptorFactory
import com.amap.api.maps.model.LatLng
import com.amap.api.maps.model.MarkerOptions
import com.ping.greendao.gen.MediafileDao
import kotlinx.android.synthetic.main.activity_problem_change_detail.*
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import java.io.File
import java.io.IOException
import java.io.Serializable
import java.util.*
 
class ProblemChangeDetailActivity : AppCompatActivity() {
    //展示的问题对象
    private var problemlistVo = ProblemlistVo()
 
    /**
     * 两种问题类型 [Constant.CHANGED]和[Constant.UNCHANGED]
     */
    private var problemType = ""
 
    //内部数据类,前一个context传入一些不变的展示数据
    private var textData = TextData()
 
    //requestCode
    private val TAKE_PROBLEM_PHOTO = 13
    private val TAKE_CHANGE_PHOTO = 14
    private val PICK_PROBLEM_PHOTO = 15
    private val PICK_CHANGE_PHOTO = 16
    private var application: CommonApplication? = null
    private var mediafileDao: MediafileDao? = null
 
    //是否已编辑过
    private var isEdited = false
    private var unbinder: Unbinder? = null
 
    //</editor-fold>
 
    //<editor-fold desc="内部数据类">
    class TextData : Serializable {
        //离整改承诺期限剩余或逾期多少天
        var text_deadline_status = ""
        var text_remaining_days = ""
 
        //是否承诺整改
        var text_promise = ""
        var text_promise_selected = false
 
        //截止日期
        var text_change_deadline = ""
        var change_deadline_visible = 0
 
        //超时整改天数
        var cl_deadline_visible = 0
 
        constructor() {}
        constructor(text_deadline_status: String, text_remaining_days: String, text_promise: String, text_promise_selected: Boolean, text_change_deadline: String, change_deadline_visible: Int, cl_deadline_visible: Int) {
            this.text_deadline_status = text_deadline_status
            this.text_remaining_days = text_remaining_days
            this.text_promise = text_promise
            this.text_promise_selected = text_promise_selected
            this.text_change_deadline = text_change_deadline
            this.change_deadline_visible = change_deadline_visible
            this.cl_deadline_visible = cl_deadline_visible
        }
    }
 
    //</editor-fold>
 
    //<editor-fold desc="lifecycle">
    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //设置允许使用转场动画
        window.enterTransition = Explode().setDuration(500)
        window.exitTransition = Explode().setDuration(300)
        setContentView(R.layout.activity_problem_change_detail)
        unbinder = ButterKnife.bind(this)
        application = getApplication() as CommonApplication
        initParam()
        updateMediafile()
        initView()
        initProblemPhoto(mediafileListProblem, imageViewProblemList)
        initChangingPhoto(mediafileListChange, imageViewChangeList)
        initMap(savedInstanceState)
        initClickListener()
    }
 
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if (requestCode == TAKE_CHANGE_PHOTO) {
            if (resultCode == RESULT_OK && fileCurrent != null && !mediafileListProblem.isEmpty()) {
                val mediafile = MediafileVo.newMediaFile(fileCurrent, true, mediafileListProblem[0])
                mediafileListChange.add(mediafile)
                mediafileDao!!.insert(mediafile)
                isEdited = true
                initChangingPhoto(mediafileListChange, imageViewChangeList)
            }
        } else if (requestCode == PICK_CHANGE_PHOTO) {
            if (resultCode == RESULT_OK) {
                val paths: List<String> = data!!.getStringArrayListExtra(BaseTakePicActivity.EXTRA_SELECT_IMAGES)
                for (p in paths) {
                    val oldFile = File(p)
                    val newFile = filePath
                    try {
                        FileUtil.copyFile(oldFile, newFile)
                        if (!mediafileListProblem.isEmpty()) {
                            val mediafile = MediafileVo.newMediaFile(newFile, true, mediafileListProblem[0])
                            mediafileListChange.add(mediafile)
                            mediafileDao!!.insert(mediafile)
                            isEdited = true
                        }
                    } catch (e: IOException) {
                        e.printStackTrace()
                    }
                }
                initChangingPhoto(mediafileListChange, imageViewChangeList)
                if (problemlistVo.ischanged) {
                    refreshSaveBtn(3)
                }
            }
        } else if (requestCode == PhotoViewerActivity.CHANGE_PHOTO && resultCode == RESULT_OK) {
            if (data != null) {
                val position = data.getIntExtra("position", -1)
                if (position > -1) {
                    mediafileDao!!.deleteByKey(mediafileListChange[position].guid)
                    mediafileListChange.removeAt(position)
                    //fixme 2020/11/12 由于删除单张图片是直接联网将服务器数据一并删除,因此当图片全部删除后,立即更新问题为未整改状态
                    if (mediafileListChange.isEmpty()) {
                        uploadProblem()
                    }
                    isEdited = !mediafileListChange.isEmpty()
                    initChangingPhoto(mediafileListChange, imageViewChangeList)
                    if (problemlistVo.ischanged) {
                        refreshSaveBtn(3)
                    }
                }
            }
        }
    }
 
    override fun onDestroy() {
        super.onDestroy()
        if (unbinder != null) {
            unbinder!!.unbind()
        }
    }
 
    //</editor-fold>
 
    //<editor-fold desc="初始化图片">
 
    var imageViewProblemList = mutableListOf<ImageView>()
    var imageViewChangeList = mutableListOf<ImageView>()
 
    private fun initParam() {
        val bundle = intent.extras
        if (bundle != null) {
            problemlistVo = bundle.getSerializable(ARG_PROBLEM) as ProblemlistVo
            problemType = bundle.getString(ARG_PROBLEM_TYPE)
            textData = bundle.getSerializable(ARG_TEXT_DATA) as TextData
        }
        mediafileDao = application!!.daoSession.mediafileDao
        imageViewProblemList.add(iv_problem_photo1)
        imageViewProblemList.add(iv_problem_photo2)
        imageViewProblemList.add(iv_problem_photo3)
        imageViewChangeList.add(iv_problem_change_photo1)
        imageViewChangeList.add(iv_problem_change_photo2)
        imageViewChangeList.add(iv_problem_change_photo3)
    }
 
    //</editor-fold>
 
    //<editor-fold desc="初始化文本">
    private fun initView() {
        //问题基本信息
        tv_problem_type_name!!.text = problemlistVo.typename
        tv_problem_time!!.text = DateFormatter.dateTimeFormat.format(problemlistVo.time)
        tv_problem_location!!.text = problemlistVo.location
        tv_problem_name!!.text = problemlistVo.problemname
        //逾期天数
        text_deadline_status!!.text = textData.text_deadline_status
        text_remaining_days!!.text = textData.text_remaining_days
        //是否整改
        image_promise!!.isSelected = textData.text_promise_selected
        text_promise!!.text = textData.text_promise
        //整改截止日期
        text_change_deadline!!.text = textData.text_change_deadline
        text_change_deadline!!.visibility = textData.change_deadline_visible
        //整改类型
        if (problemType == Constant.CHANGED && problemlistVo.changecatalog != null) {
            text_change_type!!.text = problemlistVo.changecatalog
        } else {
            text_change_type!!.visibility = View.INVISIBLE
        }
        cl_deadline!!.visibility = textData.cl_deadline_visible
 
        //整改建议
        if (problemlistVo.advise != null) {
            text_change_tips!!.text = problemlistVo.advise
        }
        if (problemType == Constant.UNCHANGED) {
            refreshSaveBtn(1)
            text_upload_photo!!.setText(R.string.click_to_upload_photo)
            text_upload_photo!!.setTextColor(resources.getColor(R.color.black))
            group_change_effect!!.visibility = View.GONE
        } else {
            refreshSaveBtn(2)
            text_upload_photo!!.setText(R.string.changed_photo)
            group_change_effect!!.visibility = View.VISIBLE
        }
    }
 
    //</editor-fold>
    private fun refreshSaveBtn(status: Int) {
        when (status) {
            1 -> {
 
                //未整改
                btn_save!!.setText(R.string.submit)
                btn_save!!.setBackgroundResource(R.drawable.shape_button_blue)
                btn_save!!.setOnClickListener { onButtonClick() }
            }
            2 -> {
 
                //已整改
                btn_save!!.setText(R.string.changed)
                btn_save!!.setBackgroundResource(R.drawable.shape_button_green)
                btn_save!!.setOnClickListener(null)
            }
            3 -> {
 
                //提交后修改图片
                btn_save!!.setText(R.string.submit_again)
                btn_save!!.setBackgroundResource(R.drawable.shape_button_blue)
                btn_save!!.setOnClickListener { onButtonClick() }
            }
        }
    }
 
    //<editor-fold desc="初始化地图定位">
    private fun initMap(savedInstanceState: Bundle?) {
        tmv_main!!.onCreate(savedInstanceState)
        val aMap = tmv_main!!.map
        var latLng: LatLng? = null
        val options = MarkerOptions()
        var bm: Bitmap? = null
 
        //获取问题定位
        val latitude = problemlistVo.latitude
        val longitude = problemlistVo.longitude
        if (latitude != null && longitude != null
            && latitude != 0.0 && longitude != 0.0
        ) {
            latLng = LatLng(problemlistVo.latitude, problemlistVo.longitude)
            bm = BitmapFactory.decodeResource(resources, R.drawable.icon_mark_red)
            val matrix = Matrix()
            matrix.setScale(0.28f, 0.28f)
            val bmBig = Bitmap.createBitmap(
                bm, 0, 0, bm.width,
                bm.height, matrix, true
            )
            options.icon(BitmapDescriptorFactory.fromBitmap(bmBig))
            options.position(latLng)
            val marker = aMap.addMarker(options)
            marker.isInfoWindowEnable = false
            aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14f))
            //隐藏默认图片
            tmv_main!!.visibility = View.VISIBLE
            image_no_map!!.visibility = View.GONE
        } else {
            tmv_main!!.visibility = View.GONE
            image_no_map!!.visibility = View.VISIBLE
        }
 
//        double scenseLat = application.getCurrentUser()
//        double scenseLng = intent.getDoubleExtra("scenseLng",0);
//        MarkerOptions siteMarkeroptions = new MarkerOptions().position(new LatLng(scenseLat,scenseLng));
//        aMap.addMarker(siteMarkeroptions);
    }
 
    //</editor-fold>
 
    //<editor-fold desc="获取已有的图片">
    private val mediafileListChange: MutableList<Mediafile> = ArrayList() //整改图片列表
    private val mediafileListProblem: MutableList<Mediafile> = ArrayList() //问题图片列表
    private fun updateMediafile() {
        val mediafileList = mediafileDao!!.queryBuilder()
            .where(MediafileDao.Properties.Businessguid.eq(problemlistVo.guid))
            .where(MediafileDao.Properties.Remark.eq("未上传"))
            .list()
        if (problemlistVo.mediafileList != null) {
            mediafileList.addAll(problemlistVo.mediafileList)
        }
        for (m in mediafileList) {
            if (m.ischanged) {
                mediafileListChange.add(m)
            } else {
                mediafileListProblem.add(m)
            }
        }
    }
 
    //</editor-fold>
 
    //<editor-fold desc="初始化问题图片">
    private fun initProblemPhoto(mediafileList: List<Mediafile>, imageViews: List<ImageView?>) {
        val photoCount = PhotoUtil.loadImage(mediafileList, imageViews, this) //将图片加载至对应的imageView上
        val files: MutableList<File> = ArrayList()
        for (m in mediafileList) {
            val tempFile = FileUtil.getFileFromMediaFile(m)
            files.add(tempFile)
        }
        for (i in 0 until photoCount) { //添加图片放大点击事件
            imageViews[i]?.setOnClickListener(
                    PhotoUtil.OnPhotoViewClickListener(
                        this,
                        files,
                        i,
                        mediafileList,
                        PhotoViewerActivity.PROBLEM_PHOTO,
                        false
                    )
                )
        }
    }
    //</editor-fold>
 
    //<editor-fold desc="初始化已上传整改的图片">
    //整改图片
    /**
     *
     * @param mediafileList
     * @param imageViews
     */
    @Deprecated("20190719 上传完成后,客户需要能够修改上传图片的功能,即也能拍照和删除图片,此函数删去")
    private fun initChangedPhoto(mediafileList: List<Mediafile>, imageViews: List<ImageView>) {
        val photoCount = PhotoUtil.loadImage(mediafileList, imageViews, this) //将图片加载至对应的imageView上
        val files: MutableList<File> = ArrayList()
        for (m in mediafileList) {
            val tempFile = FileUtil.getFileFromMediaFile(m)
            files.add(tempFile)
        }
        for (i in 0 until photoCount) { //添加图片放大点击事件
            imageViews[i]
                .setOnClickListener(
                    PhotoUtil.OnPhotoViewClickListener(
                        this,
                        files,
                        i,
                        mediafileList,
                        PhotoViewerActivity.CHANGE_PHOTO,
                        true
                    )
                )
        }
    }
    //</editor-fold>
 
    //<editor-fold desc="初始化未上传整改的图片">
    /**
     *
     * @param mediafileList 在未整改时,列表[.mediafileListChange]从数据库获取的结果是空,因此此处可直接将该列表对象用于整改时的新图片上传
     * @param imageViews
     */
    private fun initChangingPhoto(mediafileList: List<Mediafile>, imageViews: List<ImageView?>) {
        var photoCount = PhotoUtil.loadImage(mediafileList, imageViews, this)
        val files: MutableList<File> = ArrayList()
        for (m in mediafileList) {
            val tempFile = FileUtil.getFileFromMediaFile(m)
            files.add(tempFile)
        }
        for (i in 0 until photoCount) { //添加图片放大点击事件
            imageViews[i]?.setOnClickListener(
                    PhotoUtil.OnPhotoViewClickListener(
                        this,
                        files,
                        i,
                        mediafileList,
                        PhotoViewerActivity.CHANGE_PHOTO,
                        true
                    )
                )
        }
        if (photoCount >= 3) return
        val leftCount = if (3 - photoCount > 0) 3 - photoCount else 0
        val image_addPhoto = imageViews[photoCount]
        image_addPhoto!!.setImageResource(R.drawable.icon_add_photo)
        image_addPhoto.setOnClickListener { PhotoUtil.pickPhoto2(this@ProblemChangeDetailActivity, PICK_CHANGE_PHOTO, leftCount) }
        while (++photoCount < imageViews.size) {
            imageViews[photoCount]!!.setImageResource(R.drawable.icon_add_photo_blank)
        }
    }
 
    //</editor-fold>
 
    //<editor-fold desc="获取整改图片路径">
    private var fileCurrent: File? = null
    private val filePath: File
        get() {
            val mediafile = mediafileListProblem[0]
            val path = (mediafile.path
                    + "整改/"
                    + problemlistVo.problemname
                    + " "
                    + problemlistVo.location
                    + " 整改 "
                    + UUIDGenerator.generateUUID(4)
                    + ".jpg")
            val newFile = File(Environment.getExternalStorageDirectory(), path)
            if (!newFile.parentFile.exists()) {
                newFile.parentFile.mkdirs()
            }
            fileCurrent = newFile
            return newFile
        }
 
    //</editor-fold>
 
    //<editor-fold desc="点击事件">
    private fun refreshProblemStatus() {
        //整改图片全删除后,问题退回未整改审核通过状态
        if (mediafileListChange.isEmpty()) {
            problemlistVo.ischanged = false //设置为未整改
            problemlistVo.extension3 = Domain.PROBLEM_CHECK_PASS
            problemlistVo.changedtime = null
            problemlistVo.changecatalog = null
        } else {
            problemlistVo.ischanged = true //设置为已整改
            problemlistVo.extension3 = Domain.CHANGE_UNCHECKED //设置为整改待审核
            problemlistVo.changedtime = Date() //设置整改时间为当前时间
            problemlistVo.mediafileList.clear()
            problemlistVo.mediafileList.addAll(mediafileListProblem)
            problemlistVo.mediafileList.addAll(mediafileListChange) //将新增的图片添加进媒体文件列表,用于app数据刷新
            val calendar = Calendar.getInstance()
            val today = calendar[Calendar.DAY_OF_YEAR]
            calendar.time = problemlistVo.time
            val problemDay = calendar[Calendar.DAY_OF_YEAR]
            //有承诺整改的日期
            if (problemlistVo.extension1 != null) {
                //整改时间已超过监管当天的24点,则认为是承诺整改
                if (today > problemDay) {
                    problemlistVo.changecatalog = Domain.PROMISE_CHANGE
                } else {
                    problemlistVo.changecatalog = Domain.LOACAL_CHANGE
                }
            } else {
                problemlistVo.changecatalog = Domain.UNPROMISE_CHANGE
            }
        }
    }
 
    //提交问题
    var loadingDialog: Dialog? = null
    fun onButtonClick() {
//        if (!problemType.equals(Constant.UNCHANGED)) {
//            return;
//        }
        if (isEdited) {
            loadingDialog = DialogUtil.createLoadingDialog(this, "")
            upLoadPic()
        } else {
            Toast.makeText(application, R.string.take_one_change_photo_at_least, Toast.LENGTH_SHORT).show()
        }
    }
 
    override fun onBackPressed() {
//        super.onBackPressed();
        close()
    }
 
 
    private fun initClickListener() {
        image_close.setOnClickListener { close() }
    }
 
    private fun close() {
        if (isEdited) {
            val dialog = AlertDialog.Builder(this)
            dialog.setMessage("整改图片还未提交,是否退出?")
            dialog.setPositiveButton("确定") { dialogInterface, i -> finish() }
            dialog.setNegativeButton("取消", null)
            dialog.show()
        } else {
            supportFinishAfterTransition()
        }
    }
 
    private fun uploadProblem() {
        refreshProblemStatus()
        val updateProblemList = application!!.retrofit.create(ProblemListService::class.java).updateProblemList(problemlistVo)
        updateProblemList.enqueue(object : Callback<ResponseBody?> {
            override fun onResponse(call: Call<ResponseBody?>, response: Response<ResponseBody?>) {
                if (response.body() != null) {
                    Toast.makeText(application, R.string.submit_success, Toast.LENGTH_LONG).show()
                    if (loadingDialog != null && loadingDialog!!.isShowing) {
                        loadingDialog!!.dismiss()
                    }
                    //返回requestCode
                    val intent = Intent()
                    intent.putExtra(ARG_PROBLEM, problemlistVo)
                    setResult(RESULT_OK, intent)
 
                    //发送数据更新广播
                    val intent1 = Intent("cn.flightfeather.thirdapp.broadcasereceiver.MainReceiver")
                    intent1.action = Constant.REFRESH_DATA
                    intent1.putExtra(ARG_PROBLEM, problemlistVo)
                    sendBroadcast(intent1)
                    finish()
                } else if (response.errorBody() != null) {
                    Toast.makeText(application, R.string.submit_unsuccess, Toast.LENGTH_LONG).show()
                    loadingDialog!!.dismiss()
                }
            }
 
            override fun onFailure(call: Call<ResponseBody?>, t: Throwable) {
                Toast.makeText(application, R.string.network_error, Toast.LENGTH_LONG).show()
                loadingDialog!!.dismiss()
            }
        })
    }
 
    private fun upLoadPic() {
 
        //筛选“未上传”的图片
        val mediafiles: MutableList<Mediafile> = ArrayList()
        for (m in mediafileListChange) {
            if (m.remark == "未上传") {
                mediafiles.add(m)
            }
        }
        val photoUtil = PhotoUtil(mediafiles.size, application, object : OnUpLoadListener {
            override fun onSuccess() {
                uploadProblem()
            }
 
            override fun onFail() {
                Toast.makeText(application, "上传失败,请重试", Toast.LENGTH_SHORT).show()
                loadingDialog!!.dismiss()
                //                AlertDialog.Builder dialog = new AlertDialog.Builder(application);
//                dialog.setMessage("图片上传失败,请重试");
//                dialog.setPositiveButton("确定", new DialogInterface.OnClickListener() {
//                    @Override
//                    public void onClick(DialogInterface dialogInterface, int i) {
//                        finish();
//                    }
//                });
//                dialog.show();
            }
        })
        photoUtil.upLoadPhoto(mediafiles)
    } //</editor-fold>
 
    companion object {
        //<editor-fold desc="全局变量">
        const val ARG_PROBLEM = "problems"
        const val ARG_PROBLEM_TYPE = "problemType"
        const val ARG_TEXT_DATA = "textData"
    }
}