FunctionCenterActivity.kt 1.71 KB
Newer Older
1 2 3 4
package com.miya.fastcashier.log

import android.content.Intent
import android.os.Bundle
赵鹏翔's avatar
赵鹏翔 committed
5
import com.fastcashier.lib_common.base.BaseActivity
6
import com.fastcashier.lib_common.util.clickWithTrigger
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
import com.miya.fastcashier.databinding.ActivityFunctionCenterBinding
import com.miya.fastcashier.utils.LogFileUtils

/**
 * 功能中心
 * @author zpxiang
 */
class FunctionCenterActivity : BaseActivity() {

    private lateinit var viewBinding: ActivityFunctionCenterBinding
    private var systemDialog: SystemParameterDialog? = null

    companion object {
        fun start(context: BaseActivity) {
            var intent = Intent()
            intent.setClass(context, FunctionCenterActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        viewBinding = ActivityFunctionCenterBinding.inflate(layoutInflater)
        setContentView(viewBinding.root)

        viewBinding.moreOpExit.clickWithTrigger { finish() }
        viewBinding.vLog.clickWithTrigger { toUploadLog() }
        viewBinding.vSystem.clickWithTrigger { showSystemParamterDialog() }
    }

    fun toUploadLog() {
38 39 40 41 42 43 44
        LFilePicker()
            .withActivity(this)
            .withStartPath(LogFileUtils.CACHE_FILE_PATH) //指定初始显示路径
            .withIsGreater(true) //过滤文件大小 小于指定大小的文件
            .withFileSize(0) //指定文件大小为500K
            .withMutilyMode(false)
            .start()
45 46 47 48 49 50 51 52 53 54
    }


    fun showSystemParamterDialog() {
        if (null == systemDialog) {
            systemDialog = SystemParameterDialog(this@FunctionCenterActivity)
        }
        systemDialog!!.show()
    }
}