package com.gallery.free.wallpaper.environment.hy

import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner

/**
 * 判断mainActivity是否回到了前台
 */
object AppLifecycleTracker : DefaultLifecycleObserver {
    var isMainActivityVisible = false
        private set

    override fun onResume(owner: LifecycleOwner) {
        isMainActivityVisible = true
    }

    override fun onPause(owner: LifecycleOwner) {
        isMainActivityVisible = false
    }
}