package com.base.browserwhite.ui.activity.result

import android.annotation.SuppressLint
import android.graphics.Color
import com.base.browserwhite.bean.ConstObject.JUNK_CLEANER
import com.base.browserwhite.databinding.ActivityResultBinding
import com.base.browserwhite.ui.activity.BaseActivity
import com.base.browserwhite.utils.AppPreferences
import com.base.browserwhite.utils.BarUtils
import com.base.browserwhite.utils.KotlinExt.toFormatSize
import com.google.gson.JsonObject

class ResultActivity : BaseActivity<ActivityResultBinding>() {


    override val binding: ActivityResultBinding by lazy {
        ActivityResultBinding.inflate(layoutInflater)
    }

    @SuppressLint("SetTextI18n")
    override fun initView() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
//        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())

        val from = intent.getStringExtra("from")
        when (from) {
            JUNK_CLEANER -> {
                val cleanSize = intent.getLongExtra("clean_size", 0L)
                if (cleanSize > 0) {
                    binding.tvTip.text = "Cleaned up ${cleanSize.toFormatSize(1)}"
                } else {
                    binding.tvTip.text = "No junk files found."
                }
            }
        }
    }


}